From 6710ed4fc4d67d4f6551d13dd38f7f2b21451d9d Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期五, 30 六月 2023 09:05:48 +0800 Subject: [PATCH] no message --- uniapp/App.vue | 76 +++++++++++++++++++++++++++++++++---- 1 files changed, 67 insertions(+), 9 deletions(-) diff --git a/uniapp/App.vue b/uniapp/App.vue index 0f3d6de..0838844 100644 --- a/uniapp/App.vue +++ b/uniapp/App.vue @@ -82,7 +82,8 @@ }); */ APPUpdate(); // #endif - this.getAppInfo() + this.getAppInfo(); + //this.that.bcInit(); let userInfo = uni.getStorageSync('userInfo') if (userInfo.id) { this.login(userInfo) @@ -135,7 +136,11 @@ userInfo: {}, canlisten: true, appinfo: {}, - ifwt: 0 + ifwt: 0, + hasinit:false, + hasbcinit:false, + isLaunch:false + }, onShow: function() { var that = this; @@ -147,10 +152,21 @@ content: '妫�娴嬪埌缃戠粶鏉冮檺鍙兘璁剧疆涓哄叧闂紝鎮ㄥ彲浠ュ湪鈥滆缃�濅腑妫�鏌ユ棤绾挎暟鎹強铚傜獫绉诲姩缃戠粶' }) }else{ - let appInfo = utils.getCacheSync('appInfo') - if(appInfo == "" || appInfo == undefined){ + console.log("鏄惁璇锋眰杩囷細"+that.globalData.hasinit) + if(!that.globalData.hasinit) + { that.getAppInfo(); } + if(!that.globalData.hasbcinit) + { + console.log("鍒濆鍖栫櫨宸濇彃浠�") + that.bcInit(); + } + /* let appInfo = utils.getCacheSync('appInfo') + if(appInfo == "" || appInfo == undefined){ + console.log("鑾峰彇鏂规硶") + that.getAppInfo(); + } */ } } }) @@ -159,7 +175,6 @@ var route = routes[routes.length - 1].route } // #ifdef APP-PLUS - console.log(this.globalData.canlisten) if (this.globalData.canlisten && route != 'pages/mine/tools/turnChain') { getClipboard() } @@ -169,15 +184,41 @@ onHide: function() {}, methods: { ...mapMutations(['login']), + bcInit:function() + { + var that = this; + console.log(uni.getSystemInfoSync().platform); + if (uni.getSystemInfoSync().platform == 'ios') + { + const plug = uni.requireNativePlugin('xiguazhu-baichuan'); + console.log(plug) + plug.init({}, result => { + //console.log('1111111111111111111'); + console.log(result); // code绛変簬0灏辨槸鍒濆鍖栨垚鍔� + if(result.code==0) + { + that.globalData.hasbcinit=true; + } + }); + } + else{ + that.globalData.hasbcinit=true; + } + }, getAppInfo: function() { var that = this; + that.globalData.hasinit=true; this.$u.api.comminInt({}).then(e => { - if (e.code != 0) return that.$alert(e.msg) + if (e.code != 0) + { + that.globalData.hasinit=false; + return that.$alert(e.msg) + } that.globalData.appinfo = e.data.basic utils.setCache('appInfo', e.data.basic) utils.setCache('baseUrl', this.$u.http.config.baseUrl) // #ifdef APP-PLUS - if (plus.os.name == 'iOS') { + if (plus.os.name == 'iOS') { if (that.globalData.appinfo.iosExamine && plus.runtime.version == e.data.basic.IosExamineV) { that.globalData.ifwt = 0 } else { @@ -195,6 +236,7 @@ if (plus.runtime.isApplicationExist({pname:'com.tencent.mm', action: 'weixin://' })) { + console.log("瀹夊崜绔凡瀹夎寰俊") that.globalData.ifwt = 1 //鏄惁瀹夎寰俊 1浠h〃瀹夎 } else { console.log("瀹夊崜绔湭瀹夎寰俊") @@ -202,9 +244,25 @@ } } // #endif - }).catch(function(err) {}) - + }).catch(function(err) {that.globalData.hasinit=false;}) + }, + + watch:function(method,istr){ + var obj=this.globalData + console.log(obj) + Object.defineProperty(obj,istr,{ + configurable:true, + enumerable:true, + set:function(value){ + this._consumerGoodsStatus=value + method(value) + }, + get:function(value){ + return this._consumerGoodsStatus + } + }) + }, }, } </script> -- Gitblit v1.9.3