diff --git a/app.js b/app.js index 35768ac..4437718 100644 --- a/app.js +++ b/app.js @@ -104,8 +104,7 @@ App({ cartGoodsNum:this.globalData.cartGoodsNum }) }, - - + globalData: { cartGoodsNum:0, //购物车总数量 isTabBar :false, @@ -132,7 +131,10 @@ App({ to_group:null, //参团传递的数据 wxapp_buy_obj:null, //微信小程序购买的Object pk_store:null, //选择的门店 - + first_leader:null, //分享会员ID + guide_id:null, //分享导购ID + + windowWidth:0, //整个窗体的宽度 }, auth: o, request: a, @@ -145,6 +147,7 @@ App({ var rpxR = 750 / clientWidth; var calc = wx.getSystemInfoSync().windowHeight * rpxR; this.globalData.heigth=calc; + this.globalData.windowWidth=clientWidth; var app=this; if(!app.globalData.userInfo){ @@ -380,7 +383,6 @@ App({ //同步化,在调用的时候要await async get_isbuy() { - var th=this; await api.check_isbuy({ store_id: t.stoid, type: 5 }).then(res=>{ var o=res; @@ -562,7 +564,14 @@ App({ } },1000); } - } + }, + + //清空登录时候缓存的值 + onHide:function () { + this.globalData.is_test=0; + this.globalData.guide_id=null; //导购清空 + this.globalData.first_leader=null; //分享的会员清空 + } });