Просмотр исходного кода

debug: 加 try-catch+fail+complete 跟踪 uni.showModal 是否执行

liaoxg 1 месяц назад
Родитель
Сommit
b7ac81385a
1 измененных файлов с 24 добавлено и 11 удалено
  1. 24 11
      cfc-frontend/pages/health/report-upload.vue

+ 24 - 11
cfc-frontend/pages/health/report-upload.vue

@@ -215,18 +215,31 @@ export default {
         this.startPick(false)
         return
       }
-      uni.showModal({
-        title: '数据使用声明',
-        content: '上传报告即代表您同意平台使用本报告数据进行分析,为您提供个性化健康解决方案;未经您授权,平台不会以任何形式将您的报告内容提供给其他任何个人或机构。点击「同意并继续」即表示您已阅读并同意。',
-        confirmText: '同意并继续',
-        cancelText: '暂不',
-        success: (res) => {
-          if (res.confirm) {
-            this.agreedToTerms = true
-            this.startPick(false)
+      console.log('[report-upload] about to call uni.showModal')
+      try {
+        uni.showModal({
+          title: '数据使用声明',
+          content: '上传报告即代表您同意平台使用本报告数据进行分析,为您提供个性化健康解决方案;未经您授权,平台不会以任何形式将您的报告内容提供给其他任何个人或机构。点击「同意并继续」即表示您已阅读并同意。',
+          confirmText: '同意并继续',
+          cancelText: '暂不',
+          success: (res) => {
+            console.log('[report-upload] modal success:', res)
+            if (res.confirm) {
+              this.agreedToTerms = true
+              this.startPick(false)
+            }
+          },
+          fail: (err) => {
+            console.log('[report-upload] modal fail:', err)
+          },
+          complete: () => {
+            console.log('[report-upload] modal complete')
           }
-        }
-      })
+        })
+        console.log('[report-upload] uni.showModal called without throwing')
+      } catch (e) {
+        console.log('[report-upload] uni.showModal THREW:', e.message, e.stack)
+      }
     },
     // 上传文件 → 自动跳转确认页(确认页按 draftId 触发解析并自动刷新显示结果)
     uploadAndGoConfirm(filePath, type) {