Browse Source

feat(ai.aiyunyi.uploadCard): S-cfc-475 TDD-GREEN 上传页 AI 快速识别入口卡片与路由

report-upload.vue 新增第三张「AI 快速识别」卡片(@click=startAiDetect),复用 ensureMember/ensureAgreed 门禁后跳转 ai-detect;pages.json 注册 ai-detect / ai-report-detail / ai-video-detect 三条路由。红单测 9 失败转 9 通过。
Administrator 1 hour ago
parent
commit
3a521e6ad3
2 changed files with 53 additions and 11 deletions
  1. 18 0
      cfc-frontend/pages.json
  2. 35 11
      cfc-frontend/pages/health/report-upload.vue

+ 18 - 0
cfc-frontend/pages.json

@@ -992,6 +992,24 @@
             "navigationBarTitleText": "上传报告"
             "navigationBarTitleText": "上传报告"
           }
           }
         },
         },
+        {
+          "path": "ai-detect",
+          "style": {
+            "navigationBarTitleText": "AI 快速识别"
+          }
+        },
+        {
+          "path": "ai-report-detail",
+          "style": {
+            "navigationBarTitleText": "AI 检测报告"
+          }
+        },
+        {
+          "path": "ai-video-detect",
+          "style": {
+            "navigationBarTitleText": "AI 视频检测"
+          }
+        },
         {
         {
           "path": "report-confirm",
           "path": "report-confirm",
           "style": {
           "style": {

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

@@ -30,14 +30,19 @@
     <view class="form-section">
     <view class="form-section">
       <view class="upload-methods">
       <view class="upload-methods">
         <view class="upload-card card-chat" @click="pickFromChat">
         <view class="upload-card card-chat" @click="pickFromChat">
-          <view class="upload-card-icon">💬</view>
-          <text class="upload-card-title">从聊天选取</text>
-          <text class="upload-card-desc">微信聊天中的 PDF / 图片报告</text>
+          <view class="method-icon">💬</view>
+          <text class="method-title">从聊天选取</text>
+          <text class="method-desc">微信聊天中的 PDF / 图片报告</text>
         </view>
         </view>
         <view class="upload-card card-photo" @click="takePhoto">
         <view class="upload-card card-photo" @click="takePhoto">
-          <view class="upload-card-icon">📷</view>
-          <text class="upload-card-title">拍照上传</text>
-          <text class="upload-card-desc">拍摄纸质报告(PDF 报告更佳)</text>
+          <view class="method-icon">📷</view>
+          <text class="method-title">拍照上传</text>
+          <text class="method-desc">拍摄纸质报告(PDF 报告更佳)</text>
+        </view>
+        <view class="upload-card card-ai" @click="startAiDetect">
+          <view class="method-icon">🤖</view>
+          <text class="method-title">AI 快速识别</text>
+          <text class="method-desc">拍照识别健康指标,快速生成检测结果</text>
         </view>
         </view>
       </view>
       </view>
 
 
@@ -396,6 +401,16 @@ if (options.type === 'a2' || options.reportKind === 'a2') {
         })
         })
       })
       })
     },
     },
+    // AI 快速识别入口:复用既有的「成员归属 + 数据使用声明」门禁后进入照片识别流程
+    startAiDetect: function() {
+      var self = this
+      if (!this.ensureMember()) return
+      this.ensureAgreed(function() {
+        var url = '/pages/health/ai-detect'
+        if (self.memberId) url += '?memberId=' + self.memberId
+        uni.navigateTo({ url: url })
+      })
+    },
     uploadReport: function(filePath, fileName) {
     uploadReport: function(filePath, fileName) {
       if (!filePath) return
       if (!filePath) return
       var self = this
       var self = this
@@ -675,7 +690,7 @@ if (options.type === 'a2' || options.reportKind === 'a2') {
 .upload-card:active {
 .upload-card:active {
   opacity: 0.85;
   opacity: 0.85;
 }
 }
-.upload-card-icon {
+.method-icon {
   width: 80rpx;
   width: 80rpx;
   height: 80rpx;
   height: 80rpx;
   border-radius: 24rpx;
   border-radius: 24rpx;
@@ -685,13 +700,13 @@ if (options.type === 'a2' || options.reportKind === 'a2') {
   justify-content: center;
   justify-content: center;
   margin-bottom: 16rpx;
   margin-bottom: 16rpx;
 }
 }
-.upload-card-title {
+.method-title {
   font-size: calc(26rpx * var(--font-scale, 1));
   font-size: calc(26rpx * var(--font-scale, 1));
   font-weight: 600;
   font-weight: 600;
   color: $facade-text-strong;
   color: $facade-text-strong;
   margin-bottom: 8rpx;
   margin-bottom: 8rpx;
 }
 }
-.upload-card-desc {
+.method-desc {
   font-size: calc(20rpx * var(--font-scale, 1));
   font-size: calc(20rpx * var(--font-scale, 1));
   color: $app-text-subtle;
   color: $app-text-subtle;
   line-height: 1.5;
   line-height: 1.5;
@@ -701,7 +716,7 @@ if (options.type === 'a2' || options.reportKind === 'a2') {
   background: $tint-sky-ghost;
   background: $tint-sky-ghost;
   border: 2rpx dashed $tint-blue-300;
   border: 2rpx dashed $tint-blue-300;
 }
 }
-.card-chat .upload-card-icon {
+.card-chat .method-icon {
   background: linear-gradient(135deg, $status-info, $status-info-deep-3);
   background: linear-gradient(135deg, $status-info, $status-info-deep-3);
   color: $app-surface;
   color: $app-surface;
 }
 }
@@ -710,11 +725,20 @@ if (options.type === 'a2' || options.reportKind === 'a2') {
   background: $uni-primary-pale;
   background: $uni-primary-pale;
   border: 2rpx solid $brand-primary-light-2;
   border: 2rpx solid $brand-primary-light-2;
 }
 }
-.card-photo .upload-card-icon {
+.card-photo .method-icon {
   background: linear-gradient(135deg, $brand-primary-light, $brand-primary-dark);
   background: linear-gradient(135deg, $brand-primary-light, $brand-primary-dark);
   color: $app-surface;
   color: $app-surface;
 }
 }
 
 
+.card-ai {
+  background: $violet-tint-100;
+  border: 2rpx solid $facade-violet;
+}
+.card-ai .method-icon {
+  background: linear-gradient(135deg, $facade-violet, $violet-tint-100);
+  color: $app-surface;
+}
+
 /* 采集中面板 */
 /* 采集中面板 */
 .collecting-panel {
 .collecting-panel {
   margin-bottom: 20rpx;
   margin-bottom: 20rpx;