Răsfoiți Sursa

fix(mini): 统一人才详情页视频播放方式,所有环境使用弹窗播放

- 移除 H5 环境下视频直接跳转的逻辑
- 先判断文件类型再处理,视频优先使用弹窗播放
- 确保所有环境(H5/小程序)视频播放体验一致

Co-Authored-By: Claude <noreply@anthropic.com>
yourname 1 săptămână în urmă
părinte
comite
496f6ef89d

+ 7 - 8
mini-ui-packages/yongren-talent-management-ui/src/pages/TalentDetail/TalentDetail.tsx

@@ -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) => {