fix(wechat): 协议页切后台暂停超时计时并全量映射技术文案
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user