标题:谁能帮我看一下这个网站商品抢购结束倒计时代码? 为什么不显示
取消只看楼主
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
结帖率:100%
已结贴  问题点数:10 回复次数:8 
谁能帮我看一下这个网站商品抢购结束倒计时代码? 为什么不显示
我有个购物网站当首页显示4个商品时,只有第一个商品抢拍倒计时显示正常,下面三个商品倒计时无效,不知道是怎么回事?或谁有更好的方法能实现,谢谢了
首页原代码
index.rar (4.23 KB)
谢谢各位了
搜索更多相关主题的帖子: 购物网站 
2011-01-02 20:09
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
得分:0 
谢谢你了,我按照你说的,还是不行

麻烦高手帮我再看看,谢谢了
2011-01-03 09:52
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
得分:0 
<%@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.
<html xmlns="http://www.
<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.("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. charset="utf-8"></script>
          <li class="douban"><a href="http://www.("title")%>" target="_blank">豆瓣</a></li>
          <li class="sina"><a href="http://v.t. target="_blank">新浪微博</a></li>
          <li class="sohu"><a href="http://bai. target="_blank">白社会</a></li>
          <li class="email"><a href="mailto:?body=<%=rs_p("title")%>http://www.("title")%>">邮件</a></li>
          <li class="yphone">
            <script>
             function china_mobile(s,d,e)
             {
              try{}catch(e){}
              var f='http://go.';
              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. 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>
2011-01-03 09:59
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
得分:0 
非常感谢楼上的朋友关注我的问题,但自己是菜鸟,还没解决这个问题,希望朋友能留个邮箱,或qq我把整个源码发给你你帮我调试一下,再次不胜感激了,我的邮箱hhwz800@
2011-01-03 13:32
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
得分:0 
这样改了还是不行。提示无效字符
2011-01-04 10:14
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
得分:0 
这个地方我看到了,我已经修改了,还是那个无效字符的提示。朋友请让我把源码发给你你吧!
2011-01-04 13:48
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
得分:0 
我已经把全部源码上传上去了,你有时间帮我再看看吧,谢谢朋友了   下载地址:http://www.
2011-01-04 15:37
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
得分:0 
不好意思,我给你发不了邮件
   你到这里下载源码:http://www.
2011-01-04 17:51
hanzhong
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-1-2
得分:0 
兄弟。你太厉害了,佩服你的很,太多感谢的话就不说了,兄弟改天来西安了,我一定请你吃饭
2011-01-05 09:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-330447-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.137473 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved