拍卖时间倒计时问题 15
拍卖时间倒计时是做出来了functionJSTime(vYear,vMonth,vDate,vHour,vMinute,vSecond,vState){if(vState...
拍卖时间倒计时是做出来了function JSTime(vYear,vMonth,vDate,vHour,vMinute,vSecond, vState)
{
if (vState == 0)
{
//设置过期日期
var expireDate = new Date(vYear,vMonth-1,vDate,vHour,vMinute,vSecond);
//设置当前日期
var thisTime = new Date();
//总计剩余时间(毫秒)
var remainTime = expireDate-thisTime;
if(remainTime>0){
var remainDay,remainHour,remainMinute,remainSecond;
remainDay = Math.floor(remainTime/1000/3600/24);
remainTime = remainTime - (remainDay*1000*3600*24);
remainHour = Math.floor(remainTime/1000/3600);
remainTime = remainTime - (remainHour*1000*3600);
remainMinute = Math.floor(remainTime/1000/60);
remainTime = remainTime - (remainMinute*1000*60);
remainSecond = Math.floor(remainTime/1000);
remainTime = remainDay+"天"+remainHour+"小时"+remainMinute+"分"+remainSecond+"秒";
document.all["time"].innerHTML =remainTime;
}
else
document.all["time"].innerHTML ="竞拍结束";
}
else
if (vState == 1)
{
document.all["time"].innerHTML ="竞拍结束";
}
else
document.all["time"].innerHTML ="竞拍结束";
}可惜倒计时是客户端时间和拍卖产品结束时间差,而拍卖倒倒计时肯定要以服务器时间为准,否则客户端随意改时间又可以继续拍卖了,看了淘宝的拍卖用的js都不知道是写什么,又乱又多,帮帮忙解决这个问题,最好有代码 展开
{
if (vState == 0)
{
//设置过期日期
var expireDate = new Date(vYear,vMonth-1,vDate,vHour,vMinute,vSecond);
//设置当前日期
var thisTime = new Date();
//总计剩余时间(毫秒)
var remainTime = expireDate-thisTime;
if(remainTime>0){
var remainDay,remainHour,remainMinute,remainSecond;
remainDay = Math.floor(remainTime/1000/3600/24);
remainTime = remainTime - (remainDay*1000*3600*24);
remainHour = Math.floor(remainTime/1000/3600);
remainTime = remainTime - (remainHour*1000*3600);
remainMinute = Math.floor(remainTime/1000/60);
remainTime = remainTime - (remainMinute*1000*60);
remainSecond = Math.floor(remainTime/1000);
remainTime = remainDay+"天"+remainHour+"小时"+remainMinute+"分"+remainSecond+"秒";
document.all["time"].innerHTML =remainTime;
}
else
document.all["time"].innerHTML ="竞拍结束";
}
else
if (vState == 1)
{
document.all["time"].innerHTML ="竞拍结束";
}
else
document.all["time"].innerHTML ="竞拍结束";
}可惜倒计时是客户端时间和拍卖产品结束时间差,而拍卖倒倒计时肯定要以服务器时间为准,否则客户端随意改时间又可以继续拍卖了,看了淘宝的拍卖用的js都不知道是写什么,又乱又多,帮帮忙解决这个问题,最好有代码 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询