zhaojs
2023-06-06 55175823d6730a2f7a552524d98b6b3eb080ec8d
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)