|
|
@@ -123,6 +123,23 @@ export default {
|
|
|
// #endif
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ //#ifdef APP-PLUS
|
|
|
+ let main = plus.android.runtimeMainActivity();
|
|
|
+ //为了防止快速点按返回键导致程序退出重写quit方法改为隐藏至后台
|
|
|
+ plus.runtime.quit = function(){
|
|
|
+ main.moveTaskToBack(true)
|
|
|
+ };
|
|
|
+ //重写toast方法如果内容为 ‘再按一次退出应用’ 就隐藏应用,其他正常toast
|
|
|
+ plus.nativeUI.toast = (function(str){
|
|
|
+ if(str == '再按一次退出应用'){
|
|
|
+ main.moveTaskToBack(true)
|
|
|
+ }else{
|
|
|
+ uni.showToast({ title: '再按一次退出应用', icon:'none', })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+
|
|
|
},
|
|
|
onShow(){
|
|
|
if (isLogin()&&!this.$util.isEmpty(this.getLoginInfo)) {
|