| | |
| | | uni.getSystemInfo({ |
| | | success: e => { |
| | | // #ifdef APP-PLUS |
| | | console.log(e) |
| | | if (e.platform == 'android') { |
| | | this.globalData.platform = 'android' |
| | | this.globalData.systemLevel = e.system |
| | |
| | | ifwt: 0, |
| | | hasinit:false, |
| | | hasbcinit:false, |
| | | isLaunch:false |
| | | |
| | | }, |
| | | onShow: function() { |
| | |
| | | content: '检测到网络权限可能设置为关闭,您可以在“设置”中检查无线数据及蜂窝移动网络' |
| | | }) |
| | | }else{ |
| | | 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 (uni.getSystemInfoSync().platform == 'ios') |
| | | { |
| | | const plug = uni.requireNativePlugin('xiguazhu-baichuan'); |
| | | console.log(plug) |
| | | plug.init({}, result => { |
| | | //console.log('1111111111111111111'); |
| | | console.log(result); // code等于0就是初始化成功 |
| | |
| | | } |
| | | }); |
| | | } |
| | | else{ |
| | | that.globalData.hasbcinit=true; |
| | | } |
| | | }, |
| | | getAppInfo: function() { |
| | | var that = this; |
| | | this.$u.api.comminInt({}).then(e => { |
| | | if (e.code != 0) return that.$alert(e.msg) |
| | | that.globalData.hasinit=true; |
| | | this.$u.api.comminInt({}).then(e => { |
| | | 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) |
| | |
| | | that.globalData.ifwt = 0 |
| | | } |
| | | } |
| | | console.log(that.globalData.ifwt); |
| | | } else { |
| | | if (plus.runtime.isApplicationExist({pname:'com.tencent.mm', |
| | | action: 'weixin://' |
| | |
| | | } |
| | | } |
| | | // #endif |
| | | |
| | | }).catch(function(err) {}) |
| | | }).catch(function(err) {that.globalData.hasinit=false;}) |
| | | |
| | | }, |
| | | |