| | |
| | | }); */ |
| | | APPUpdate(); |
| | | // #endif |
| | | this.getAppInfo() |
| | | this.getAppInfo(); |
| | | //this.that.bcInit(); |
| | | let userInfo = uni.getStorageSync('userInfo') |
| | | if (userInfo.id) { |
| | | this.login(userInfo) |
| | |
| | | userInfo: {}, |
| | | canlisten: true, |
| | | appinfo: {}, |
| | | ifwt: 0 |
| | | ifwt: 0, |
| | | hasinit:false, |
| | | hasbcinit:false, |
| | | isLaunch:false |
| | | |
| | | }, |
| | | onShow: function() { |
| | | var that = this; |
| | |
| | | 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(); |
| | | } */ |
| | | } |
| | | } |
| | | }) |
| | |
| | | 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() |
| | | } |
| | |
| | | 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; |
| | | // #ifdef APP-PLUS |
| | | if (plus.os.name == 'iOS') { |
| | | if (that.globalData.appinfo.iosExamine && plus.runtime.version == e.data.basic.IosExamineV) { |
| | | that.globalData.ifwt = 0 |
| | | } else { |
| | | if (plus.runtime.isApplicationExist({ |
| | | action: 'weixin://' |
| | | }) && plus.runtime.isApplicationExist({ |
| | | action: 'taobao://' |
| | | })) { |
| | | that.globalData.ifwt = 1 //是否安装微信和淘宝 1代表安装 |
| | | } else { |
| | | that.globalData.ifwt = 0 |
| | | } |
| | | } |
| | | } else { |
| | | if (plus.runtime.isApplicationExist({pname:'com.tencent.mm', |
| | | action: 'weixin://' |
| | | })) { |
| | | console.log("安卓端已安装微信") |
| | | that.globalData.ifwt = 1 //是否安装微信 1代表安装 |
| | | } else { |
| | | console.log("安卓端未安装微信") |
| | | that.globalData.ifwt = 0 |
| | | } |
| | | } |
| | | // #endif |
| | | |
| | | 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 { |
| | |
| | | console.log("安卓端未安装微信") |
| | | that.globalData.ifwt = 0 |
| | | } |
| | | } */ |
| | | } |
| | | // #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> |