|
|
@@ -11,7 +11,8 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function |
|
|
|
loginNow:'', |
|
|
|
timer:null, |
|
|
|
biddinglistInformationDetailLength:0, |
|
|
|
biddingTimeType:0 |
|
|
|
biddingTimeType:0, |
|
|
|
biddinglistInformationDetail:[] |
|
|
|
}, |
|
|
|
}; |
|
|
|
var tools = new Tools(); |
|
|
@@ -250,6 +251,9 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function |
|
|
|
//倒计时 |
|
|
|
module.data.timer = setInterval(function(){ |
|
|
|
|
|
|
|
//挂牌项目竞价记录 |
|
|
|
tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true); |
|
|
|
|
|
|
|
let signupStartTime = content.signupStartTime; |
|
|
|
let signupStopTime = content.signupStopTime; |
|
|
|
let biddingStartTime = content.biddingStartTime; |
|
|
@@ -361,21 +365,25 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function |
|
|
|
if (data.code == 200) { |
|
|
|
console.log(data) |
|
|
|
var content = data.rows; |
|
|
|
for (var i = 0; i < content.length-1; i++) { |
|
|
|
for (var j = 0; j < content.length - 1 - i; j++) { |
|
|
|
// 相邻元素两两对比,元素交换,大的元素交换到后面 |
|
|
|
if (content[j].money < content[j + 1].money) { |
|
|
|
var temp = content[j]; |
|
|
|
content[j] = content[j+1]; |
|
|
|
content[j+1] = temp; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// for (var i = 0; i < content.length-1; i++) { |
|
|
|
// for (var j = 0; j < content.length - 1 - i; j++) { |
|
|
|
// // 相邻元素两两对比,元素交换,大的元素交换到后面 |
|
|
|
// if (content[j].money < content[j + 1].money) { |
|
|
|
// var temp = content[j]; |
|
|
|
// content[j] = content[j+1]; |
|
|
|
// content[j+1] = temp; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
console.log(content) |
|
|
|
module.data.biddinglistInformationDetail = content; |
|
|
|
module.data.biddinglistInformationDetailLength = content.length; |
|
|
|
var biddinglistInformationData = template('biddinglistInformationData', module.data); |
|
|
|
$("#tabDetail4").html(biddinglistInformationData); |
|
|
|
$("#nowMoney").html(content[0].money); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(module.data.biddingTimeType) |
|
|
|
|
|
|
|
} |
|
|
@@ -530,6 +538,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function |
|
|
|
|
|
|
|
module.biddingSubmitOpen = function(){ |
|
|
|
tools.initError('出价成功'); |
|
|
|
$('#money').val(0) |
|
|
|
} |
|
|
|
|
|
|
|
//经济类型 |
|
|
@@ -671,27 +680,72 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function |
|
|
|
|
|
|
|
//向上加价 |
|
|
|
upMoney = function(){ |
|
|
|
if(module.data.outProjectInformationDetail.money < module.data.outProjectInformationDetail.price){ |
|
|
|
module.data.outProjectInformationDetail.money = module.data.outProjectInformationDetail.price; |
|
|
|
if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){ |
|
|
|
if (module.data.biddinglistInformationDetail.length<1){ |
|
|
|
if(module.data.outProjectInformationDetail.price <= $('#money').val()){ |
|
|
|
tools.initError('出价不能高于挂牌价格'); |
|
|
|
return; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
|
|
|
|
if(module.data.biddinglistInformationDetail[0].money <= (parseInt($('#money').val())+parseInt(module.data.outProjectInformationDetail.ladderPrice))){ |
|
|
|
tools.initError('出价不能高于当前出价最低价格'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if (module.data.biddinglistInformationDetail.length<1){ |
|
|
|
if(module.data.outProjectInformationDetail.price>=$('#money').val()){ |
|
|
|
tools.initError('出价不能低于挂牌价格'); |
|
|
|
return; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(module.data.biddinglistInformationDetail[0].money>=$('#money').val()){ |
|
|
|
tools.initError('出价不能低于当前出价最高价格'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
module.data.outProjectInformationDetail.money += module.data.outProjectInformationDetail.ladderPrice ; |
|
|
|
document.getElementById('money').value = module.data.outProjectInformationDetail.money; |
|
|
|
|
|
|
|
$('#money').val() == null||$('#money').val() == ''?$('#money').val(0):''; |
|
|
|
|
|
|
|
console.log($('#money').val()) |
|
|
|
module.data.outProjectInformationDetail.ladderPrice?$('#money').val(parseInt($('#money').val())+parseInt(module.data.outProjectInformationDetail.ladderPrice)):document.getElementById('money').value += 1 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//向下降价 |
|
|
|
downMoney = function(){ |
|
|
|
console.log(module.data.outProjectInformationDetail.money) |
|
|
|
console.log(module.data.outProjectInformationDetail.price) |
|
|
|
console.log(module.data.outProjectInformationDetail.ladderPrice) |
|
|
|
// if (module.data.){ |
|
|
|
// |
|
|
|
// } |
|
|
|
if(module.data.outProjectInformationDetail.money <= (module.data.outProjectInformationDetail.price+module.data.outProjectInformationDetail.ladderPrice)){ |
|
|
|
return; |
|
|
|
if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){ |
|
|
|
if (module.data.biddinglistInformationDetail.length<1){ |
|
|
|
if(module.data.outProjectInformationDetail.price<=$('#money').val()){ |
|
|
|
tools.initError('出价不能高于挂牌价格'); |
|
|
|
return; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(module.data.biddinglistInformationDetail[0].money<$('#money').val()){ |
|
|
|
tools.initError('出价不能高于当前出价最低价格'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if (module.data.biddinglistInformationDetail.length<1){ |
|
|
|
if(module.data.outProjectInformationDetail.price>=$('#money').val()){ |
|
|
|
tools.initError('出价不能低于挂牌价格'); |
|
|
|
return; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(module.data.biddinglistInformationDetail[0].money>=(parseInt($('#money').val())-parseInt(module.data.outProjectInformationDetail.ladderPrice))){ |
|
|
|
tools.initError('出价不能低于当前出价最高价格'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
module.data.outProjectInformationDetail.money -= module.data.outProjectInformationDetail.ladderPrice ; |
|
|
|
document.getElementById('money').value = module.data.outProjectInformationDetail.money; |
|
|
|
$('#money').val() == null?$('#money').val(0):''; |
|
|
|
if ($('#money').val() == 0)return; |
|
|
|
module.data.outProjectInformationDetail.ladderPrice?$('#money').val(parseInt($('#money').val())-parseInt(module.data.outProjectInformationDetail.ladderPrice)):document.getElementById('money').value -= 1 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
moneyChange = function(){ |
|
|
|