diff --git a/pages/other_package/productInfo/productInfo.vue b/pages/other_package/productInfo/productInfo.vue index 22cfa1c..6b4984b 100644 --- a/pages/other_package/productInfo/productInfo.vue +++ b/pages/other_package/productInfo/productInfo.vue @@ -544,6 +544,17 @@ export default { isSplash: false, }; }, + onBackPress(options) { + console.log("我是侧滑",options) + // #ifdef APP-PLUS + if (options.from === 'backbutton' && this.isSplash) { + // 1. 阻止默认 pop + plus.webview.currentWebview().canBack = false // 关键句 + uni.reLaunch({ url: '/pages/home/home' }) // 举例:回首页 + return true // 返回 true 即“我处理过了” + } + // #endif + }, onLoad(options) { const id = options.id; const source = options.source; @@ -577,6 +588,7 @@ export default { this ); }, + onHide() { timer && clearTimeout(timer); timer = null;