zhaojs
2023-07-06 cf1973556ff35a0798436aa63d90f2cc8a2f53ba
uniapp/App.vue
@@ -13,7 +13,8 @@
      onLaunch: function() {
         // #ifdef APP-PLUS
         //推送开始
         /* var info = plus.push.getClientInfo()
         var info = plus.push.getClientInfo()
         console.log(info);
         // 获取当前设备的客户端id,传给后台,实现指定用户
         info && uni.setStorageSync('clientInfo', info)
         // 使用5+App的方式进行监听消息推送
@@ -79,7 +80,7 @@
         //消息推送结束
         plus.push.addEventListener('click', res => {
            console.log(res);
         }); */
         });
         APPUpdate();
         // #endif
         this.getAppInfo();
@@ -139,6 +140,7 @@
         ifwt: 0,
         hasinit:false,
         hasbcinit:false,
         isLaunch:false
         
      },
      onShow: function() {
@@ -158,6 +160,7 @@
                  }
                  if(!that.globalData.hasbcinit)
                  {
                     console.log("初始化百川插件")
                     that.bcInit();
                  }
                  /* let appInfo = utils.getCacheSync('appInfo')
@@ -173,7 +176,6 @@
            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()
         }
@@ -200,13 +202,19 @@
                  }
               });
            }
            else{
               that.globalData.hasbcinit=true;
            }
         },
         getAppInfo: function() {
            var that = this;
            that.globalData.hasinit=true;
            this.$u.api.comminInt({}).then(e => {
               console.log(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)
@@ -237,7 +245,7 @@
                  }
               }
               // #endif
            }).catch(function(err) {})
            }).catch(function(err) {that.globalData.hasinit=false;})
            
         },