|
@@ -139,47 +139,7 @@
|
|
|
this.initFromOptions(cacheDataAuth);
|
|
this.initFromOptions(cacheDataAuth);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // 返回处理
|
|
|
|
|
- onBackPress(options) {
|
|
|
|
|
- if (options.from === 'backbutton') {
|
|
|
|
|
- // 返回键处理
|
|
|
|
|
- return this.handleHarmonyOSBack()
|
|
|
|
|
- }
|
|
|
|
|
- return false
|
|
|
|
|
- },
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
- handleHarmonyOSBack() {
|
|
|
|
|
- // 双击返回键退出应用
|
|
|
|
|
- if (!this.canExitApp) {
|
|
|
|
|
- this.canExitApp = true
|
|
|
|
|
-
|
|
|
|
|
- // 显示提示
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '再按一次退出应用',
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- duration: 2000
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- // 2秒后重置状态
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.canExitApp = false
|
|
|
|
|
- }, 2000)
|
|
|
|
|
-
|
|
|
|
|
- return true // 拦截返回事件
|
|
|
|
|
- } else {
|
|
|
|
|
- // 退出应用
|
|
|
|
|
- this.exitApp()
|
|
|
|
|
- return true
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- exitApp() {
|
|
|
|
|
- // #ifdef APP-PLUS || APP-PLUS-NVUE
|
|
|
|
|
- // 系统退出应用
|
|
|
|
|
- plus.runtime.quit()
|
|
|
|
|
- // #endif
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
// 从缓存初始化方法
|
|
// 从缓存初始化方法
|
|
|
initFromCache(cacheData) {
|
|
initFromCache(cacheData) {
|
|
|
console.log('cacheData',cacheData);
|
|
console.log('cacheData',cacheData);
|