/** * Created by Administrator on 2021/4/5. */ define(['jquery', "template", "Tools", "biddingApi", "itemsApi"], function ($, template, Tools ) { //数据存储 var module = { data: { timeArray: { d: '', h: '', m: '', s: '', }, outProjectInformationDetail:{} }, }; var tools = new Tools(); module.init = function (page) { tools.doGet(outProject + '/id/'+getQueryVariable('id'), {}, module.outProjectInformation,true); tools.doGet(webConfig, {}, module.webConfigInformation, true) $("#nowDateNYR").html(new Date().getFullYear()+'.'+(new Date().getMonth()+1)+'.'+new Date().getDate()) setInterval(function () { $("#nowDateSFM").html(new Date().toLocaleTimeString()); $("#nowTime").html('服务器时间:'+new Date().getFullYear()+'.'+(new Date().getMonth()+1)+'.'+new Date().getDate()+' '+new Date().toLocaleTimeString()); },1000) tools.doGet(outProject + '/id/'+getQueryVariable('id'), {}, module.outProjectInformation,true); if (getQueryVariable('type') == 'Y'){ setInterval(function (){ tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true); },5000) } }; //获取地址栏参数 function getQueryVariable(variable){ var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i 0){ if(module.data.outProjectInformationDetail.biddingType=='自由竞价'&&module.data.outProjectInformationDetail.projectShowStatus!='已经成交'){ $("#biddingMoney").html('*'); }else{ $("#biddingMoney").html(content[0].money+module.data.outProjectInformationDetail.unit); } }else{ $("#biddingMoney").html('无'); } } } module.dataCompare = function(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime){ var signupStartTime = signupStartTime; var signupStopTime = signupStopTime; var biddingStartTime = biddingStartTime; var biddingStopTime = biddingStopTime; var nowTime = Date.parse(new Date()); var beginTimes=signupStartTime.substring(0,10).split('-'); var endTimes=signupStopTime.substring(0,10).split('-'); var biddingBeginTimes=biddingStartTime.substring(0,10).split('-'); var biddingEndTimes=biddingStopTime.substring(0,10).split('-'); signupStartTime=beginTimes[1]+'/'+beginTimes[2]+'/'+beginTimes[0]+' '+signupStartTime.substring(10,19); signupStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+signupStopTime.substring(10,19); biddingStartTime=biddingBeginTimes[1]+'/'+biddingBeginTimes[2]+'/'+biddingBeginTimes[0]+' '+biddingStartTime.substring(10,19); biddingStopTime=biddingEndTimes[1]+'/'+biddingEndTimes[2]+'/'+biddingEndTimes[0]+' '+biddingStopTime.substring(10,19); //时间差 var leftTime = Date.parse(biddingStopTime)-nowTime; //报名开始时间差 var signupLeftTime = Date.parse(signupStartTime)-nowTime; //报名结束时间差 var signDownLeftTime = Date.parse(signupStopTime)-nowTime; //定义变量 d,h,m,s保存倒计时的时间 var d,h,m,s; if(Date.parse(biddingStartTime)Date.parse(biddingStopTime)){ //竞价结束 $('#d0').html('0') $('#d1').html('0') $('#d2').html('0') $('#h0').html('0') $('#h1').html('0') $('#m0').html('0') $('#m1').html('0') $('#s0').html('0') $('#s1').html('0') $('#countType').html('竞价结束') module.data.biddingTimeType = 2; }else if (nowTimeDate.parse(signupStopTime)){ //报名结束 module.data.signupTimeType = 2; }else if (nowTime?' module.data.timeConfig = content[8].configValue; module.data.titleConfig = content[9].configValue; module.data.importantTitle = content[7].configName+':'+ content[7].configValue.substr(3).substr(0,(content[7].configValue.substr(3).length-4)); module.data.know = content[6].configValue; $("#know").html(content[6].configValue + '' + content[6].configValue); } } module.biddingDirectDictionaries = function (data) { if (data.code == 200 && module.data.outProjectInformationDetail.biddingDirect!='') { var content = data.data; var biddingDirect = content[(module.data.outProjectInformationDetail.biddingDirect-1)].dictLabel; module.data.outProjectInformationDetail.biddingDirect = biddingDirect; var outProjectInformationData = template('outProjectInformationData', module.data); $("#outProjectInformationContent").html(outProjectInformationData); var outProjectInformationData2 = template('outProjectInformationData2', module.data); $("#outProjectInformationContent2").html(outProjectInformationData2); } } module.unitDictionaries = function (data) { if (data.code == 200) { var content = data.data; var unit = content[(module.data.outProjectInformationDetail.unit-1)].dictLabel; module.data.outProjectInformationDetail.unit = unit; var outProjectInformationData = template('outProjectInformationData', module.data); $("#outProjectInformationContent").html(outProjectInformationData); var outProjectInformationData2 = template('outProjectInformationData2', module.data); $("#outProjectInformationContent2").html(outProjectInformationData2); $('#unit').html('出价【'+unit+'】') } } module.biddingTypeDictionaries = function (data) { if (data.code == 200 && module.data.outProjectInformationDetail.biddingType!='') { var content = data.data; var biddingType = content[(module.data.outProjectInformationDetail.biddingType-1)].dictLabel; module.data.outProjectInformationDetail.biddingType = biddingType; var outProjectInformationData = template('outProjectInformationData', module.data); $("#outProjectInformationContent").html(outProjectInformationData); var outProjectInformationData2 = template('outProjectInformationData2', module.data); $("#outProjectInformationContent2").html(outProjectInformationData2); } } return module; });