fix(wechat): 协议页切后台暂停超时计时并全量映射技术文案
自动发布开发环境 Nacos 配置 / publish (push) Successful in 25s
环境分支晋级检查 / environment-promotion-source (pull_request_target) Successful in 5s

This commit is contained in:
2026-11-05 11:32:29 +08:00
parent 942718b8d9
commit 385c4b06ec
22 changed files with 214 additions and 59 deletions
+13 -1
View File
@@ -42,13 +42,25 @@ Page({
}
},
/**
* 切后台(来电、复制协议文本)只暂停挂起请求的超时计时,绝不结算;
* 回到前台后按剩余可见时长恢复,若挂起请求已不存在则恢复逻辑自动 no-op。
*/
onHide() {
request.pausePendingAgreementTimeout()
},
onShow() {
request.resumePendingAgreementTimeout()
},
onUnload() {
this.discardPendingIfNotAccepted()
},
/**
* 只有真正离开协议页(返回导致页面卸载)才结算被 4510 挂起的请求,避免调用方 loading 永久卡住;
* 切后台(如来电、复制协议文本)只触发 onHide,不结算;同意成功后也不再触发。
* 切后台只暂停计时、不结算;同意成功后也不再触发。
*/
discardPendingIfNotAccepted() {
if (this.data.mode !== 'accept' || this.agreementAccepted) {