From 9aff0b29d4d68e3b2d4118c27e2c792037455440 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期二, 06 六月 2023 13:42:46 +0800 Subject: [PATCH] no message --- uniapp/pages/goods/goodsDetail.vue | 7 +++++++ uniapp/components/empowerModel.vue | 4 ++++ uniapp/App.vue | 24 +++++++++++++++++++++++- uniapp/pages/mine/mine.vue | 19 +++++++++++-------- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/uniapp/App.vue b/uniapp/App.vue index ad3c38f..28c9a50 100644 --- a/uniapp/App.vue +++ b/uniapp/App.vue @@ -137,6 +137,7 @@ appinfo: {}, ifwt: 0, hasinit:false, + hasbcinit:false, }, onShow: function() { @@ -154,7 +155,10 @@ { that.getAppInfo(); } - + if(!that.globalData.hasbcinit) + { + that.bcInit(); + } /* let appInfo = utils.getCacheSync('appInfo') if(appInfo == "" || appInfo == undefined){ console.log("鑾峰彇鏂规硶") @@ -178,6 +182,23 @@ 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(result); // code绛変簬0灏辨槸鍒濆鍖栨垚鍔� + if(result.code==0) + { + that.globalData.hasbcinit=true; + } + }); + } + }, getAppInfo: function() { var that = this; this.$u.api.comminInt({}).then(e => { @@ -217,6 +238,7 @@ }).catch(function(err) {}) }, + watch:function(method,istr){ var obj=this.globalData console.log(obj) diff --git a/uniapp/components/empowerModel.vue b/uniapp/components/empowerModel.vue index 56a2be3..1e06b80 100644 --- a/uniapp/components/empowerModel.vue +++ b/uniapp/components/empowerModel.vue @@ -34,6 +34,10 @@ }, created() { this.applogo = getApp().globalData.appinfo.logo + if(!getApp().globalData.hasbcinit) + { + getApp().bcInit(); + } /* console.log(uni.getSystemInfoSync().platform); if (uni.getSystemInfoSync().platform == 'ios') { plug.init({}, result => { diff --git a/uniapp/pages/goods/goodsDetail.vue b/uniapp/pages/goods/goodsDetail.vue index 108156d..c0ac99a 100644 --- a/uniapp/pages/goods/goodsDetail.vue +++ b/uniapp/pages/goods/goodsDetail.vue @@ -263,6 +263,7 @@ import pddEmpower from '../../components/pddempower.vue' import inviteCodeModel from '../../components/inviteCode.vue' import inviterModel from '../../components/inviterModel.vue' + export default { components: { empowerModel, @@ -310,6 +311,10 @@ { console.log("鍒濆鍖�") getApp().getAppInfo(); + } + if(!getApp().globalData.hasbcinit) + { + getApp().bcInit(); } }, onLoad(options) { @@ -559,10 +564,12 @@ goodsId: this.optionsInfo.goodsId, type: 0 }).then(e => { + console.log(e) if (e.code != 0) return that.$alert(e.msg) var res = e.data.info; var tburl = res.shortUrl // #ifdef APP-PLUS + if (plus.runtime.isApplicationExist({ pname: 'com.taobao.taobao', action: 'taobao://' diff --git a/uniapp/pages/mine/mine.vue b/uniapp/pages/mine/mine.vue index 1d99ce3..6256853 100644 --- a/uniapp/pages/mine/mine.vue +++ b/uniapp/pages/mine/mine.vue @@ -274,7 +274,6 @@ }, onPullDownRefresh() { - this.getuserInfo(); this.centerInfo(); this.getmoneyInfo(); @@ -287,7 +286,7 @@ url:"/pages/login/wxlogin" }) }else{ - getApp().watch(this.getInit,'ifwt') + //getApp().watch(this.ifwtChange,'ifwt') this.centerInfo() this.getbanner() } @@ -297,7 +296,6 @@ this.getInit(); this.getmoneyInfo() this.getuserInfo() - } }, methods: { @@ -306,12 +304,17 @@ if(!getApp().globalData.hasinit) { getApp().getAppInfo(); + setTimeout(()=>{ + this.getInit(); + },2000) } - // #ifdef APP-PLUS - this.appInfo = uni.getStorageSync('appInfo'); - this.showtar = getApp().globalData.ifwt == 1 ? false : true; - this.platform = plus.os.name - // #endif + + // #ifdef APP-PLUS + console.log(getApp().globalData.ifwt) + this.appInfo = uni.getStorageSync('appInfo'); + this.showtar = getApp().globalData.ifwt == 1 ? false : true; + this.platform = plus.os.name + // #endif }, getmoneyInfo() { var that = this; -- Gitblit v1.9.3