From 9911656a9ca460ad0a3ce5d7e816267fb7f0b521 Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Mon, 6 May 2019 13:33:16 +0800 Subject: [PATCH] =?UTF-8?q?[tabbar][=E4=BF=AE=E6=94=B9]:[tabbar=E5=B0=8F?= =?UTF-8?q?=E7=BA=A2=E7=82=B9=E6=98=BE=E7=A4=BA=E4=B8=8E=E9=9A=90=E8=97=8F?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/cardorder/index/index.js | 2 +- pages/coupon/detail/index.js | 31 +++++++++++++------------- pages/main/index.js | 9 ++++---- pages/user/index.js | 40 ++++++---------------------------- 4 files changed, 28 insertions(+), 54 deletions(-) diff --git a/pages/cardorder/index/index.js b/pages/cardorder/index/index.js index fb30253..db40de2 100644 --- a/pages/cardorder/index/index.js +++ b/pages/cardorder/index/index.js @@ -51,7 +51,7 @@ Page({ data: "couponNum3", }) wx.hideTabBarRedDot({ - index: 2 + index: 3 }) }, userule: function() { diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 06e401a..9510b32 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -74,11 +74,11 @@ Page({ min02: "00", sec02: "00", countdown: "", - showbutton1:false + showbutton1: false }, /** - * 跳转到门店列表的详情页面 - */ + * 跳转到门店列表的详情页面 + */ gotoDetail(e) { wx.navigateTo({ url: `/pages/index/detail/index?id=${e.currentTarget.dataset.id}` @@ -332,7 +332,7 @@ Page({ }) //如果倒计时结束,需要重新查询一下券的状态 // 给getDetail一个标识 - that.getDetail(that.data.couponChannelId,'endclock'); + that.getDetail(that.data.couponChannelId, 'endclock'); } total_micro_second -= 1000; }, @@ -373,9 +373,9 @@ Page({ title: "加载中..." }); 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; var parmer = { url: config.api.couponDetail, @@ -433,9 +433,9 @@ Page({ // flag == endclock 说明倒计时已经结束 if (res.data.activityStatus == 0 && flag != 'endclock') { 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); - }else{ + } else { clearInterval(that.data.setInterval) } if (res.data.activityStatus == 0) { @@ -762,7 +762,7 @@ Page({ key: 'couponNum2', data: "couponNum2" }) - } else if (that.data.data.type != 5) { + } else if (that.data.data.type != 5 && that.data.cardType != 100) { wx.setStorage({ key: 'couponNum', data: "couponNum" @@ -793,7 +793,6 @@ Page({ }); }) } else { - console.log(that.data.type) // 免费券 that.payOrderUpdate(orderId, "0", 1, '', 'free'); if (that.data.cardType == 100) { @@ -801,7 +800,7 @@ Page({ key: 'couponNum2', data: "couponNum2" }) - } else if (that.data.data.type != "5") { + } else if (that.data.data.type != "5" && that.data.cardType != 100) { wx.setStorage({ key: 'couponNum', data: "couponNum" @@ -821,17 +820,17 @@ Page({ onShow() { this.setData({ showbutton: false, - showbutton1:false + showbutton1: false }) - if(this.data.end_time){ + if (this.data.end_time) { this.countdown(this.data.end_time) } }, - onUnload:function(){ + onUnload: function() { let that = this; clearInterval(that.data.setInterval) }, - onHide: function () { + onHide: function() { let that = this; clearInterval(that.data.setInterval) }, diff --git a/pages/main/index.js b/pages/main/index.js index 542d986..b2d928c 100644 --- a/pages/main/index.js +++ b/pages/main/index.js @@ -225,29 +225,30 @@ Page({ let num1 = wx.getStorageSync('couponNum2'); if (num == 'couponNum') { wx.showTabBarRedDot({ - index: 2 + index: 3 }) that.setData({ display: "block" }) }else{ wx.hideTabBarRedDot({ - index: 2 + index: 3 }) that.setData({ display: "none" }) } + if (num1 == 'couponNum2') { wx.showTabBarRedDot({ - index: 2 + index: 3 }) that.setData({ display1: "block" }) } else { wx.hideTabBarRedDot({ - index: 2 + index: 3 }) that.setData({ display1: "none" diff --git a/pages/user/index.js b/pages/user/index.js index c4e5790..be4ae2a 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -36,7 +36,7 @@ Page({ imagePath: '', appVersion:"", showmemberqrcode: false, - placeholder: ''//默认二维码生成文本 + placeholder: '' }, /** * 跳转到成长值的页面 @@ -46,36 +46,6 @@ Page({ 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() { wx.navigateTo({ url: `/pages/main/index` @@ -105,10 +75,14 @@ Page({ that.setData({ appVersion: extConfig.appVersion }) - let num = wx.getStorageSync('couponNum'); + /** + * couponNum + * couponNum2 + */ + let num = wx.getStorageSync('couponNum'); let num1 = wx.getStorageSync('couponNum2'); wx.hideTabBarRedDot({ - index: 2 + index: 3 }); wx.hideTabBarRedDot({ index: 3