|
|
@@ -308,13 +308,7 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- // 在H5环境中使用window.open
|
|
|
- if (process.env.TARO_ENV === 'h5') {
|
|
|
- window.open(url, '_blank')
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- // 在小程序中根据文件类型选择不同的处理方式
|
|
|
+ // 先判断文件类型,视频使用弹窗播放(所有环境统一)
|
|
|
const fileType = getFileType(url)
|
|
|
|
|
|
switch (fileType) {
|
|
|
@@ -333,7 +327,12 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
break
|
|
|
|
|
|
case 'other':
|
|
|
- // 其他文件使用 Taro.openDocument
|
|
|
+ // H5 环境直接打开文件
|
|
|
+ if (process.env.TARO_ENV === 'h5') {
|
|
|
+ window.open(url, '_blank')
|
|
|
+ break
|
|
|
+ }
|
|
|
+ // 小程序环境使用 Taro.openDocument
|
|
|
Taro.downloadFile({
|
|
|
url: url,
|
|
|
success: (res) => {
|