Commit 8a5e46ea96e84eb04a12094bd7eadecfb6c7ca08
1 parent
00eb5258
首页和个人中心onshow时设置tabbar购物车数量
Showing
2 changed files
with
7 additions
and
0 deletions
pages/index/index/index.js
pages/user/index/index.js
... | ... | @@ -58,6 +58,7 @@ Page({ |
58 | 58 | * 生命周期函数--监听页面加载 |
59 | 59 | */ |
60 | 60 | onLoad: function(options) { |
61 | + | |
61 | 62 | var th=this; |
62 | 63 | //-- 读取会员中心按钮列表 -- |
63 | 64 | getApp().request.get("/api/weshop/userTool/page?pageSize=100", { |
... | ... | @@ -98,6 +99,9 @@ Page({ |
98 | 99 | * 生命周期函数--监听页面显示 |
99 | 100 | */ |
100 | 101 | onShow: function() { |
102 | + this.getTabBar().setData({ | |
103 | + cartGoodsNum: getApp().globalData.cartGoodsNum, | |
104 | + }) | |
101 | 105 | //看一下小程序是不是过期了 |
102 | 106 | getApp().getConfig2(function(config2){ |
103 | 107 | if(config2 && config2.is_overdue==1){ | ... | ... |