@@ -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){ | export function realtimeList(query){ | ||||
return request({ | return request({ | ||||
@@ -71,7 +71,7 @@ | |||||
<van-col span="24"><span>竞价方向:</span>{{ detail.biddingDirect }}</van-col> | <van-col span="24"><span>竞价方向:</span>{{ detail.biddingDirect }}</van-col> | ||||
</van-row> | </van-row> | ||||
<van-row v-if="detail.ladderPrice"> | <van-row v-if="detail.ladderPrice"> | ||||
<van-col span="24"><span>阶梯价(增减幅度):</span>¥{{ detail.ladderPrice }} 元</van-col> | |||||
<van-col span="24"><span>阶梯价(增减幅度):</span>¥{{ detail.ladderPrice }}</van-col> | |||||
</van-row> | </van-row> | ||||
<van-row> | <van-row> | ||||
<van-col span="24"><span>延时周期:</span>{{timeConfig}}分钟</van-col> | <van-col span="24"><span>延时周期:</span>{{timeConfig}}分钟</van-col> | ||||
@@ -388,6 +388,9 @@ export default { | |||||
this.getDicts("bidding_direct").then(res => { | this.getDicts("bidding_direct").then(res => { | ||||
this.detail.biddingDirect = this.selectDictLabel(res.data,response.data.biddingDirect); | 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){ | for(let i of this.detail.subjectList){ | ||||
this.getDicts("area_unit").then(res => { | this.getDicts("area_unit").then(res => { | ||||
i.areaUnit = this.selectDictLabel(res.data,i.areaUnit); | i.areaUnit = this.selectDictLabel(res.data,i.areaUnit); | ||||
@@ -399,13 +402,15 @@ export default { | |||||
that.biddinglistInformation = response.rows | that.biddinglistInformation = response.rows | ||||
that.biddinglistInformationLength = response.total | that.biddinglistInformationLength = response.total | ||||
if (response.rows.length>0&&that.detail.ladderPrice){ | if (response.rows.length>0&&that.detail.ladderPrice){ | ||||
console.log(that.detail.biddingDirect) | |||||
if (that.price == 0){return;} | if (that.price == 0){return;} | ||||
if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') { | if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') { | ||||
that.price = response.rows[0].money - that.detail.ladderPrice | that.price = response.rows[0].money - that.detail.ladderPrice | ||||
}else{ | }else{ | ||||
that.price = response.rows[0].money + that.detail.ladderPrice | 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{ | }else{ | ||||
if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') { | if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') { | ||||
that.price = that.detail.price - that.detail.ladderPrice | that.price = that.detail.price - that.detail.ladderPrice | ||||
@@ -596,24 +601,51 @@ export default { | |||||
}else{ | }else{ | ||||
newMoney = this.detail.price; | 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.price<this.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.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; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}else{ | |||||
if(this.detail.price>this.price){ | |||||
this.$toast({ | this.$toast({ | ||||
icon: 'fail', // 找到自己需要的图标 | icon: 'fail', // 找到自己需要的图标 | ||||
message: '出价不能高于挂牌价格', | |||||
message: '出价不能低于挂牌价格', | |||||
duration:"1000", | duration:"1000", | ||||
onClose:function(){ | onClose:function(){ | ||||
} | } | ||||
@@ -623,10 +655,12 @@ export default { | |||||
if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){ | if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){ | ||||
if (this.biddinglistInformation.length>1){ | if (this.biddinglistInformation.length>1){ | ||||
//判断用户出价不能高于当前出价最低价格 | //判断用户出价不能高于当前出价最低价格 | ||||
if(newMoney <= this.price){ | |||||
console.log(newMoney) | |||||
console.log(this.price) | |||||
if(newMoney >= this.price){ | |||||
this.$toast({ | this.$toast({ | ||||
icon: 'fail', // 找到自己需要的图标 | icon: 'fail', // 找到自己需要的图标 | ||||
message: '出价不能高于当前出价最低价格', | |||||
message: '出价不能低于当前出价最高价格', | |||||
duration:"1000", | duration:"1000", | ||||
onClose:function(){ | 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(){ | add(){ | ||||
if (this.detail.biddingDirect == '反向竞价'){ | if (this.detail.biddingDirect == '反向竞价'){ | ||||
if (this.biddinglistInformation.length<1){ | if (this.biddinglistInformation.length<1){ | ||||
if(this.detail.price < this.price){ | |||||
if(this.detail.price <= this.price){ | |||||
this.$toast({ | this.$toast({ | ||||
icon: 'fail', // 找到自己需要的图标 | icon: 'fail', // 找到自己需要的图标 | ||||
message: '出价不能高于挂牌价格', | message: '出价不能高于挂牌价格', | ||||
@@ -748,7 +755,7 @@ export default { | |||||
sub(){ | sub(){ | ||||
if (this.detail.biddingDirect == '反向竞价'){ | if (this.detail.biddingDirect == '反向竞价'){ | ||||
if (this.biddinglistInformation.length<1){ | if (this.biddinglistInformation.length<1){ | ||||
if(this.detail.price<=this.price){ | |||||
if(this.detail.price<this.price){ | |||||
this.$toast({ | this.$toast({ | ||||
icon: 'fail', // 找到自己需要的图标 | icon: 'fail', // 找到自己需要的图标 | ||||
message: '出价不能高于挂牌价格', | message: '出价不能高于挂牌价格', | ||||
@@ -7,40 +7,131 @@ | |||||
placeholder | placeholder | ||||
@click-left="onClickLeft" | @click-left="onClickLeft" | ||||
/> | /> | ||||
<van-list | <van-list | ||||
v-model="loading" | v-model="loading" | ||||
:finished="finished" | :finished="finished" | ||||
finished-text="没有更多了" | finished-text="没有更多了" | ||||
@load="getList" | @load="getList" | ||||
class="biddingList" | |||||
> | > | ||||
<van-cell v-for="(item , index) in biddinglist" :key="index" :to="{name:'projectDetail', query: {id:item.id}}"> | |||||
<van-row> | |||||
<van-col span="24" style="font-size: 0.4rem;margin-bottom: 0.1rem;">{{item.projectName}}</van-col> | |||||
</van-row> | |||||
<van-row> | |||||
<van-col span="24"> | |||||
<van-row class="row"> | |||||
<van-col span="4" style="font-size: 0.2rem;">当前价格</van-col> | |||||
<van-col span="8" class="col"><span>{{item.money}}</span>{{item.unit}}</van-col> | |||||
<van-col span="4" style="font-size: 0.2rem;">我的出价</van-col> | |||||
<van-col span="8" class="col"><span>{{item.memberMoney}}</span>{{item.unit}}</van-col> | |||||
</van-row> | |||||
<van-row class="row"> | |||||
<van-col span="5" style="font-size: 0.2rem;">距竞价结束</van-col> | |||||
<van-col span="19" class="col"> | |||||
<van-count-down :time="item.biddingStopTime" format="DD天HH时mm分ss秒" style="font-size: 0.2rem;color: #C21F3A;margin-top: 3px;" /> | |||||
</van-col> | |||||
</van-row> | |||||
</van-col> | |||||
</van-row> | |||||
</van-cell> | |||||
<div class="list_li" v-for="(item,index) in biddinglist" :key="index" :to="{name:'projectDetail', query: {id:item.id}}"> | |||||
<div class="list_li_tt"> | |||||
<p>{{item.projectName}}</p> | |||||
<p :style="{ | |||||
color: { | |||||
'未开始': '#007E72', | |||||
'已结束': '#848484', | |||||
'竞价中': '#c21F3a', | |||||
}[item.projectShowStatus]}">{{item.projectShowStatus}}</p> | |||||
</div> | |||||
<div class="list_li_time"> | |||||
<van-count-down :time="item.biddingStopTime"> | |||||
<template #default="timeData"> | |||||
<span style="color: #848484;font-size: 14PX;">距结束</span> | |||||
<span :style="{'font-size':'14px', | |||||
color: { | |||||
'未开始': '#007E72', | |||||
'已结束': '#848484', | |||||
'竞价中': '#c21F3a', | |||||
}[item.projectShowStatus]}"> | |||||
<span style="font-size: 18PX;">{{timeData.days}}</span>天 | |||||
<span style="font-size: 18PX;">{{timeData.hours}}</span>时 | |||||
<span style="font-size: 18PX;">{{timeData.minutes}}</span>分 | |||||
<span style="font-size: 18PX;">{{timeData.seconds}}</span>秒 | |||||
</span> | |||||
</template> | |||||
</van-count-down> | |||||
</div> | |||||
<div class="list_li_time"> | |||||
<p> | |||||
<span style="color: #848484">当前价格</span> | |||||
<span :style="{'font-size':'14px', | |||||
color: { | |||||
'未开始': '#007E72', | |||||
'已结束': '#848484', | |||||
'竞价中': '#c21F3a', | |||||
}[item.projectShowStatus]}" v-if="item.biddingType=='自由竞价'&&item.deadline>0"> | |||||
* | |||||
</span> | |||||
<span :style="{'font-size':'14px', | |||||
color: { | |||||
'未开始': '#007E72', | |||||
'已结束': '#848484', | |||||
'竞价中': '#c21F3a', | |||||
}[item.projectShowStatus]}" v-if="item.biddingType!='自由竞价'&&item.money"> | |||||
{{item.money}}{{item.unit}} | |||||
</span> | |||||
<span :style="{'font-size':'14px', | |||||
color: { | |||||
'未开始': '#007E72', | |||||
'已结束': '#848484', | |||||
'竞价中': '#c21F3a', | |||||
}[item.projectShowStatus]}" v-if="item.biddingType!='自由竞价'&&!item.money"> | |||||
暂无出价 | |||||
</span> | |||||
</p> | |||||
</div> | |||||
<div class="list_li_time"> | |||||
<p> | |||||
<span style="color: #848484">我的出价</span> | |||||
<span :style="{'font-size':'14px', | |||||
color: { | |||||
'未开始': '#007E72', | |||||
'已结束': '#848484', | |||||
'竞价中': '#c21F3a', | |||||
}[item.projectShowStatus]}" v-if="item.biddingType!='自由竞价'&&item.money"> | |||||
{{item.memberMoney}}{{item.unit}} | |||||
</span> | |||||
</p> | |||||
<p class="showList" @click="showList(item.id)">出价记录</p> | |||||
</div> | |||||
</div> | |||||
</van-list> | </van-list> | ||||
<van-dialog v-model="show" title="出价记录"> | |||||
<div style="height: 50vh;overflow-y: scroll;padding: 0 5PX;"> | |||||
<van-cell title="出价金额" value="出价时间" /> | |||||
<van-cell v-for="(item,index) in userBiddingList" :key="index" :title="item.money" :value="item.loginTime" /> | |||||
</div> | |||||
</van-dialog> | |||||
<!-- <van-list--> | |||||
<!-- v-model="loading"--> | |||||
<!-- :finished="finished"--> | |||||
<!-- finished-text="没有更多了"--> | |||||
<!-- @load="getList"--> | |||||
<!-- class="biddingList"--> | |||||
<!-- >--> | |||||
<!-- <van-cell v-for="(item , index) in biddinglist" :key="index" :to="{name:'projectDetail', query: {id:item.id}}">--> | |||||
<!-- <van-row>--> | |||||
<!-- <van-col span="24" style="font-size: 0.4rem;margin-bottom: 0.1rem;">{{item.projectName}}</van-col>--> | |||||
<!-- </van-row>--> | |||||
<!-- <van-row>--> | |||||
<!-- <van-col span="24">--> | |||||
<!-- <van-row class="row">--> | |||||
<!-- <van-col span="4" style="font-size: 0.2rem;">当前价格</van-col>--> | |||||
<!-- <van-col span="8" class="col"><span>{{item.money}}</span>{{item.unit}}</van-col>--> | |||||
<!-- <van-col span="4" style="font-size: 0.2rem;">我的出价</van-col>--> | |||||
<!-- <van-col span="8" class="col"><span>{{item.memberMoney}}</span>{{item.unit}}</van-col>--> | |||||
<!-- </van-row>--> | |||||
<!-- <van-row class="row">--> | |||||
<!-- <van-col span="5" style="font-size: 0.2rem;">距竞价结束</van-col>--> | |||||
<!-- <van-col span="19" class="col">--> | |||||
<!-- <van-count-down :time="item.biddingStopTime" format="DD天HH时mm分ss秒" style="font-size: 0.2rem;color: #C21F3A;margin-top: 3px;" />--> | |||||
<!-- </van-col>--> | |||||
<!-- </van-row>--> | |||||
<!-- </van-col>--> | |||||
<!-- </van-row>--> | |||||
<!-- </van-cell>--> | |||||
<!-- </van-list>--> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { getMember , biddinglist } from "@/api/user/index"; | |||||
import { getMember , biddinglist,userBiddingList } from "@/api/user/index"; | |||||
import { getInfo } from "@/api/login/index"; | import { getInfo } from "@/api/login/index"; | ||||
export default { | export default { | ||||
name: "userBidding", | name: "userBidding", | ||||
@@ -49,11 +140,13 @@ export default { | |||||
loading: false, | loading: false, | ||||
finished: false, | finished: false, | ||||
biddinglist:[], | biddinglist:[], | ||||
userBiddingList:[], | |||||
queryParams:{ | queryParams:{ | ||||
memberId:'', | memberId:'', | ||||
pageNum:1, | pageNum:1, | ||||
pageSize:10 | pageSize:10 | ||||
} | |||||
}, | |||||
show:false | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
@@ -90,13 +183,19 @@ export default { | |||||
this.loading = false; | this.loading = false; | ||||
}); | }); | ||||
}, | }, | ||||
showList(id){ | |||||
this.show = true; | |||||
userBiddingList({projectId:id,memberId:this.queryParams.memberId}).then(response => { | |||||
this.userBiddingList = response.rows; | |||||
}); | |||||
} | |||||
}, | }, | ||||
}; | }; | ||||
</script> | </script> | ||||
<style scoped lang="scss"> | <style scoped lang="scss"> | ||||
.app-container { | .app-container { | ||||
background-color: #FFF; | |||||
/*background-color: #FFF;*/ | |||||
} | } | ||||
.biddingList{ | .biddingList{ | ||||
padding: 0 2%; | padding: 0 2%; | ||||
@@ -111,4 +210,51 @@ export default { | |||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
} | } | ||||
.list_li{ | |||||
width: 94%; | |||||
background: #ffffff; | |||||
border-radius: 8PX; | |||||
margin: 10PX auto 0; | |||||
padding: 3vw 5%; | |||||
.list_li_tt{ | |||||
display: flex; | |||||
justify-content: space-between; | |||||
padding-bottom: 10PX; | |||||
border-bottom: 1PX solid rgb(239,239,239); | |||||
align-items: center; | |||||
p{ | |||||
line-height: 22PX; | |||||
&:nth-child(1){ | |||||
color: #333333; | |||||
font-weight: bold; | |||||
font-size: 16PX; | |||||
display: -webkit-box; | |||||
-webkit-box-orient: vertical; | |||||
-webkit-line-clamp: 1; | |||||
word-break: break-all; | |||||
overflow: hidden; | |||||
} | |||||
&:nth-child(2){ | |||||
flex-shrink: 0; | |||||
margin-left: 15PX; | |||||
} | |||||
} | |||||
} | |||||
.list_li_time{ | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: space-between; | |||||
margin-top: 10PX; | |||||
} | |||||
} | |||||
.showList{ | |||||
background: #007E72; | |||||
color: #ffffff; | |||||
padding: 5PX 10PX; | |||||
border-radius: 20PX; | |||||
} | |||||
/deep/ .van-cell__title{flex: 0.8} | |||||
/deep/ .van-cell__value{flex: 1.2} | |||||
</style> | </style> |