瀏覽代碼

[tabbar][修改]:[tabbar小红点显示与隐藏]

tags/江西版6.1.0
meo 6 年之前
父節點
當前提交
9911656a9c
共有 4 個檔案被更改,包括 28 行新增54 行删除
  1. +1
    -1
      pages/cardorder/index/index.js
  2. +15
    -16
      pages/coupon/detail/index.js
  3. +5
    -4
      pages/main/index.js
  4. +7
    -33
      pages/user/index.js

+ 1
- 1
pages/cardorder/index/index.js 查看文件

@@ -51,7 +51,7 @@ Page({
data: "couponNum3", data: "couponNum3",
}) })
wx.hideTabBarRedDot({ wx.hideTabBarRedDot({
index: 2
index: 3
}) })
}, },
userule: function() { userule: function() {


+ 15
- 16
pages/coupon/detail/index.js 查看文件

@@ -74,11 +74,11 @@ Page({
min02: "00", min02: "00",
sec02: "00", sec02: "00",
countdown: "", countdown: "",
showbutton1:false
showbutton1: false
}, },
/** /**
* 跳转到门店列表的详情页面
*/
* 跳转到门店列表的详情页面
*/
gotoDetail(e) { gotoDetail(e) {
wx.navigateTo({ wx.navigateTo({
url: `/pages/index/detail/index?id=${e.currentTarget.dataset.id}` url: `/pages/index/detail/index?id=${e.currentTarget.dataset.id}`
@@ -332,7 +332,7 @@ Page({
}) })
//如果倒计时结束,需要重新查询一下券的状态 //如果倒计时结束,需要重新查询一下券的状态
// 给getDetail一个标识 // 给getDetail一个标识
that.getDetail(that.data.couponChannelId,'endclock');
that.getDetail(that.data.couponChannelId, 'endclock');
} }
total_micro_second -= 1000; total_micro_second -= 1000;
}, },
@@ -373,9 +373,9 @@ Page({
title: "加载中..." title: "加载中..."
}); });
that.setData({ that.setData({
onshow:false
onshow: false
}) })
that.getDetail(options.couponChannelId,'notendclock');
that.getDetail(options.couponChannelId, 'notendclock');
/** /**
* 转赠判断 * 转赠判断
*/ */
@@ -396,7 +396,7 @@ Page({
}) })
} }
}, },
getDetail: function (couponChannelId, flag) {
getDetail: function(couponChannelId, flag) {
let that = this; let that = this;
var parmer = { var parmer = {
url: config.api.couponDetail, url: config.api.couponDetail,
@@ -433,9 +433,9 @@ Page({
// flag == endclock 说明倒计时已经结束 // flag == endclock 说明倒计时已经结束
if (res.data.activityStatus == 0 && flag != 'endclock') { if (res.data.activityStatus == 0 && flag != 'endclock') {
that.countdown(res.data.beginTime); that.countdown(res.data.beginTime);
} else if (res.data.activityStatus != 0 && flag != 'endclock'){
} else if (res.data.activityStatus != 0 && flag != 'endclock') {
that.countdown(res.data.endTime); that.countdown(res.data.endTime);
}else{
} else {
clearInterval(that.data.setInterval) clearInterval(that.data.setInterval)
} }
if (res.data.activityStatus == 0) { if (res.data.activityStatus == 0) {
@@ -762,7 +762,7 @@ Page({
key: 'couponNum2', key: 'couponNum2',
data: "couponNum2" data: "couponNum2"
}) })
} else if (that.data.data.type != 5) {
} else if (that.data.data.type != 5 && that.data.cardType != 100) {
wx.setStorage({ wx.setStorage({
key: 'couponNum', key: 'couponNum',
data: "couponNum" data: "couponNum"
@@ -793,7 +793,6 @@ Page({
}); });
}) })
} else { } else {
console.log(that.data.type)
// 免费券 // 免费券
that.payOrderUpdate(orderId, "0", 1, '', 'free'); that.payOrderUpdate(orderId, "0", 1, '', 'free');
if (that.data.cardType == 100) { if (that.data.cardType == 100) {
@@ -801,7 +800,7 @@ Page({
key: 'couponNum2', key: 'couponNum2',
data: "couponNum2" data: "couponNum2"
}) })
} else if (that.data.data.type != "5") {
} else if (that.data.data.type != "5" && that.data.cardType != 100) {
wx.setStorage({ wx.setStorage({
key: 'couponNum', key: 'couponNum',
data: "couponNum" data: "couponNum"
@@ -821,17 +820,17 @@ Page({
onShow() { onShow() {
this.setData({ this.setData({
showbutton: false, showbutton: false,
showbutton1:false
showbutton1: false
}) })
if(this.data.end_time){
if (this.data.end_time) {
this.countdown(this.data.end_time) this.countdown(this.data.end_time)
} }
}, },
onUnload:function(){
onUnload: function() {
let that = this; let that = this;
clearInterval(that.data.setInterval) clearInterval(that.data.setInterval)
}, },
onHide: function () {
onHide: function() {
let that = this; let that = this;
clearInterval(that.data.setInterval) clearInterval(that.data.setInterval)
}, },


+ 5
- 4
pages/main/index.js 查看文件

@@ -225,29 +225,30 @@ Page({
let num1 = wx.getStorageSync('couponNum2'); let num1 = wx.getStorageSync('couponNum2');
if (num == 'couponNum') { if (num == 'couponNum') {
wx.showTabBarRedDot({ wx.showTabBarRedDot({
index: 2
index: 3
}) })
that.setData({ that.setData({
display: "block" display: "block"
}) })
}else{ }else{
wx.hideTabBarRedDot({ wx.hideTabBarRedDot({
index: 2
index: 3
}) })
that.setData({ that.setData({
display: "none" display: "none"
}) })
} }
if (num1 == 'couponNum2') { if (num1 == 'couponNum2') {
wx.showTabBarRedDot({ wx.showTabBarRedDot({
index: 2
index: 3
}) })
that.setData({ that.setData({
display1: "block" display1: "block"
}) })
} else { } else {
wx.hideTabBarRedDot({ wx.hideTabBarRedDot({
index: 2
index: 3
}) })
that.setData({ that.setData({
display1: "none" display1: "none"


+ 7
- 33
pages/user/index.js 查看文件

@@ -36,7 +36,7 @@ Page({
imagePath: '', imagePath: '',
appVersion:"", appVersion:"",
showmemberqrcode: false, showmemberqrcode: false,
placeholder: ''//默认二维码生成文本
placeholder: ''
}, },
/** /**
* 跳转到成长值的页面 * 跳转到成长值的页面
@@ -46,36 +46,6 @@ Page({
url: '/pages/czdetail/czdetail', url: '/pages/czdetail/czdetail',
}) })
}, },
// getrun:function(){
// let that = this;
// wx.getWeRunData({
// success: function (res) {
// Http.post({
// url: config.api.getWeRunData,
// data: {
// encryptedData: res.encryptedData,
// iv: res.iv
// }
// }).then(res => {
// that.setData({
// step: res.data.stepInfoList[30].step
// })
// })
// }
// })
// },
/**
*
*/
// getxinghao:function(){
// wx.getSystemInfo({
// success:function(res){
// wx.showModal({
// content: res.brand,
// })
// }
// })
// },
navigateTo() { navigateTo() {
wx.navigateTo({ wx.navigateTo({
url: `/pages/main/index` url: `/pages/main/index`
@@ -105,10 +75,14 @@ Page({
that.setData({ that.setData({
appVersion: extConfig.appVersion appVersion: extConfig.appVersion
}) })
let num = wx.getStorageSync('couponNum');
/**
* couponNum
* couponNum2
*/
let num = wx.getStorageSync('couponNum');
let num1 = wx.getStorageSync('couponNum2'); let num1 = wx.getStorageSync('couponNum2');
wx.hideTabBarRedDot({ wx.hideTabBarRedDot({
index: 2
index: 3
}); });
wx.hideTabBarRedDot({ wx.hideTabBarRedDot({
index: 3 index: 3


Loading…
取消
儲存