diff --git a/src/api/user/index.js b/src/api/user/index.js index 3dff3c87..bb29a01f 100644 --- a/src/api/user/index.js +++ b/src/api/user/index.js @@ -166,6 +166,15 @@ export function biddinglist(query){ }) } +//我的竞价 +export function userBiddingList(query){ + return request({ + url: '/transaction/website/biddinglist/projectId', + method: 'get', + params: query + }) +} + //查询开户行 export function realtimeList(query){ return request({ diff --git a/src/views/project/projectDetail.vue b/src/views/project/projectDetail.vue index 573dbec0..835ac55f 100644 --- a/src/views/project/projectDetail.vue +++ b/src/views/project/projectDetail.vue @@ -71,7 +71,7 @@ 竞价方向:{{ detail.biddingDirect }} - 阶梯价(增减幅度):¥{{ detail.ladderPrice }} 元 + 阶梯价(增减幅度):¥{{ detail.ladderPrice }} 延时周期:{{timeConfig}}分钟 @@ -388,6 +388,9 @@ export default { this.getDicts("bidding_direct").then(res => { this.detail.biddingDirect = this.selectDictLabel(res.data,response.data.biddingDirect); }); + this.getDicts("price_unit").then(res => { + this.detail.unit = this.selectDictLabel(res.data,response.data.unit); + }); for(let i of this.detail.subjectList){ this.getDicts("area_unit").then(res => { i.areaUnit = this.selectDictLabel(res.data,i.areaUnit); @@ -399,13 +402,15 @@ export default { that.biddinglistInformation = response.rows that.biddinglistInformationLength = response.total if (response.rows.length>0&&that.detail.ladderPrice){ - console.log(that.detail.biddingDirect) if (that.price == 0){return;} if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') { that.price = response.rows[0].money - that.detail.ladderPrice }else{ that.price = response.rows[0].money + that.detail.ladderPrice } + }else if (response.rows.length>0&&!that.detail.ladderPrice){ + if (that.price == 0){return;} + that.price = response.rows[0].money }else{ if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') { that.price = that.detail.price - that.detail.ladderPrice @@ -596,24 +601,51 @@ export default { }else{ newMoney = this.detail.price; } - }); - if (this.price==''||this.price==0||this.price<0||this.price == null){ - this.$toast({ - icon: 'fail', // 找到自己需要的图标 - message: '请输入出价金额', - duration:"1000", - onClose:function(){ - } - }) - return; - } - if (this.detail.biddingDirect == '反向竞价'){ - // if (this.biddinglistInformation.length<1){ - if(this.detail.price1){ + //判断用户出价不能高于当前出价最低价格 + if(newMoney <= this.price){ + this.$toast({ + icon: 'fail', // 找到自己需要的图标 + message: '出价不能高于当前出价最低价格', + duration:"1000", + onClose:function(){ + } + }) + return; + } + } + } + } + + }else{ + if(this.detail.price>this.price){ this.$toast({ icon: 'fail', // 找到自己需要的图标 - message: '出价不能高于挂牌价格', + message: '出价不能低于挂牌价格', duration:"1000", onClose:function(){ } @@ -623,10 +655,12 @@ export default { if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){ if (this.biddinglistInformation.length>1){ //判断用户出价不能高于当前出价最低价格 - if(newMoney <= this.price){ + console.log(newMoney) + console.log(this.price) + if(newMoney >= this.price){ this.$toast({ icon: 'fail', // 找到自己需要的图标 - message: '出价不能高于当前出价最低价格', + message: '出价不能低于当前出价最高价格', duration:"1000", onClose:function(){ } @@ -636,64 +670,37 @@ export default { } } } - - }else{ - if(this.detail.price>this.price){ - this.$toast({ - icon: 'fail', // 找到自己需要的图标 - message: '出价不能低于挂牌价格', - duration:"1000", - onClose:function(){ - } - }) - return; - }else{ - if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){ - if (this.biddinglistInformation.length>1){ - //判断用户出价不能高于当前出价最低价格 - if(newMoney >= this.price){ - this.$toast({ - icon: 'fail', // 找到自己需要的图标 - message: '出价不能低于当前出价最高价格', - duration:"1000", - onClose:function(){ - } - }) - return; - } - } - } } - } - let data= { - projectId:this.id, - memberId:this.memberId, - userId:this.userId, - userAccount:this.userAccount, - userName:this.userName, - money:parseFloat(this.price), - }; - console.log(data) - biddingSubmit(data).then(response =>{ - let _this = this - if(response){ - this.$toast({ - icon: 'success', // 找到自己需要的图标 - message: '出价成功', - duration:"1000", - onClose:function(){ - _this.reload() - _this.price = _this.price-_this.detail.ladderPrice; - } - }) + let data= { + projectId:this.id, + memberId:this.memberId, + userId:this.userId, + userAccount:this.userAccount, + userName:this.userName, + money:parseFloat(this.price), + }; + console.log(data) + biddingSubmit(data).then(response =>{ + let _this = this + if(response){ + this.$toast({ + icon: 'success', // 找到自己需要的图标 + message: '出价成功', + duration:"1000", + onClose:function(){ + _this.reload() + _this.price = _this.price-_this.detail.ladderPrice; + } + }) - } - }) + } + }) + }); }, add(){ if (this.detail.biddingDirect == '反向竞价'){ if (this.biddinglistInformation.length<1){ - if(this.detail.price < this.price){ + if(this.detail.price <= this.price){ this.$toast({ icon: 'fail', // 找到自己需要的图标 message: '出价不能高于挂牌价格', @@ -748,7 +755,7 @@ export default { sub(){ if (this.detail.biddingDirect == '反向竞价'){ if (this.biddinglistInformation.length<1){ - if(this.detail.price<=this.price){ + if(this.detail.price + - - - {{item.projectName}} - - - - - 当前价格 - {{item.money}}{{item.unit}} - 我的出价 - {{item.memberMoney}}{{item.unit}} - - - 距竞价结束 - - - - - - - + + + + {{item.projectName}} + {{item.projectShowStatus}} + + + + + 距结束 + + {{timeData.days}}天 + {{timeData.hours}}时 + {{timeData.minutes}}分 + {{timeData.seconds}}秒 + + + + + + + 当前价格 + + * + + + + {{item.money}}{{item.unit}} + + + + 暂无出价 + + + + + + 我的出价 + + {{item.memberMoney}}{{item.unit}} + + + 出价记录 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{item.projectName}}
{{item.projectShowStatus}}
+ 当前价格 + + * + + + + {{item.money}}{{item.unit}} + + + + 暂无出价 + +
+ 我的出价 + + {{item.memberMoney}}{{item.unit}} + +
出价记录