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

debug: 加 console 跟踪 report-upload 点击事件链路

onLoad/onReady/toggleAgree/ensureAgreed/takePhoto/pickFile 入口加日志
目的是定位 @click 事件是否真正触发到 methods
liaoxg 1 месяц назад
Родитель
Сommit
3ec9d6ffd9
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      cfc-frontend/pages/health/report-upload.vue

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

@@ -13,6 +13,9 @@
       <text class="tip-text">上传体检/菌群报告、认知测评、心理测评或情绪打卡记录,为您生成个性化成长方案</text>
       <text class="tip-text">上传体检/菌群报告、认知测评、心理测评或情绪打卡记录,为您生成个性化成长方案</text>
     </view>
     </view>
 
 
+    <!-- DEBUG: 请截图此行是否存在,判断文件是否生效 -->
+    <view style="background:#f00;padding:10rpx;"><text style="color:#fff;font-size:28rpx;">DEBUG-v2: 声明弹窗已更新 {{agreedToTerms}}</text></view>
+
     <!-- 表单 -->
     <!-- 表单 -->
     <view class="form-section">
     <view class="form-section">
       <!-- 上传方式:并排卡片 -->
       <!-- 上传方式:并排卡片 -->
@@ -125,15 +128,21 @@ export default {
     }
     }
   },
   },
   onLoad: function(options) {
   onLoad: function(options) {
+    console.log('[report-upload] onLoad', options)
     this.memberId = options.memberId ? parseInt(options.memberId) : null
     this.memberId = options.memberId ? parseInt(options.memberId) : null
   },
   },
+  onReady() {
+    console.log('[report-upload] onReady, methods:', Object.keys(this.$options.methods))
+  },
   methods: {
   methods: {
     // 切换同意声明
     // 切换同意声明
     toggleAgree() {
     toggleAgree() {
+      console.log('[report-upload] toggleAgree called, current=', this.agreedToTerms)
       this.agreedToTerms = !this.agreedToTerms
       this.agreedToTerms = !this.agreedToTerms
     },
     },
     // 未勾选声明时弹窗确认
     // 未勾选声明时弹窗确认
     ensureAgreed(isPhoto) {
     ensureAgreed(isPhoto) {
+      console.log('[report-upload] ensureAgree called, isPhoto=', isPhoto, 'agreed=', this.agreedToTerms)
       if (this.agreedToTerms) {
       if (this.agreedToTerms) {
         this.startPick(isPhoto)
         this.startPick(isPhoto)
         return
         return
@@ -181,10 +190,12 @@ export default {
     },
     },
     // ===== 拍照上传 =====
     // ===== 拍照上传 =====
     takePhoto() {
     takePhoto() {
+      console.log('[report-upload] takePhoto clicked')
       this.ensureAgreed(true)
       this.ensureAgreed(true)
     },
     },
     // ===== 文件上传 =====
     // ===== 文件上传 =====
     pickFile() {
     pickFile() {
+      console.log('[report-upload] pickFile clicked')
       this.ensureAgreed(false)
       this.ensureAgreed(false)
     },
     },
     // 上传文件 → 自动跳转确认页(确认页按 draftId 触发解析并自动刷新显示结果)
     // 上传文件 → 自动跳转确认页(确认页按 draftId 触发解析并自动刷新显示结果)