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 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记