瀏覽代碼

产权交易

newProperty
庞东旭 1 年之前
父節點
當前提交
e578897937
共有 1 個檔案被更改,包括 49 行新增22 行删除
  1. +49
    -22
      static/js/project/bidding/biddingBigDataDetail.js

+ 49
- 22
static/js/project/bidding/biddingBigDataDetail.js 查看文件

@@ -99,9 +99,52 @@ define(['jquery', "template", "Tools", "biddingApi", "itemsApi"], function ($, t
//交易项目竞价记录
tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);




//倒计时
module.data.timer = setInterval(function(){
module.dataCompare(content.signupStartTime,content.signupStopTime,content.biddingStartTime,content.biddingStopSetime);
let signupStartTime = module.data.outProjectInformationDetail.signupStartTime;
let signupStopTime = module.data.outProjectInformationDetail.signupStopTime;
let biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime;
let biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;//延时后结束时间
let biddingStopSetime = module.data.outProjectInformationDetail.biddingStopSetime;//原始结束时间
var nowTime = Date.parse(new Date());

var difference = Date.parse(biddingStopTime)-nowTime;//延时后时间差
var differenceSetime = Date.parse(biddingStopSetime)-nowTime;//原始时间差

var centerTime = content.delayPeriod * 1000//延时周期

var m,s;
m = Math.floor(difference/1000/60%60);
s = Math.floor(difference/1000%60);
if ( differenceSetime <= 0 && difference >= 0 && difference <= centerTime){
module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime);
if (s < 2 && m < 1){
console.log("竞价结束22222222222")
tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){
if (data.code == 200) {
module.data.outProjectInformationDetail.biddingStopTime = data.data
let timeNew = Date.parse(data.data) + 0 - nowTime;
if (timeNew > 0) {
module.data.outProjectInformationDetail.biddingStopTime = data.data;
}else{
$('#countDown').html('竞价结束')
return;
}
}
},true);
}else if(s%2 == 0&&centerTime!=0){
tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
if (data.code == 200) {
module.data.outProjectInformationDetail.biddingStopTime = data.data
}
},true);
}
}else{
module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopSetime);
}
},1000);
}
}
@@ -218,26 +261,6 @@ define(['jquery', "template", "Tools", "biddingApi", "itemsApi"], function ($, t
$('#s0').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
$('#s1').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);

let d,h,m,s;
d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
m = Math.floor(leftTime / 1000 / 60 % 60);
s = Math.floor(leftTime / 1000 % 60);

if ( d == 0 && h == 0 && m == 0 && s < 2 ){
clearInterval(module.data.timer);
module.data.setimer = setInterval(()=>{
module.setimeDataCompare()
},1000)
console.log('开始延时')
}
if(s%2 == 0&&centerTime!=0){
tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
if (data.code == 200) {
module.data.outProjectInformationDetail.biddingStopTime = data.data
}
},true);
}
//tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);

$('#countType').html('距竞价结束还有')
@@ -320,7 +343,11 @@ define(['jquery', "template", "Tools", "biddingApi", "itemsApi"], function ($, t
}

module.setimeDataCompare = function(){

tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
if (data.code == 200) {
module.data.outProjectInformationDetail.biddingStopTime = data.data
}
},true);
var biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime
var biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;
var nowTime = Date.parse(new Date());


Loading…
取消
儲存