From 1a3f286fb0145d0111c9f0cc9a7d43d1be20324d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E4=B8=9C=E6=97=AD?= <850374051@qq.com> Date: Thu, 7 Dec 2023 08:48:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E6=9D=83=E4=BA=A4=E6=98=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/biddingHall/index.vue | 1 + src/views/project/projectDetail.vue | 105 +++++++++++++++------------- 2 files changed, 58 insertions(+), 48 deletions(-) diff --git a/src/views/biddingHall/index.vue b/src/views/biddingHall/index.vue index 0db45b4c..34d3d4a0 100644 --- a/src/views/biddingHall/index.vue +++ b/src/views/biddingHall/index.vue @@ -259,6 +259,7 @@ export default { getList(){ this.queryParams.deptId = this.activeId; this.queryParams.projectNumber = this.value1; + this.queryParams.projectShowStatus = this.value3; getBiddingList(this.queryParams).then(response =>{ response.rows.map(item => { if(item.biddingStopTime != null || item.biddingStartTime != null){ diff --git a/src/views/project/projectDetail.vue b/src/views/project/projectDetail.vue index d7eec38f..8320260f 100644 --- a/src/views/project/projectDetail.vue +++ b/src/views/project/projectDetail.vue @@ -491,14 +491,69 @@ export default { this.bottomBtn = true; let biddingStartTime = Date.parse(this.detail.biddingStartTime)+0 let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0 + let biddingStopSetime = Date.parse(this.detail.biddingStopSetime)+0 let signupStartTime = Date.parse(this.detail.signupStartTime)+0 let signupStopTime = Date.parse(this.detail.signupStopTime)+0 + let nowDate = Date.parse(this.format($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss")); let time = this.detail.delayPeriod * 1000; - var difference = biddingStopTime-nowDate; + var difference = biddingStopTime-nowDate;//延时后时间差 + var differenceSetime = biddingStopSetime-nowDate;//延时后时间差 + let m = Math.floor(difference/1000/60%60); let s = Math.floor(difference/1000%60); + + if (differenceSetime <= 0 && difference >= 0 && difference <=time){ + console.log("竞价剩余两分钟"+"m:"+m+"s:"+s) + this.biddingTimeType = 1; + this.process= "竞价中" + this.tip=this.detail.biddingStopTime+"结束竞价" + this.timeMsg="距竞价结束" + if(this.getSignupData=="1"){ + this.isSignup=true + this.btnMsg="立即竞价" + this.showBtn=true + // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1 + }else{ + this.btnMsg="未报名" + this.isSignup=true + } + $('#timeData').html(this.TimeInterval(biddingStopTime-nowDate)); + + if (s < 2 && m < 1){ + console.log("竞价结束22222222222") + getBiddingStopTime(this.id).then(response => { + this.$set(this.detail,'biddingStopTime',response.data) + let timeNew = Date.parse(response.data) + 0 - nowDate; + if (timeNew > 0) { + this.$set(this.detail,'biddingStopTime',response.data) + this.getTime(); + } else { + clearInterval(this.timeCount); + this.process = "竞价结束" + this.tip = this.detail.biddingStopTime + "结束竞价" + this.btnMsg = "竞价结束" + this.timeMsg = "竞价结束" + this.time = 0 + this.isSignup = true + this.showBtn = false + this.biddingTimeType = 2; + $('#timeData').html(''); + return; + } + }); + }else if (s%2 == 0&&time!=0){ + getBiddingStopTime(this.id).then(response =>{ + this.$set(this.detail,'biddingStopTime',response.data); + }); + } + }else{ + this.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopSetime) + } + }, + dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime){ + let nowDate = Date.parse(this.format($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss")); if(signupStartTime>nowDate){ //console.log('未开始') this.process= "报名未开始" @@ -560,8 +615,6 @@ export default { this.btnMsg="未报名" this.isSignup=true } - - } if(nowDate>biddingStopTime){ //console.log('竞价结束') @@ -577,52 +630,8 @@ export default { $('#timeData').html(''); // this.timeData = '' } - - // console.log(s+'---------------'+m) - if (s < 1 && m < 1){ - console.log("竞价结束22222222222") - getBiddingStopTime(this.id).then(response => { - this.$set(this.detail,'biddingStopTime',response.data) - let timeNew = Date.parse(response.data) + 0 - nowDate; - if (timeNew > 0) { - this.$set(this.detail,'biddingStopTime',response.data) - this.getTime(); - } else { - clearInterval(this.timeCount); - this.process = "竞价结束" - this.tip = this.detail.biddingStopTime + "结束竞价" - this.btnMsg = "竞价结束" - this.timeMsg = "竞价结束" - this.time = 0 - this.isSignup = true - this.showBtn = false - this.biddingTimeType = 2; - $('#timeData').html(''); - return; - } - }); - }else if (s%2 == 0&&time!=0){ - - //console.log('aaa') - // console.log((biddingStopTime-nowDate)) - // console.log(time) - // this.getTime(); - if ((biddingStopTime-nowDate)<=time){ - // console.log("竞价剩余两分钟"+"m:"+m+"s:"+s) - getBiddingStopTime(this.id).then(response =>{ - if(this.detail.biddingStopTime!=response.data){ - console.log('有人出价') - this.time = null; - } - // this.detail.biddingStopTime = response.data - this.$set(this.detail,'biddingStopTime',response.data); - // this.delayPeriodNow = true; - // this.time = Date.parse(response.data)+0-nowDate; - }); - } - } - }, + getBidding(){ var that = this; getBiddingList(that.biddingquery).then(response =>{