bayi 2 年 前
コミット
f671041071

+ 2 - 4
components/activityList/index.js

@@ -39,10 +39,8 @@ Component({
       this.setData({
         activityList
       })
-      // 下面这个处理限时活动的,第一版先不上
       activityList.forEach((item, index) => {
         if (item.bannerType == 4 && item.voucherType) {
-          // this.activityTimeOut(1677109150000, index)
           this.activityTimeOut(item.endTime, index)
         }
       })
@@ -60,10 +58,10 @@ Component({
     activityTimeOut(oTime, index) {
       let inputTime = new Date(oTime)
       let dsq = setInterval(() => {
-        // console.log(this.data.activityList[index]);
         var nowTime = new Date();
         //把剩余时间毫秒数转化为秒
         var times = (inputTime - nowTime) / 1000;
+        // console.log(times);
         if (times <= 0) {
           this.setData({
             [`activityList[${index}].hour`]: '00',
@@ -74,7 +72,7 @@ Component({
           return clearInterval(dsq)
         }
         //计算小时数 转化为整数
-        var h = parseInt(times / 60 / 60 % 24);
+        var h = parseInt(times / 60 / 60);
         //如果小时数小于 10,要变成 0 + 数字的形式 赋值给盒子
         let hour = h < 10 ? "0" + h : h;
         //计算分钟数 转化为整数

+ 1 - 1
components/activityList/index.wxml

@@ -83,7 +83,7 @@
           <view class="time" wx:if="{{!item.voucherType}}">
             {{filters.formatDate(item.startTime,2)}}—{{filters.formatDate(item.endTime,2)}}
           </view>
-          <view class="timeOut {{item.second=='00'?'closing':''}}" wx:if="{{item.voucherType}}">距活动结束:
+          <view class="timeOut {{item.finish?'closing':''}}" wx:if="{{item.voucherType}}">距活动结束:
             <view class="outNum">{{item.hour}}</view>
             <view class="outSplit">:</view>
             <view class="outNum">{{item.minute}}</view>

+ 1 - 2
components/voucher/index.js

@@ -41,7 +41,6 @@ Component({
         voucherType,
         preferential
       } = data
-      console.log(data);
       this.setData({
         state: true,
         type,
@@ -119,7 +118,7 @@ Component({
         package: res.package,
         signType,
         paySign,
-        success(res) {
+        success: (res) => {
           wx.showToast({
             title: "支付成功",
             duration: 2500

+ 1 - 1
components/voucher/index.wxml

@@ -23,7 +23,7 @@
           </view>
         </view>
       </view>
-      <view class="btn" catchtap="getVoucher">领取使用</view>
+      <view class="btn" catchtap="getVoucher">{{voucherType?'立即使用':'领取使用'}}</view>
       <view class="tips">领取后在24小时内使用,过期作废</view>
     </view>
     <image src="/static/lollipop.png" class="close" catchtap="close" />