feat(escort): 下单页增加免责协议勾选与协议弹层
提交预约前须勾选《全程陪诊服务免责协议》,点击协议名弹层查看全文;提交时回传所读版本,服务端判定过期则作废缓存并重新弹层要求重新确认。
This commit is contained in:
@@ -222,6 +222,29 @@ App({
|
||||
return this.globalData.agreementReady
|
||||
},
|
||||
|
||||
// 下单页的免责协议:与「用户协议」分开缓存,正文修订后随接口即时生效
|
||||
loadDisclaimer() {
|
||||
if (this.globalData.disclaimerReady) return this.globalData.disclaimerReady
|
||||
this.globalData.disclaimerReady = API.resource.getDisclaimer()
|
||||
.then((res) => {
|
||||
if (res.code !== 0 || !res.data?.disclaimer) throw new Error(res.msg || '免责协议加载失败')
|
||||
this.globalData.disclaimer = res.data.disclaimer
|
||||
return this.globalData.disclaimer
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('获取免责协议失败', err)
|
||||
this.globalData.disclaimerReady = null
|
||||
return null
|
||||
})
|
||||
return this.globalData.disclaimerReady
|
||||
},
|
||||
|
||||
// 服务端判定协议版本不一致后调用:作废缓存,下次 loadDisclaimer 重新拉取最新版
|
||||
invalidateDisclaimer() {
|
||||
this.globalData.disclaimer = null
|
||||
this.globalData.disclaimerReady = null
|
||||
},
|
||||
|
||||
// 已经拿到用户(如「我的」页手机号授权登录成功)就直接返回成功。
|
||||
// 但若此刻有静默登录在飞(token 可能正在轮换),要先等它落定:
|
||||
// 抢跑会让页面拿旧 token 发请求、收到 401 再触发一次重登 + 重试。
|
||||
@@ -353,6 +376,8 @@ App({
|
||||
hospitalsReady: null,
|
||||
agreement: null,
|
||||
agreementReady: null,
|
||||
disclaimer: null,
|
||||
disclaimerReady: null,
|
||||
authReady: null,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user