Authored by yyq

倒计时

@@ -47,11 +47,19 @@ function setPageTime() { @@ -47,11 +47,19 @@ function setPageTime() {
47 var i, text, showTime; 47 var i, text, showTime;
48 48
49 for (i = 0; i < limitTime.length; i++) { 49 for (i = 0; i < limitTime.length; i++) {
  50 + if (limitTime[i].time < 0) {
  51 + return;
  52 + }
  53 +
50 limitTime[i].time -= 1000; 54 limitTime[i].time -= 1000;
51 showTime = convertTime(limitTime[i].time); 55 showTime = convertTime(limitTime[i].time);
52 - text = showTime;  
53 - if (limitTime[i].pre) {  
54 - text = limitTime[i].pre + ' ' + text; 56 + if (showTime) {
  57 + text = showTime;
  58 + if (limitTime[i].pre) {
  59 + text = limitTime[i].pre + ' ' + text;
  60 + }
  61 + } else {
  62 + text = '活动已结束';
55 } 63 }
56 limitTime[i].dom.text(text); 64 limitTime[i].dom.text(text);
57 } 65 }