diff --git a/pages/main/index.js b/pages/main/index.js index 8a76e0d..461209d 100644 --- a/pages/main/index.js +++ b/pages/main/index.js @@ -29,6 +29,8 @@ Page({ staticGamedata: {}, showIf: false, showPages: false, + display: 'none', + display1:'none', page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 }, // 我的卡包 @@ -198,11 +200,37 @@ Page({ havePlayEd: app.globalData.havePlayEd ? app.globalData.havePlayEd : false }) let num = wx.getStorageSync('couponNum'); + let num1 = wx.getStorageSync('couponNum2'); if (num == 'couponNum') { wx.showTabBarRedDot({ index: 2 }) - }; + this.setData({ + display: "block" + }) + }else{ + wx.hideTabBarRedDot({ + index: 2 + }) + this.setData({ + display: "none" + }) + } + if (num1 == 'couponNum2') { + wx.showTabBarRedDot({ + index: 2 + }) + this.setData({ + display1: "block" + }) + } else { + wx.hideTabBarRedDot({ + index: 2 + }) + this.setData({ + display1: "none" + }) + } }, // 会员码获取 getmemberId: function(token) { diff --git a/pages/main/index.wxml b/pages/main/index.wxml index 4145a0b..1b80b0e 100644 --- a/pages/main/index.wxml +++ b/pages/main/index.wxml @@ -22,18 +22,20 @@ 品牌门店 - + + + 会员权益 + + + 我的卡包 - + + 我的券包 - - - 会员权益 - diff --git a/pages/main/index.wxss b/pages/main/index.wxss index 9444b6c..e1fea21 100644 --- a/pages/main/index.wxss +++ b/pages/main/index.wxss @@ -12,7 +12,18 @@ line-height: 88rpx; overflow: hidden; } - +.red{ + position:absolute; + width:13rpx; + height:13rpx; + border-radius:50%; + background:red; + right:-50rpx; + top:19rpx; + left:0; + margin:auto; + display: none; +} page { width: 100%; height: auto !important; @@ -43,6 +54,7 @@ page { .section >view{ width: 25%; display: inline-block; + position: relative; } .section >view image { display: block;