diff --git a/static/js/project/listingItems/items2.js b/static/js/project/listingItems/items2.js index 17e319a..7f78f19 100644 --- a/static/js/project/listingItems/items2.js +++ b/static/js/project/listingItems/items2.js @@ -22,7 +22,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.init = function (page) { //获取焦点图信息 - //tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true); + tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true); //底部友情链接 tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true); @@ -99,7 +99,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.webConfigInformation = function (data) { if (data.code == 200) { var content = data.data; - console.log(content) + //console.log(content) //document.getElementById('time').innerHTML = '延时周期:'+content[8].configValue+content[8].remark+'?' module.data.timeConfig = parseFloat(content[8].configValue); module.data.titleConfig = content[9].configValue; @@ -113,14 +113,16 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.bottomFriendsLinks = function (data) { if (data.code == 200) { var content = data.data; - console.log(content) + //console.log(content) module.data.friendsLinksList = content; var friendsLinksData = template('friendsLinksData', module.data); $("#friendsLinksContent").html(friendsLinksData); } } + + var t = 3; module.dataCompare = function(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime){ - // console.log('aaaaaaaaaaa') + //console.log('aaaaaaaaaaa') var signupStartTime = signupStartTime; var signupStopTime = signupStopTime; var biddingStartTime = biddingStartTime; @@ -165,6 +167,20 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function // console.log('距竞价结束还有:'+d+''+h+''+m+''+s+'秒') $('#countType').html('竞价中') $('#countDown').html('距竞价结束还有:'+d+''+h+''+m+''+s+'秒') + if(module.data.outProjectInformationDetail.biddingType != '自由竞价' && module.data.biddingTimeType != 2){ + document.getElementById('showNowMoney').style.display = 'table-row'; + var timName = document.getElementById('timeDown'); + if(timName) { + document.getElementById('timeDown').style.display = 'inline-block'; + timName.innerHTML = t + '秒后自动刷新'; + } + t--; + if (t < 0) { + t = 3; + tools.doGet(biddinglist, {projectId: getQueryVariable('id')}, module.biddinglistInformation, true); + } + } + }else if (nowTime>Date.parse(biddingStopTime)){ //竞价结束 $('#countType').html('') @@ -347,33 +363,33 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function setTimeout(function(){ var outProjectInformationData = template('outProjectInformationData', module.data); $("#outProjectInformationContent").html(outProjectInformationData); - var timName = document.getElementById('timeDown'); - if(timName){ - var t = 3; - - module.data.timeDown = setInterval(function(){ - // console.log($('#countType').html()) - // if ($('#countType').html()!='竞价中'){ - // clearInterval(module.data.timeDown) - // document.getElementById('timeDown').style.display = 'none'; - // return; - // } - timName.innerHTML = t+'秒后自动刷新'; - t--; - document.getElementById('timeDown').style.display = 'inline-block'; - if(t<0){ - t = 3; - let biddingStartTime = content.biddingStartTime; - let biddingStopTime = content.biddingStopTime; - var nowTime = Date.parse(new Date()); - if(Date.parse(biddingStartTime)秒后自动刷新'; + // t--; + // document.getElementById('timeDown').style.display = 'inline-block'; + // if(t<0){ + // t = 3; + // let biddingStartTime = content.biddingStartTime; + // let biddingStopTime = content.biddingStopTime; + // var nowTime = Date.parse(new Date()); + // if(Date.parse(biddingStartTime)= 0 && difference <= centerTime){ + console.log("竞价最后两分钟") //正在竞价 - var m,s; if(module.data.outProjectInformationDetail.biddingType == '自由竞价'){ document.getElementById('biddingTable').style.display = 'none'; document.getElementById('biddingTitle').style.display = 'block'; @@ -444,10 +467,21 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function } // document.getElementById('swiperType').style.display = 'block'; module.data.biddingTimeType = 1; - m = Math.floor(difference/1000/60%60); - s = Math.floor(difference/1000%60); $('#countType').html('竞价中') $('#countDown').html('距竞价结束还有:00'+m+''+s+'秒') + if(module.data.outProjectInformationDetail.biddingType != '自由竞价' && module.data.biddingTimeType != 2){ + document.getElementById('showNowMoney').style.display = 'table-row'; + var timName = document.getElementById('timeDown'); + if(timName) { + document.getElementById('timeDown').style.display = 'inline-block'; + timName.innerHTML = t + '秒后自动刷新'; + } + t--; + if (t < 0) { + t = 3; + tools.doGet(biddinglist, {projectId: getQueryVariable('id')}, module.biddinglistInformation, true); + } + } if(module.data.loginNow){ //判断是否登录(已登录) if(module.data.signup == 1){ //判断是否报名(已报名) if( module.data.biddingTimeType == 1 ){ //判断当前竞价状态(竞价中) @@ -459,6 +493,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function document.getElementById('moneyText').style.display = 'table-row'; document.getElementById('moneyBtn').style.display = 'flex'; + $('.swiperInput').css('display','block') }else if( module.data.biddingTimeType == 3 ){ //判断当前竞价状态(竞价未开始) document.getElementById('moneyText').style.display = 'none'; document.getElementById('moneyBtn').style.display = 'none'; @@ -510,7 +545,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function document.getElementById('signBtn2').style.display = 'block'; } } - console.log(s+'-------------'+m) + //console.log(s+'-------------'+m) if (s < 1 && m < 1){ console.log("竞价结束22222222222") tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){ @@ -521,10 +556,13 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function let timeNew = Date.parse(data.data) + 0 - nowDate; if (timeNew > 0) { module.data.outProjectInformationDetail.biddingStopTime = data.data; - // module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,data.data); + $('.swiperInput').css('display','block') + // module.data.biddingTimeType = 1; }else{ $('#countType').html('') $('#countDown').html('竞价结束') + $('#timeDown').css('display','none'); + $('.swiperInput').css('display','none'); // document.getElementById('swiperType').style.display = 'none'; document.getElementById('biddingTable').style.display = 'table'; document.getElementById('biddingTitle').style.display = 'none'; @@ -542,7 +580,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function if (!signupStopTime){console.log('缺失报名结束时间');return;} if (!biddingStartTime){console.log('缺失竞价开始时间');return;} if (!biddingStopTime){console.log('缺失竞价结束时间');return;} - module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime); + module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopSetime); } if(module.data.outProjectInformationDetail.biddingType == '自由竞价' && module.data.biddingTimeType != 2){ document.getElementById('biddingTable').style.display = 'none'; @@ -568,7 +606,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.getBiddingStopTime = function(data){ if (data.code == 200) { - $('#stopTime').html(data.data) + // $('#stopTime').html(data.data) module.data.outProjectInformationDetail.biddingStopTime = data.data } } @@ -599,11 +637,17 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.biddinglistInformation = function (data) { if (data.code == 200) { var content = data.rows; + if (content.length>0){ + //console.log('abccba') + $("#nowMoneyBlock").html(''+content[0].money+' 元'); + }else{ + $("#nowMoneyBlock").html('暂无出价'); + } if(module.data.biddinglistInformationDetailLength == content.length){ return; } - console.log(module.data.outProjectInformationDetail.biddingDirect) - console.log(module.data.outProjectInformationDetail.biddingType) + //console.log(module.data.outProjectInformationDetail.biddingDirect) + //console.log(module.data.outProjectInformationDetail.biddingType) setTimeout(function(){ if(module.data.outProjectInformationDetail.biddingType == '阶梯竞价'||module.data.outProjectInformationDetail.biddingType == '2'){ @@ -637,10 +681,9 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.data.biddinglistInformationDetailLength = content.length; var biddinglistInformationData = template('biddinglistInformationData', module.data); $("#tabDetail4").html(biddinglistInformationData); - if (content.length>0){$("#nowMoney").html(content[0].money);} - - - + if (content.length>0){ + //console.log('abccba') + $("#nowMoneyBlock").html(''+content[0].money+' 元');} } } @@ -648,7 +691,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.biddinglistInformationNew = function (data) { if (data.code == 200) { var content = data.rows; - console.log(module.data.biddinglistInformationDetail.length+'----------------------'+content.length) + //console.log(module.data.biddinglistInformationDetail.length+'----------------------'+content.length) if (module.data.biddinglistInformationDetailLength 0) { module.data.outProjectInformationDetail.biddingStopTime = data.data; - module.dataCompare( - module.data.outProjectInformationDetail.signupStartTime, - module.data.outProjectInformationDetail.signupStopTime, - module.data.outProjectInformationDetail.biddingStartTime,data.data); + // module.dataCompare( + // module.data.outProjectInformationDetail.signupStartTime, + // module.data.outProjectInformationDetail.signupStopTime, + // module.data.outProjectInformationDetail.biddingStartTime,data.data); }else{ $('#countType').html('') $('#countDown').html('竞价结束') @@ -827,9 +870,9 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.data.biddingTimeType = 2; return; } + tools.initError('出价成功'); } },true); - tools.initError('出价成功'); // $('#money').val(0) } @@ -861,8 +904,8 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function module.projectTypeDictionaries = function (data) { if (data.code == 200 && module.data.outProjectInformationDetail.projectType!='') { var content = data.data; - console.log(content) - console.log((module.data.outProjectInformationDetail.projectType-1)) + //console.log(content) + //console.log((module.data.outProjectInformationDetail.projectType-1)) var projectType = content[(module.data.outProjectInformationDetail.projectType-1)].dictLabel; module.data.outProjectInformationDetail.projectType = projectType; var outProjectInformationData = template('outProjectInformationData', module.data); @@ -987,7 +1030,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function newMoney = module.data.outProjectInformationDetail.price; } - console.log(newMoney); + //console.log(newMoney); var data = {}; var projectId = getQueryVariable('id'); var memberId = tools.getCookie('memberId'); @@ -1039,7 +1082,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function $('#money').val() == null||$('#money').val() == ''?$('#money').val(0):''; - console.log($('#money').val()) + //console.log($('#money').val()) module.data.outProjectInformationDetail.ladderPrice?$('#money').val((parseFloat($('#money').val())+parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)):document.getElementById('money').value += 1 diff --git a/static/js/project/user/index.js b/static/js/project/user/index.js index 5e43cf7..62490be 100644 --- a/static/js/project/user/index.js +++ b/static/js/project/user/index.js @@ -46,7 +46,7 @@ define(['jquery', "template", "Tools", "user", "paging","cupload","kindeditor", var tools = new Tools(); module.init = function (page) { //获取焦点图信息 - //tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true); + tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true); //底部友情链接 tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true); //用户资料 @@ -669,18 +669,18 @@ define(['jquery', "template", "Tools", "user", "paging","cupload","kindeditor", }) $('#page_s4').html('共' + pageCount + '页') } - // content.forEach((res,index)=>{ - // res.depositStatus = module.data.depositStatusOption.filter(function (e) { return e.dictValue == res.depositStatus; })[0].dictLabel; - // - // setInterval(()=>{ - // res.endTime = new Date(res.biddingStopTime) - new Date(); - // if (res.endTime <= 0){ - // document.getElementById('endTime'+res.id).innerHTML = '已结束' - // return; - // } - // document.getElementById('endTime'+res.id).innerHTML = TimeInterval(res.endTime) - // },1000) - // }) + content.forEach((res,index)=>{ + res.depositStatus = module.data.depositStatusOption.filter(function (e) { return e.dictValue == res.depositStatus; })[0].dictLabel; + + // setInterval(()=>{ + // res.endTime = new Date(res.biddingStopTime) - new Date(); + // if (res.endTime <= 0){ + // document.getElementById('endTime'+res.id).innerHTML = '已结束' + // return; + // } + // document.getElementById('endTime'+res.id).innerHTML = TimeInterval(res.endTime) + // },1000) + }) module.data.applicationInformationList = content; var applicationInformationData = template('applicationInformationData', module.data);