|
@@ -78,8 +78,8 @@ function convertTime(time) { |
|
@@ -78,8 +78,8 @@ function convertTime(time) { |
78
|
s = Math.floor(time / aSecond % 60);
|
78
|
s = Math.floor(time / aSecond % 60);
|
79
|
|
79
|
|
80
|
showTime += d > 0 ? d + '天' : '';
|
80
|
showTime += d > 0 ? d + '天' : '';
|
81
|
- showTime += h > 0 ? h + '小时' : '';
|
|
|
82
|
- showTime += m > 0 ? m + '分钟' : '';
|
81
|
+ showTime += h > 0 ? h + '时' : '';
|
|
|
82
|
+ showTime += m > 0 ? m + '分' : '';
|
83
|
showTime += s > 0 ? s + '秒' : '';
|
83
|
showTime += s > 0 ? s + '秒' : '';
|
84
|
}
|
84
|
}
|
85
|
|
85
|
|
|
@@ -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
|
}
|
|
@@ -100,7 +112,7 @@ function setPageTime() { |
|
@@ -100,7 +112,7 @@ function setPageTime() { |
100
|
if (('.sale-discount-page').length > 0) {
|
112
|
if (('.sale-discount-page').length > 0) {
|
101
|
|
113
|
|
102
|
$('.time-calculate').each(function() {
|
114
|
$('.time-calculate').each(function() {
|
103
|
- var data = $(this).attr('data');
|
115
|
+ var data = $(this).attr('data') * 1000;
|
104
|
|
116
|
|
105
|
if (data) {
|
117
|
if (data) {
|
106
|
limitTime.push({
|
118
|
limitTime.push({
|