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

feat(upload): 上传报告前增加责任声明勾选

用户上传报告前必须勾选同意声明:同意平台使用数据进行分析并提供健康
解决方案,平台承诺未经授权不向第三方提供报告内容。未勾选时点击上传
卡片会弹出确认弹窗,用户同意后自动勾选并继续选文件流程。

Closes: 报告上传用户隐私声明需求
Xiaogang Liao 2 месяцев назад
Родитель
Сommit
3ba0359b68
1 измененных файлов с 112 добавлено и 25 удалено
  1. 112 25
      cfc-frontend/pages/health/report-upload.vue

+ 112 - 25
cfc-frontend/pages/health/report-upload.vue

@@ -29,6 +29,19 @@
         </view>
       </view>
 
+      <!-- 责任声明 -->
+      <view class="form-item disclaimer-box">
+        <view class="disclaimer-check" @click="agreedToTerms = !agreedToTerms">
+          <view class="disclaimer-checkbox" :class="{ 'disclaimer-checked': agreedToTerms }">
+            <text class="disclaimer-checkmark" v-if="agreedToTerms">✓</text>
+          </view>
+          <text class="disclaimer-label">我已阅读并同意以下声明</text>
+        </view>
+        <view class="disclaimer-content">
+          <text class="disclaimer-text">我同意平台使用本报告数据进行分析,为我提供个性化健康解决方案;未经我授权,平台不会以任何形式将我的报告内容提供给其他任何个人或机构。</text>
+        </view>
+      </view>
+
       <!-- 上传中 -->
       <view class="form-item" v-if="uploading">
         <text class="form-label">上传中...</text>
@@ -77,6 +90,7 @@ export default {
       uploading: false,
       selectedFile: null,
       photoPath: null,
+      agreedToTerms: false,
       // 购买推荐
       recommendedProducts: [],
       loadingProducts: false
@@ -90,38 +104,62 @@ export default {
     this.loadRecommendProducts()
   },
   methods: {
-    // ===== 拍照上传 =====
-    takePhoto() {
+    // 未勾选声明时弹窗确认
+    ensureAgreed(isPhoto) {
+      if (this.agreedToTerms) {
+        this.startPick(isPhoto)
+        return
+      }
       var self = this
-      uni.chooseImage({
-        count: 1,
-        sourceType: ['camera', 'album'],
+      uni.showModal({
+        title: '数据使用声明',
+        content: '上传报告即代表您同意平台使用报告数据进行分析并提供个性化健康解决方案;平台承诺未经您授权,不会以任何形式将您的报告提供给其他任何个人或机构。点击「同意并继续」即表示您已阅读并同意。',
+        confirmText: '同意并继续',
+        cancelText: '暂不',
         success: function(res) {
-          self.photoPath = res.tempFilePaths[0]
-          // 拍照后直接上传并进入确认页
-          self.uploadAndGoConfirm(self.photoPath, 'image')
+          if (res.confirm) {
+            self.agreedToTerms = true
+            self.startPick(isPhoto)
+          }
         }
       })
     },
-    // ===== 文件上传 =====
-    pickFile() {
+    startPick(isPhoto) {
       var self = this
-      uni.chooseMessageFile({
-        count: 1,
-        type: 'file',
-        extension: ['pdf'],
-        success: function(res) {
-          var files = res.tempFiles
-          if (files && files.length > 0) {
-            self.selectedFile = files[0]
-            // 直接上传并进入确认页(后端会自行处理成员匹配)
-            self.uploadAndGoConfirm(files[0].path, '')
+      if (isPhoto) {
+        uni.chooseImage({
+          count: 1,
+          sourceType: ['camera', 'album'],
+          success: function(res) {
+            self.photoPath = res.tempFilePaths[0]
+            self.uploadAndGoConfirm(self.photoPath, 'image')
           }
-        },
-        fail: function(e) {
-          console.log('选择文件取消或失败', e)
-        }
-      })
+        })
+      } else {
+        uni.chooseMessageFile({
+          count: 1,
+          type: 'file',
+          extension: ['pdf'],
+          success: function(res) {
+            var files = res.tempFiles
+            if (files && files.length > 0) {
+              self.selectedFile = files[0]
+              self.uploadAndGoConfirm(files[0].path, '')
+            }
+          },
+          fail: function(e) {
+            console.log('选择文件取消或失败', e)
+          }
+        })
+      }
+    },
+    // ===== 拍照上传 =====
+    takePhoto() {
+      this.ensureAgreed(true)
+    },
+    // ===== 文件上传 =====
+    pickFile() {
+      this.ensureAgreed(false)
     },
     // 上传文件 → 自动跳转确认页(确认页按 draftId 触发解析并自动刷新显示结果)
     uploadAndGoConfirm(filePath, type) {
@@ -280,6 +318,55 @@ export default {
   height: 60rpx;
 }
 
+/* ===== 责任声明 ===== */
+.disclaimer-box {
+  background: #FFF8F0;
+  border: 2rpx solid #FDE68A;
+}
+.disclaimer-check {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-bottom: 12rpx;
+}
+.disclaimer-checkbox {
+  width: 36rpx;
+  height: 36rpx;
+  border-radius: 6rpx;
+  border: 2rpx solid #CBD5E1;
+  background: #fff;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-shrink: 0;
+  margin-right: 12rpx;
+}
+.disclaimer-checked {
+  background: #5B9BD5;
+  border-color: #5B9BD5;
+}
+.disclaimer-checkmark {
+  font-size: 24rpx;
+  color: #fff;
+  font-weight: bold;
+}
+.disclaimer-label {
+  font-size: 24rpx;
+  color: #333;
+  font-weight: 500;
+}
+.disclaimer-content {
+  background: #FFFDF5;
+  border-radius: 10rpx;
+  padding: 16rpx;
+  margin-left: 48rpx;
+}
+.disclaimer-text {
+  font-size: 22rpx;
+  color: #92400E;
+  line-height: 1.6;
+}
+
 /* ===== 上传方式:并排卡片 ===== */
 .upload-methods {
   display: flex;