zhaojs
2023-06-30 ba3d748f9eb65a66fca9bd74fc7796b90a0a70ae
uniapp/App.vue
@@ -91,6 +91,7 @@
         uni.getSystemInfo({
            success: e => {
               // #ifdef APP-PLUS
               console.log(e)
               if (e.platform == 'android') {
                  this.globalData.platform = 'android'
                  this.globalData.systemLevel = e.system
@@ -138,6 +139,7 @@
         ifwt: 0,
         hasinit:false,
         hasbcinit:false,
         isLaunch:false
         
      },
      onShow: function() {
@@ -150,12 +152,14 @@
                     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')
@@ -187,6 +191,7 @@
            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就是初始化成功
@@ -196,12 +201,19 @@
                  }
               });
            }
            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)
               that.globalData.hasinit=true;
               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)
@@ -220,7 +232,6 @@
                        that.globalData.ifwt = 0
                     }
                  }
                  console.log(that.globalData.ifwt);
               } else {
                  if (plus.runtime.isApplicationExist({pname:'com.tencent.mm',
                        action: 'weixin://'
@@ -233,8 +244,7 @@
                  }
               }
               // #endif
            }).catch(function(err) {})
            }).catch(function(err) {that.globalData.hasinit=false;})
            
         },