首页商品计时信息不显示-代码显示语法错误,求高人解决

2016-07-07 15:11 来源:www.chinab4c.com 作者:ecshop专家



<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- {if $promotion_goods} -->
<script type="text/javascript">
var Tday = new Array();
var daysms = 24 * 60 * 60 * 1000
var hoursms = 60 * 60 * 1000
var Secondms = 60 * 1000
var microsecond = 1000
var DifferHour = -1
var DifferMinute = -1
var DifferSecond = -1
function clock(key)
{
var time = new Date()
var hour = time.getHours()
var minute = time.getMinutes()
var second = time.getSeconds()
var timevalue = ""+((hour > 12) ? hour-12:hour)
timevalue +=((minute < 10) ? ":0":":")+minute
timevalue +=((second < 10) ? ":0":":")+second
timevalue +=((hour >12 ) ? " PM":" AM")
var convertHour = DifferHour
var convertMinute = DifferMinute
var convertSecond = DifferSecond
var Diffms = Tday[key].getTime() - time.getTime()
DifferHour = Math.floor(Diffms / daysms)
Diffms -= DifferHour * daysms
DifferMinute = Math.floor(Diffms / hoursms)
Diffms -= DifferMinute * hoursms
DifferSecond = Math.floor(Diffms / Secondms)
Diffms -= DifferSecond * Secondms
var dSecs = Math.floor(Diffms / microsecond)

if(convertHour != DifferHour) a=""+DifferHour+"天";
if(convertMinute != DifferMinute) b=""+DifferMinute+"时";
if(convertSecond != DifferSecond) c=""+DifferSecond+"分"
d=""+dSecs+"秒"
if (DifferHour>0) {a=a}
else {a=''}
document.getElementById("leftTime"+key).innerHTML = a + b + c + d; //显示倒计时信息

}
</script>
<!-- 促销商品-->
<!--{foreach from=$promotion_goods key=key item=goods name="promotion_foreach"}-->
<li>
<a href="{$goods.url}" class="pro_img" target="_blank"><img src="{$goods.thumb}" alt="{$goods.name|escape:html}"></a>
<a href="{$goods.url}" title="{$goods.name|escape:html}" class="pro_name">{$goods.name|escape:html}</a>
<p class="tl"><strong>{$goods.promote_price}</strong><del>{$goods.market_price}</del></p>
<p class="last_time">剩余<span id="leftTime{$smarty.foreach.promotion_foreach.index}"></span></p>
</li>
<script>

在DW里面老提示 53行语法错误也就是这个Tday[{$key}] = new Date("{$goods.gmt_end_time}");
在首页就这样显示 2014-04-19_104032.png 根本就不显示天数什么的 求高人帮帮忙!

回答:
没有高手在吗帮忙解决下!!另有感谢。。。。


对这个不是很清楚

坛子里没有能搞定的人吗 可以报酬的大侠们