Authored by 阿达

折扣专场问题

@@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
5 {{#if discount}} 5 {{#if discount}}
6 <span class="discount">{{discount}}</span> 6 <span class="discount">{{discount}}</span>
7 {{/if}} 7 {{/if}}
8 - {{#if up}}  
9 - 8 + {{#if discountText}}
  9 + {{discountText}}
10 {{/if}} 10 {{/if}}
11 <div class="time pull-right"> 11 <div class="time pull-right">
12 <span class="iconfont">&#xe60a;</span> 12 <span class="iconfont">&#xe60a;</span>
@@ -87,11 +87,23 @@ function convertTime(time) { @@ -87,11 +87,23 @@ function convertTime(time) {
87 } 87 }
88 88
89 function setPageTime() { 89 function setPageTime() {
90 - var i, showTime; 90 + var i, text, showTime;
91 91
92 for (i = 0; i < limitTime.length; i++) { 92 for (i = 0; i < limitTime.length; i++) {
  93 + if (limitTime[i].time < 0) {
  94 + return;
  95 + }
  96 +
93 limitTime[i].time -= 1000; 97 limitTime[i].time -= 1000;
94 showTime = convertTime(limitTime[i].time); 98 showTime = convertTime(limitTime[i].time);
  99 + if (showTime) {
  100 + text = showTime;
  101 + if (limitTime[i].pre) {
  102 + text = limitTime[i].pre + ' ' + text;
  103 + }
  104 + } else {
  105 + text = '活动已结束';
  106 + }
95 $('.time-calculate').removeClass('hidden'); 107 $('.time-calculate').removeClass('hidden');
96 $('.time-calculate').text(showTime); 108 $('.time-calculate').text(showTime);
97 } 109 }