谁能帮我看一下这个网站商品抢购结束倒计时代码? 为什么不显示

作者在 2011-01-04 10:22:00 发布以下内容
谁能帮我看一下这个网站商品抢购结束倒计时代码? 为什么不显示
我有个购物网站当首页显示4个商品时,只有第一个商品抢拍倒计时显示正常,下面三个商品倒计时无效,不知道是怎么回事?或谁有更好的方法能实现,谢谢了
未命名.jpg (102.86 KB)
 
源码:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'##################
'本段asp代码作用为根据不同页面输出不同的子页导航
dim pagename  
pagename= "index"
'##################
%>
<!--#include file="webconfig.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%= head_title %></title>
<meta name="Keywords" content="<%=Keywords  %>" />
<meta name="Description" content="<%=Description  %>" />
<link href="styles/index.css" rel="stylesheet" type="text/css" />
<script src="scripts/common.js" type="text/javascript"></script>
<script src="js/ajax.js" type="text/javascript"></script>
<%= head_info %>
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
.STYLE2 {
    color: #FF6600;
    font-weight: bold;
}
.STYLE3 {color: #FF6600}
-->
</style>
</head>
<body>
<div class="container">
  <div class="header">
    <!--#include file="top.asp" -->
  </div>
  <div class="bodier">
    <div class="sidebar">
      <!--#include file="sidebar.asp" -->
    </div>
    <%
dim itype
if not request("itype")="" then
itype=request("itype")
else
itype="美食生活"
end if
set rs_p=server.CreateObject("ADODB.recordset")
sql_p="select top 4 * from product where begintime<=#"&now()&"# and type='"&itype&"' order by begintime desc"
rs_p.open sql_p,conn
%>
<%
'do while not(Rs.EOF )
For j = 1 to 4
%>
    <div class="mainbody">
      <div class="share">
        <ul>
          <script language="JavaScript">
function fastreply(subject) {
if(document.input) {
document.input.subject.value = subject;
document.input.message.focus();
}
}

function copylin()
{
window.clipboardData.setData('text',document.location.href);
alert('复制成功')
}
  </script>
          <li class="msn"><a id="deal-share-im" onclick="copylin()">MSN/QQ</a></li>
          <li class="kaixin"><a href="http://www.kaixin001.com/repaste/share.php?rurl=http://www.syp99.com/index.asp?id=4049&rcontent=http://www.syp99.com/index.asp?rtitle=<%=rs_p("title")%>" rel="skip_external" target="_blank">开心</a></li>
          <li class="renren"> <a title="分享到人人网" class="jiathis_button_renren">人人网</a> </li>
          <script type="text/javascript" src="http://www.jiathis.com/code/jia.js" charset="utf-8"></script>
          <li class="douban"><a href="http://www.douban.com/recommend/?url=http://www.syp99.com/index.asp?title=<%=rs_p("title")%>" target="_blank">豆瓣</a></li>
          <li class="sina"><a href="http://v.t.sina.com.cn/share/share.php?appkey=1803289631&url=http://www.syp99.com/index.asp" target="_blank">新浪微博</a></li>
          <li class="sohu"><a href="http://bai.sohu.com/share/blank/addbutton.do?from=gohome&link=http:/www.syp99.com/index.asp" target="_blank">白社会</a></li>
          <li class="email"><a href="mailto:?body=<%=rs_p("title")%>http://www.syp99.com/index.asp&subject=<%=rs_p("title")%>">邮件</a></li>
          <li class="yphone">
            <script>
             function china_mobile(s,d,e)
             {
              try{}catch(e){}
              var f='http://go.139.com/ishare.do?';
              var u=d.location.href+"?id=4049";
              var p=['shareUrl=',e(u),'&title=',e(d.title),'&sid=55ef0c0718677b912f7368585a76afdd'].join('');
              function a(){
               if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,location=0,scrollbars=1,width=800,height=600,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');
              };
               if(/Firefox/.test(navigator.userAgent)){
               setTimeout(a,0)
               }else{
               a()
               }
             }
            </script>
          <a style="cursor:pointer;" onclick="china_mobile(screen,document,encodeURIComponent)" target="_blank">手机</a> </li>
        </ul>
        <div class="c"></div>
        <div class="c qqmsnbox" id="deal-share-im-c" style="display:none"> 把下面的内容通过 MSN 或 QQ 发送给好友:<br />
            <input name="Input" id="invite_url" type="text"  readonly value="<%=rs_p("title")%> http://www.syp99.com/index.asp" class="intfz" onclick="this.select()"/>
        </div>
      </div>
      <div class="column1">
        <div class="head"></div>
        <div class="body">
          <h1 class="newstitle"><span ><span class="STYLE3">今日团购</span>:</span><a href="product_content.asp?id=<%=rs_p("id")%>"><%=rs_p("title")%></a></h1>
          <div class="side" style="position:relative;">
            <div class="img" style="position: absolute;width:295px; height:96px; left:-125px; ">
              <%
              if rs_p("Number_t")>=rs_p("Number_m") or rs_p("lasttime")<now() then
              
              %>
              <img src="images/js.jpg" width="295" height="96" />
              <%else%>
              <form <%if not session("m_id")="" then%>action="buy.asp"<%else%>action="login.asp"<%end if%> method="post" name="form_buy">
                <input name="title" type="hidden" value="<%=rs_p("title")%>"/>
                <input name="price" type="hidden" value="<%=rs_p("price4")%>"/>
                <input name="endtime" type="hidden" value="<%=rs_p("endtime")%>"/>
                <input name="c_id" type="hidden" value="<%=rs_p("c_id")%>"/>
                <input name="p_id" type="hidden" value="<%=rs_p("id")%>"/>
                <input name="submit" src="images/fudingjin.jpg" width="295" height="96" type="image" />
              </form>
              <%end if%>
              <span style="position:absolute; left:102px; color:#fff; font-size:30px; top:17px; z-index:2;">¥<%=rs_p("price4")%></span> </div>
            <div class="boxs">
              <div class="jiage">
                <dl>
                  <dt>原价</dt>
                  <dd><strike><span class="STYLE1">¥<%=rs_p("price1")%></span></strike></dd>
                </dl>
                <dl>
                  <dt>折扣</dt>
                  <dd><%=Formatnumber(rs_p("zhekou"),1,-1,-1,0)%>折</dd>
                </dl>
                <dl>
                  <dt>节省</dt>
                  <dd>¥<%=rs_p("price3")%></dd>
                </dl>
              </div>
            </div>
            <div class="boxs">
              <%if rs_p("Number_t")>=rs_p("Number_m") or rs_p("lasttime")<now() then%>
              <div class="jieshu">距离本次团购已于<%=FormatDateTime(rs_p("lasttime"),1)%>&nbsp;<%=FormatDateTime(rs_p("lasttime"),4)%>结束</div>
              <%else%>
              <%
If IsDate(rs_p("lastTime")) Then
yy = CStr(Year(rs_p("lastTime")))
y = Mid(CStr(Year(rs_p("lastTime"))),3)
m = CStr(Month(rs_p("lastTime")))
If Len(m) = 1 Then m = "0" & m
d = CStr(Day(rs_p("lastTime")))
If Len(d) = 1 Then d = "0" & d
h = CStr(Hour(rs_p("lastTime")))
If Len(h) = 1 Then h = "0" & h
mi = CStr(Minute(rs_p("lastTime")))
If Len(mi) = 1 Then mi = "0" & mi
s = CStr(Second(rs_p("lastTime")))
If Len(s) = 1 Then s = "0" & s
End If

%>
              <div class="jieshu">距本次团购结束还有: <span id='leftTime220'></span>天<span id='leftTime221'></span>小时<span id='leftTime222'></span>分<span id='leftTime223'></span>秒</div>
              <script type="text/javascript">
<!--   
startclock();   
var timerID = null;   
var timerRunning = false;     
function showtime() {
    Today = new Date();   
    var NowHour = Today.getHours();   
    var NowMinute = Today.getMinutes();   
    var NowMonth = Today.getMonth();   
    var NowDate = Today.getDate();   
    var NowYear = Today.getYear();   
    var NowSecond = Today.getSeconds();   
    if (NowYear <2000){  
        NowYear=1900+NowYear;   
    }
    Today = null;   
    Hourleft = <%=h%>- NowHour   
    Minuteleft = <%=mi%>- NowMinute   
    Secondleft = <%=s%> - NowSecond   
    Yearleft = <%=yy%> - NowYear   
    Monthleft = <%=m%> - NowMonth - 1   
    Dateleft = <%=d%>- NowDate   
    if (Secondleft<0) {   
        Secondleft=60+Secondleft;   
        Minuteleft=Minuteleft-1;   
    }   
    if (Minuteleft<0){   
        Minuteleft=60+Minuteleft;   
        Hourleft=Hourleft-1;   
    }   
    if (Hourleft<0){   
        Hourleft=24+Hourleft;   
        Dateleft=Dateleft-1;   
    }   
    if (Dateleft<0){   
        Dateleft=31+Dateleft;   //todo
        Monthleft=Monthleft-1;   
    }   
    if (Monthleft<0){   
        Monthleft=12+Monthleft;   
        Yearleft=Yearleft-1;   
    }
   
    replaceText('leftTime220',Dateleft);   
    replaceText('leftTime221',Hourleft);   
    replaceText('leftTime222',Minuteleft);   
    replaceText('leftTime223',Secondleft);  
    timerID = setTimeout("showtime()",1000);   
    timerRunning = true;   
}
function stopclock () {   
    if(timerRunning) {  
        clearTimeout(timerID);   
    }
    timerRunning = false;   
}   
function startclock () {   
    stopclock();   
    showtime();   
}   
// -->
  </script>
              <%end if%>
            </div>
            <%if rs_p("Number_t")>=rs_p("Number_m") or rs_p("lasttime")<now() then%>
            <div style="border:1px solid #CBCBCB; background:#fcecc8; margin-bottom:10px; padding:28px 0 " ><img src="images/empty.png" width="165"   /></div>
            <%else%>
            <div class="boxs">
              <div class="renshu"><strong>已经有<%=rs_p("Number_t")%>人购买</strong>
                  <% If rs_p("Number_l") > rs_p("Number_t") Then %>
                  <div class="huatiao">
                    <%
                sw=Formatnumber(rs_p("Number_t")*140/rs_p("Number_l"),0,-1,-1,0)
                %>
                    <p style="background-position:<%=sw%>px 0;">
                      <!-- background-position:25px 200px 乘以百分比  -->
                    </p>
                    <ul style="margin-top:5px; line-height:15px; height:15px;">
                      <span style="float:right;"><%=rs_p("Number_l")%></span><span><%=rs_p("Number_t")%></span>
                    </ul>
                  </div>
                <p>尚未到达团购人数!</p>
                <% Else %>
                  <div class="chenggong"><img src="images/gou.jpg" width="30" height="30" style="vertical-align:middle; margin-right:10px;" />团购已成功,还可以继续购买!</div>
                <p><%=FormatDateTime(rs_p("succsstime"),3)%>到达</p>
                <p>最低团购人数<%=rs_p("Number_l")%>人!</p>
                <% End If %>
              </div>
            </div>
            <%end if%>
          </div>
          <div class="main">
            <div class="datu">
              <div class="image"><img src="eweb_upload/tuangou/<%=rs_p("photo")%>" width="517" height="364" /></div>
              <p class="text"><%=rs_p("content1")%></p>
            </div>
            
          </div>
         
          <div class=" clearfloat"></div>
        </div>
     
        <div class="foot"></div>
        
      </div>
      
    </div>
          <%
Rs_p.MoveNext
'loop
If rs_p.EOF Then Exit For
next

rs_p.close
set rs_p=nothing

%>
  </div>
  <div class="footer">
  
    <!--#include file="bottom.asp" -->
  </div>
</div>
</body>
</html>
默认分类 | 阅读 873 次
文章评论,共0条
游客请输入验证码
文章分类
文章归档
最新评论