zhaojs
2023-06-09 bef3a652349b7b79c914afcc013d7229706a2b3b
uniapp/pages/mine/mine.vue
@@ -129,7 +129,7 @@
            <swiper class="banerContent" :autoplay="true" :interval="3000" :duration="1000" circular>
               <swiper-item v-for="(items,index) in bannerList" :key="index" @tap="goUrl(items)">
                  <view class="swiper-items defIcon">
                     <image :src="items.pic" mode="aspectFit"></image>
                     <image :src="items.image" mode="aspectFit"></image>
                  </view>
               </swiper-item>
            </swiper>
@@ -262,7 +262,6 @@
            platform: '',
            showtar: false,
            bbcList:'',
            sct: 0,
            inviteCodeShow:false,
            inviterShow:false
@@ -278,6 +277,7 @@
         this.getuserInfo();
         this.centerInfo();
         this.getmoneyInfo();
         this.getInit();
         uni.stopPullDownRefresh();
      },      
      onLoad() {
@@ -286,24 +286,36 @@
               url:"/pages/login/wxlogin"
            })
         }else{
            // #ifdef APP-PLUS
            this.appInfo = uni.getStorageSync('appInfo');
            console.log(this.appInfo.iosExamine);
            this.showtar = getApp().globalData.ifwt == 1 ? false : true;
            this.platform = plus.os.name
            // #endif
            //getApp().watch(this.ifwtChange,'ifwt')
            this.centerInfo()
            this.getbanner()
         }
      },
      onShow() {
         if(this.hasLogin){
            this.getInit();
            this.getmoneyInfo()
            this.getuserInfo()
         }
      },
      methods: {
         getInit()
         {
            if(!getApp().globalData.hasinit)
            {
               getApp().getAppInfo();
               setTimeout(()=>{
                  this.getInit();
               },2000)
            }
             // #ifdef APP-PLUS
            console.log(getApp().globalData.ifwt)
            this.appInfo = uni.getStorageSync('appInfo');
            this.showtar = getApp().globalData.ifwt == 1 ? false : true;
            this.platform = plus.os.name
            // #endif
         },
         getmoneyInfo() {
            var that = this;
            this.$u.api.getEstimateAmount({}).then(e => {
@@ -322,12 +334,12 @@
               console.log(err)
            })
         },
         getbanner() {
            // banner数据
            var that = this;
            this.$u.api.getBanner({type:'2'}).then(e => {
               if(e.code == 1)return that.$alert(e.msg);
               console.log(e.data.info)
               that.bannerList = e.data.info;
            }).catch(function (err) {
            })
@@ -381,10 +393,41 @@
         },
         goUrl(info) {
            util.goUrl(info,this)
            console.log(info)
            if(info.url_type == 15)
            {//微信客服
               let wechat = null
               let parameter = info.parameter_json;
               plus.share.getServices(res => {
                  wechat = res.find(i => i.id === 'weixin')
                  if (wechat) {
                     wechat.openCustomerServiceChat({
                        corpid: parameter.cmark, //企业ID
                        url: parameter.url, //客服地址
                     }, src => {
                        console.log("success:", JSON.stringify(src))
                     }, err => {
                        console.log("error:", JSON.stringify(err))
                     })
                  } else {
                     uni.showToast({
                        title: '当前环境不支持微信操作',
                        icon: "error"
                     });
                  }
               }, function() {
                  uni.showToast({
                     title: "获取服务失败,不支持该操作。" + JSON.stringify(e),
                     icon: 'none'
                  })
                  });
            }
            else
            {
               util.goUrl(info,this)
            }
         },
         cpr_version(a, b) {
            console.log(a);
            var _a = this.toNum(a),