Authored by 郭成尧

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuy-node into release/4.6

... ... @@ -5,8 +5,8 @@
{{#if discount}}
<span class="discount">{{discount}}</span>
{{/if}}
{{#if up}}
{{#if discountText}}
{{discountText}}
{{/if}}
<div class="time pull-right">
<span class="iconfont">&#xe60a;</span>
... ...
... ... @@ -78,8 +78,8 @@ function convertTime(time) {
s = Math.floor(time / aSecond % 60);
showTime += d > 0 ? d + '天' : '';
showTime += h > 0 ? h + '小时' : '';
showTime += m > 0 ? m + '分钟' : '';
showTime += h > 0 ? h + '时' : '';
showTime += m > 0 ? m + '分' : '';
showTime += s > 0 ? s + '秒' : '';
}
... ... @@ -87,11 +87,23 @@ function convertTime(time) {
}
function setPageTime() {
var i, showTime;
var i, text, showTime;
for (i = 0; i < limitTime.length; i++) {
if (limitTime[i].time < 0) {
return;
}
limitTime[i].time -= 1000;
showTime = convertTime(limitTime[i].time);
if (showTime) {
text = showTime;
if (limitTime[i].pre) {
text = limitTime[i].pre + ' ' + text;
}
} else {
text = '活动已结束';
}
$('.time-calculate').removeClass('hidden');
$('.time-calculate').text(showTime);
}
... ... @@ -100,7 +112,7 @@ function setPageTime() {
if (('.sale-discount-page').length > 0) {
$('.time-calculate').each(function() {
var data = $(this).attr('data');
var data = $(this).attr('data') * 1000;
if (data) {
limitTime.push({
... ...