|
@@ -245,8 +245,10 @@ export default {
|
|
|
/** 是否付费年度家庭会员(不受重做次数限制) */
|
|
/** 是否付费年度家庭会员(不受重做次数限制) */
|
|
|
canRecreate: function() {
|
|
canRecreate: function() {
|
|
|
if (this.isPaidAnnualFamily) return true
|
|
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)
|
|
return !uni.getStorageSync(key)
|
|
|
},
|
|
},
|
|
|
healthStatusSummary: function() {
|
|
healthStatusSummary: function() {
|
|
@@ -360,15 +362,17 @@ export default {
|
|
|
if (!this.canRecreate) {
|
|
if (!this.canRecreate) {
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
|
- content: '非付费会员每月仅限重新制定一次,升级年度家庭会员可无限次重做',
|
|
|
|
|
|
|
+ content: '非付费会员今日重新制定次数已用尽,明日再试,或升级年度家庭会员无限次重做',
|
|
|
showCancel: false,
|
|
showCancel: false,
|
|
|
confirmText: '知道了'
|
|
confirmText: '知道了'
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- // 标记已使用一次(非付费会员)
|
|
|
|
|
|
|
+ // 标记今日已使用一次(非付费会员)
|
|
|
if (!this.isPaidAnnualFamily) {
|
|
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)
|
|
if (key) uni.setStorageSync(key, true)
|
|
|
}
|
|
}
|
|
|
// 重置为新建模式
|
|
// 重置为新建模式
|