|
@@ -15,16 +15,30 @@ export default {
|
|
|
let main = plus.android.runtimeMainActivity();
|
|
|
that.openListen();
|
|
|
if (needStopSystem) {
|
|
|
- plus.key.addEventListener("backbutton", function (e) {
|
|
|
- // main.stopLockTask()//按返回键恢复
|
|
|
- // main.startLockTask()//阻止系统home建和近期任务键
|
|
|
- // main.unregisterReceiver(receiver); //同时停止接收home和recent点击
|
|
|
- const pages = getCurrentPages(); // 获取当前页面栈
|
|
|
- const currentPage = pages[pages.length - 1]; // 最后一个元素即为当前页面
|
|
|
- xunJianStores().modal.show = currentPage.route === 'pages/login' ? true : false
|
|
|
- console.log('监听返回')
|
|
|
- e.preventDefault();
|
|
|
- });
|
|
|
+ // if(plus.os.name == "Android"){
|
|
|
+ plus.key.addEventListener("backbutton", function (e) {
|
|
|
+ let that2 = e
|
|
|
+ setTimeout(()=>{
|
|
|
+ console.log(1,new Date().getTime(),e)
|
|
|
+ if(!uni.getStorageSync("backbutton")){
|
|
|
+ uni.setStorageSync("backbutton","bottom")
|
|
|
+ }
|
|
|
+ // console.log(2)
|
|
|
+ if(uni.getStorageSync("backbutton") == "bottom"){
|
|
|
+ // main.stopLockTask()//按返回键恢复
|
|
|
+ // main.startLockTask()//阻止系统home建和近期任务键
|
|
|
+ // main.unregisterReceiver(receiver); //同时停止接收home和recent点击
|
|
|
+ console.log('监听物理返回')
|
|
|
+ that2.preventDefault();
|
|
|
+ }else{
|
|
|
+ console.log('监听组件返回')
|
|
|
+ uni.setStorageSync("backbutton","bottom")
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },false);
|
|
|
+ // }
|
|
|
+
|
|
|
} else {
|
|
|
}
|
|
|
|