Explorar el Código

fix(frontend): 健康方案重做限制改为每日一次

- 非付费会员重新制定从每月一次改为每日一次
- localStorage key 改为按日期(yyyy-M-d)记录
- 提示文案同步更新

Ultraworked with [Sisyphus](https://github.com/OhMyOpenCode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
E2E Test Bot hace 1 mes
padre
commit
f6f5327609
Se han modificado 1 ficheros con 9 adiciones y 5 borrados
  1. 9 5
      cfc-frontend/pages/health/health-plan-summary.vue

+ 9 - 5
cfc-frontend/pages/health/health-plan-summary.vue

@@ -245,8 +245,10 @@ export default {
     /** 是否付费年度家庭会员(不受重做次数限制) */
     canRecreate: function() {
       if (this.isPaidAnnualFamily) return true
-      // 非付费会员:仅可重新制定一次(通过 localStorage 记录)
-      var key = 'health_plan_recreate_used_' + (this.planDetail && this.planDetail.familyId ? this.planDetail.familyId : '')
+      // 非付费会员:每日仅限重新制定一次
+      var today = new Date()
+      var dateKey = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate()
+      var key = 'health_plan_recreate_used_' + dateKey
       return !uni.getStorageSync(key)
     },
     healthStatusSummary: function() {
@@ -360,15 +362,17 @@ export default {
       if (!this.canRecreate) {
         uni.showModal({
           title: '提示',
-          content: '非付费会员每月仅限重新制定一次,升级年度家庭会员可无限次重做',
+          content: '非付费会员今日重新制定次数已用尽,明日再试,或升级年度家庭会员无限次重做',
           showCancel: false,
           confirmText: '知道了'
         })
         return
       }
-      // 标记已使用一次(非付费会员)
+      // 标记今日已使用一次(非付费会员)
       if (!this.isPaidAnnualFamily) {
-        var key = 'health_plan_recreate_used_' + (this.planDetail && this.planDetail.familyId ? this.planDetail.familyId : '')
+        var today = new Date()
+        var dateKey = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate()
+        var key = 'health_plan_recreate_used_' + dateKey
         if (key) uni.setStorageSync(key, true)
       }
       // 重置为新建模式