Browse Source

Merge branch 'dev/v1.2.11_wmh' of jianyu/jy-docs into feature/v1.2.11

wenmenghao 1 year ago
parent
commit
cb1268c3f2

+ 14 - 0
jydocs-mobile/src/utils/globalFunctionsForApp.ts

@@ -15,6 +15,20 @@ export function hiddenBottomBar (params = 0) {
     }
   }
 }
+/**
+ * 客户端打开新窗口
+ * @param link 目标链接
+ * @param title 窗口标题
+ */
+export function appCallOpenWindow (link: string, title = '剑鱼标讯') {
+  if (inApp) {
+    try {
+      JyObj.openExternalLink(link, title)
+    } catch (e) {
+      console.warn('error: app call openExternalLink')
+    }
+  }
+}
 
 // 分享封装
 export function shareToOthers (options: any = {}) {

+ 6 - 1
jydocs-mobile/src/views/details/details.vue

@@ -231,6 +231,7 @@ import Ad from '@/components/Ad.vue'
 import { MixinTop } from '@/utils/mixin-top'
 import { weChatShare } from '@/utils/wxShare'
 import { formatSize, dateFormatter } from '@/utils/globalFunctions'
+import { appCallOpenWindow } from '@/utils/globalFunctionsForApp'
 import { isAdd } from '@/api'
 import { getDocPay } from '@/api/main'
 import pdf from 'vue-pdf'
@@ -652,7 +653,11 @@ export default class extends Vue {
     if (type === 'down') { // 下载
       this.getDown({ docId: this.docIds }).then((res: any) => {
         if (res.error_code === 0) {
-          window.location.href = res.data
+          if (this.$env.platform === 'app' && this.$env.platform.platformOS === 'ios') {
+            appCallOpenWindow(res.data)
+          } else {
+            window.location.href = res.data
+          }
         }
       })
     } else if (type === 'vipget') { // 会员下载