diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js
index 61a3c9c..68aaf61 100644
--- a/pages/coupon/detail/index.js
+++ b/pages/coupon/detail/index.js
@@ -56,7 +56,12 @@ Page({
isSamePeople:true,
statusText:'',
isReceived:false,
- receivedDisabled:false
+ receivedDisabled:false,
+ clock02: "00",
+ day02: "00",
+ hour02: "00",
+ min02: "00",
+ sec02: "00",
},
phone: function (e) {
let that = this;
@@ -311,7 +316,37 @@ Page({
that.countdown(end_time);
}, 1000)
},
-
+ countdown02(end_time) {
+ let that = this;
+ var EndTime = end_time;
+ var NowTime = new Date().getTime();
+ var total_micro_second = EndTime - NowTime || [];
+ // 渲染倒计时时钟
+ let obj = that.dateformat(total_micro_second);
+ console.log(obj,111)
+ if (total_micro_second > 0) {
+ that.setData({
+ clock02: obj,
+ day02: obj.a1,
+ hour02: obj.b1,
+ min02: obj.c1,
+ sec02: obj.d1,
+ })
+ } else {
+ that.setData({
+ clock02: "00",
+ day02: "00",
+ hour02: "00",
+ min02: "00",
+ sec02: "00",
+ showbutton1: false
+ })
+ }
+ setTimeout(function () {
+ total_micro_second -= 1000;
+ that.countdown02(end_time);
+ }, 1000)
+ },
// 时间格式化输出,如11:03 25:19 每1s都会调用一次
dateformat(micro_second) {
// 总秒数
@@ -381,6 +416,14 @@ Page({
title: "卡详情"
})
}
+ var EndTime = res.data.validStartDate;
+ var NowTime = new Date().getTime();
+ if (EndTime - NowTime>0){
+ that.setData({
+ showbutton1:true
+ })
+ }
+ that.countdown02(res.data.validStartDate)
if (res.data.endTime) {
that.countdown(res.data.endTime);
//当前时间与优惠券下架时间做计算
diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml
index 69bfcfe..0a69bc5 100644
--- a/pages/coupon/detail/index.wxml
+++ b/pages/coupon/detail/index.wxml
@@ -43,6 +43,7 @@
剩余{{data.remainInventory}}件
+ 砍价活动将于{{day02+'天'+hour02+':'+min02+':'+sec02}}后准时开始
有效期:自领取之日起
{{validDays}}天内有效
有效期: