Browse Source

[首页][首页我的券包和我的卡包增加小红点]

tags/富茂链客4.1.0
meo 6 years ago
parent
commit
739faa392b
3 changed files with 50 additions and 8 deletions
  1. +29
    -1
      pages/main/index.js
  2. +8
    -6
      pages/main/index.wxml
  3. +13
    -1
      pages/main/index.wxss

+ 29
- 1
pages/main/index.js View File

@@ -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) {


+ 8
- 6
pages/main/index.wxml View File

@@ -22,18 +22,20 @@
<image src='{{icon0005}}'></image>
<text>品牌门店</text>
</view>
<view bindtap='mycard'>
<view bindtap='qrcode'>
<image src='{{icon0008}}'></image>
<text>会员权益</text>
</view>
<view bindtap='mycard'>
<image src='{{icon0006}}'></image>
<i class="red" style="display:{{display1}}"></i>
<text>我的卡包</text>
</view>
<view bindtap='mycoupon'>
<view bindtap='mycoupon'>
<image src='{{icon0007}}'></image>
<i class="red" style="display:{{display}}"></i>
<text>我的券包</text>
</view>
<view bindtap='qrcode'>
<image src='{{icon0008}}'></image>
<text>会员权益</text>
</view>
</view>
<!-- 小游戏暂时注释 -->
<view class='game' bindtap="gotogame" wx-if="{{showIf}}">


+ 13
- 1
pages/main/index.wxss View File

@@ -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;


Loading…
Cancel
Save