zhaojs
2023-06-10 69ea24e8fdfb41fc48c3fdb8c444645c13b1bbc4
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)
@@ -137,6 +138,7 @@
         appinfo: {},
         ifwt: 0,
         hasinit:false,
         hasbcinit:false,
         
      },
      onShow: function() {
@@ -154,7 +156,10 @@
                  {
                     that.getAppInfo();
                  }
                  if(!that.globalData.hasbcinit)
                  {
                     that.bcInit();
                  }
                  /* let appInfo = utils.getCacheSync('appInfo')
                  if(appInfo == "" || appInfo == undefined){
                     console.log("获取方法")
@@ -178,6 +183,24 @@
      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;
                  }
               });
            }
         },
         getAppInfo: function() {
            var that = this;
            this.$u.api.comminInt({}).then(e => {
@@ -217,6 +240,7 @@
            }).catch(function(err) {})
            
         },
          watch:function(method,istr){
                         var obj=this.globalData
                         console.log(obj)