feat: 侧滑返回

This commit is contained in:
2026-01-27 21:56:26 +08:00
parent 5990cf50cf
commit dba8c16c8a
@@ -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;