From fa8eff007f54a2b99f0dd1ad3160d1a1ca9e28b0 Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Wed, 17 Oct 2018 19:38:06 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=A7=A3=E5=86=B3=E9=A1=B5=E9=9D=A2=E9=97=AA?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=86=E5=80=92=E8=AE=A1=E6=97=B6=E9=97=AA?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/coupon/detail/index.js | 31 ++++++++++++++++++------------- pages/coupon/detail/index.wxml | 10 ++++++---- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 371ac17..f38df9f 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -10,7 +10,6 @@ Page({ couponChannelId: null, couponId: null, orderId: "", - day: "", hour: "", minute: "", tempFilePaths: '', @@ -20,7 +19,7 @@ Page({ id: '', result: [], end_time: '', - clock: '' + clock: "已经截止", }, phone: function () { @@ -40,18 +39,23 @@ Page({ var total_micro_second = EndTime - NowTime || []; // 渲染倒计时时钟 let obj = that.dateformat(total_micro_second); - that.setData({ - clock: obj, - day: obj.a1, - hour: obj.b1, - min: obj.c1, - sec: obj.d1, - }); - if (total_micro_second <= 0) { + + if (total_micro_second>0){ that.setData({ - clock: "已经截止" - }); - //return; + clock: obj, + day: obj.a1, + hour: obj.b1, + min: obj.c1, + sec: obj.d1, + }) + }else{ + that.setData({ + clock: "00", + day: "00", + hour: "00", + min: "00", + sec: "00", + }) } setTimeout(function () { total_micro_second -= 1000; @@ -400,6 +404,7 @@ Page({ console.log(options) var eData = options.target.dataset.id; var couponId = options.target.dataset.couponid; + // shareObj.path = `/pages/index/index?couponChannelId=${eData}&couponId=${couponId}`; shareObj.path = `/pages/index/index?couponChannelId=${eData}&couponId=${couponId}`; } // 返回shareObj diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index 315221e..396c772 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -15,10 +15,12 @@ 距结束还剩 : - 00天 - 00: - 00: - 00 + + {{day}}天 + {{hour}}: + {{min}}: + {{sec}} + {{day}}{{hour}}: