mshzg1314 2013-10-16 03:03 采纳率: 0%
浏览 2425

如果有三条记录 list最后一条倒计时不显示

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



秒杀抢购<#if setting.isShowPoweredInfo> - Powered By ChinaBuy</#if>










<!--公共样式--> #box{width:100px;padding:2px 3px;overflow:hidden; text-overflow:ellipsis;white-space:nowrap;/* 不换行 */} A.applink:hover {border: 2px dotted #DCE6F4;padding:2px;background-color:#ffff00;color:green;text-decoration:none} A.applink {border: 2px dotted #DCE6F4;padding:2px;color:#2F5BFF;background:transparent;text-decoration:none} A.info {color:#2F5BFF;background:transparent;text-decoration:none} A.info:hover {color:green;background:transparent;text-decoration:underline}

0)>
  • #if>

    20)> ${(promotion.ccGoods.name).substring(0,20)+"..."} ${promotion.ccGoods.name} #if>

    ${promotion.price?string(currencyFormat)}

    市场价

    ${promotion.ccGoods.marketPrice?string(currencyFormat)}

    您节省

    ${(promotion.ccGoods.marketPrice-promotion.price)?string(currencyFormat)}

    折扣:#{(promotion.price/promotion.ccGoods.marketPrice*10);M2}折

    已有${promotion.ccGoods.xiaoLiang}人购买,

    ${promotion.introduction}

  • #if> #list>
#if>
20)> ${(promotion.ccGoods.name).substring(0,20)+"..."} ${promotion.ccGoods.name} #if>

${promotion.price?string(currencyFormat)}

市场价:${promotion.ccGoods.marketPrice?string(currencyFormat)}

#if> #list>

2)>
市场价:${promotion.ccGoods.marketPrice?string(currencyFormat)}     已成交:${promotion.ccGoods.xiaoLiang}
¥${promotion.price}
说明: 20)> ${(promotion.introduction).substring(0,20)+"..."} ${promotion.introduction} #if>
#if> #list>
没有找到任何记录!
#if>
var pageObject={ topSecKill:1, base:'', goodsUrlPrefix:'http://mall.etong.com/item.html?id=' }

<!--倒计时JS-->

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(jstime,id,kstimes,biaoshi) { var bdtime=kstimes.getTime(); 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 keydate = new Date(jstime); var Diffms = keydate.getTime() - time.getTime(); if(time.getTime()<bdtime) { Diffms=bdtime-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="<fontcolor=red>"+DifferHour+"</font>天"; if(convertMinute != DifferMinute) b="<fontcolor=red>"+DifferMinute+"</font>时"; if(convertSecond != DifferSecond) c="<fontcolor=red>"+DifferSecond+"</font>分" d="<fontcolor=red>"+dSecs+"</font>秒" if (DifferHour>0) {a=a} else {a=''} if(time.getTime()<bdtime) { if(biaoshi=="time") { document.getElementById(biaoshi+id).innerHTML = a + b + c +d;; //距离开始显示倒计时信息 document.getElementById("bgimg"+id).style.background="url(${base}/template/shop/images/surprised_price_hei.gif)"; document.getElementById("imgId"+id).src = "${base}/template/shop/images/grounp_buy_now_disable.gif"; document.getElementById("zhuangtai"+id).style.background="url(${base}/template/shop/images/grounp_S1_ks.gif)"; } else if(biaoshi=="stime") { document.getElementById("smlimg"+id).style.background="url(${base}/template/shop/images/grounp_item_bg_hei.gif)"; document.getElementById(biaoshi+id).innerHTML = "距开始:"+a + b + c +d;; //距离开始显示倒计时信息 } } else if(time.getTime()>keydate.getTime()) { if(biaoshi=="time") { document.getElementById(biaoshi+id).innerHTML = "活动已结束"; document.getElementById("bgimg"+id).style.background="url(${base}/template/shop/images/surprised_price_hei.gif)"; document.getElementById("imgId"+id).src = "${base}/template/shop/images/grounp_buy_now_disable.gif"; document.getElementById("zhuangtai"+id).style.background="url(${base}/template/shop/images/grounp_S1_ks.gif)"; } else if(biaoshi=="stime") { document.getElementById("smlimg"+id).style.background="url(${base}/template/shop/images/grounp_item_bg_hei.gif)"; document.getElementById(biaoshi+id).innerHTML = "活动已结束"; } } else if(bdtime<=time.getTime()<=keydate.getTime()) { if(biaoshi=="time") { document.getElementById(biaoshi+id).innerHTML = a + b + c +d; //距离结束显示倒计时信息 } else if(biaoshi=="stime") { document.getElementById(biaoshi+id).innerHTML = "距结束:"+a + b + c +d; //距离结束显示倒计时信息 } } } function NewDate(str) { str = str.split('-'); var date = new Date(); date.setUTCFullYear(str[0], str[1] - 1, str[2]); date.setUTCHours(0, 0, 0, 0); return date; } function call() { <#list plist as promotion> <#if (promotion_index<2)> var time="${promotion.endDate}"; time=time.substring(0,19); var pid="${promotion.id}" var Tdaykey = new Date(Date.parse(time.replace(/-/g, "/"))); var beginTime="${promotion.beginDate}"; beginTime=beginTime.substring(0,19); var beginDate=new Date(Date.parse(beginTime.replace(/-/g, "/"))); var bdtime=beginDate.getTime(); clock(Tdaykey,pid,beginDate,"time"); </#if> </#list> <#list plist as promotion> <#if (promotion_index>2)&&(promotion_index!=2)> var time="${promotion.endDate}"; time=time.substring(0,19); var pid="${promotion.id}" var Tdaykey = new Date(Date.parse(time.replace(/-/g, "/"))); var beginTime="${promotion.beginDate}"; beginTime=beginTime.substring(0,19); var beginDate=new Date(Date.parse(beginTime.replace(/-/g, "/"))); var bdtime=beginDate.getTime(); clock(Tdaykey,pid,beginDate,"stime"); </#if> </#list> } window.setInterval(function(){call();}, 1000);

  • 写回答

1条回答 默认 最新

  • xialxl 2013-10-16 03:19
    关注

    本想看看能不能帮你解决,看到这么长的代码,而且js还是没有格式化的,唉,算了吧。还是你自己研究吧。我已无力回天。

    评论

报告相同问题?

悬赏问题

  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀