Commit e806c1dd by yancanhua Committed by 章家宝

fix:轮询出价pc端功能开发

1 parent b2c4fe3c
<template>
<div class="modalPage">
<div v-if="auctionVehicle.auctionMode == 2 && auctionState == 'AUCTIONING'" class="timeBox">
<div class="timeBox_title">距结束还剩</div>
<div class="timeBox_time">52</div>
<div class="timeBox_time">{{ timeData.hour }}</div>
<div class="timeBox_colon">:</div>
<div class="timeBox_time">02</div>
<div class="timeBox_time">{{ timeData.minute }}</div>
<div class="timeBox_colon">:</div>
<div class="timeBox_time">01</div>
<div class="timeBox_time">{{ timeData.second }}</div>
</div>
<vehicle-info-header :vehicle="vehicle"></vehicle-info-header>
......@@ -60,12 +59,15 @@ export default class ViewAuctionVehicle extends Vue {
@Prop({ type: Object, required: true })
auctionVehicle: AuctionVehicle;
auctionState = '';
timeData = {
hour: '00',
minute: '00',
second: '00'
};
bidPrice = '100';
operationButList = [{
value: '100',
}, {
......@@ -93,15 +95,28 @@ export default class ViewAuctionVehicle extends Vue {
getBidRemainSecData(): void {
const that = this;
console.log('that.auctionVehicle.aucvehId11111111111111111111111111111111111111111', that.auctionVehicle);
AuctionController.getBidRemainSec(that.axios, { aucvehId: that.auctionVehicle.aucvehId }).then(response => {
console.log('1111111111111111', response)
const data = response.data || {};
const itemData = data.data || {};
this.auctionState = itemData.auctionState || '';
that.auctionState = itemData.auctionState || '';
that.formatTime(600);
if (that.auctionVehicle.auctionMode == 2 && itemData.auctionState == 'AUCTIONING' && itemData.remainSecond) {
setTimeout(() => {
that.getBidRemainSecData();
}, 1000);
}
});
}
formatTime(remainSec: number): string {
const hour = Math.floor(remainSec / 60 / 60);
const minute = Math.floor(remainSec / 60 % 60);
const second = Math.floor(remainSec % 60);
this.timeData.hour = hour < 10 ? '0' + hour : hour;
this.timeData.minute = minute < 10 ? '0' + minute : minute;
this.timeData.second = second < 10 ? '0' + second : second;
}
handleAddBid(): void {
const that = this;
if (!that.bidPrice) {
......
......@@ -15,7 +15,10 @@
</template>
<template v-if="column.key === 'accountType'">
<account-type-tag :account-type="record.account.accountType"></account-type-tag>
<div class="tag0" v-if="record.bidType === 0 " >个人用户</div>
<div class="tag1" v-if="record.bidType === 1 ">系统出价</div>
<div class="tag2" v-if="record.bidType === 2 ">车商用户</div>
<!-- <account-type-tag :account-type="record.account.accountType"></account-type-tag> -->
</template>
</template>
<!--投标竞价列表end-->
......@@ -93,5 +96,42 @@ export default class BidPage extends PaginationComponent<Bid> {
</script>
<style scoped lang="less">
.tag0 {
width: 64px;
height: 24px;
border-radius: 3px;
background: #fcf4e1;
color: #f0a700;
font-size: 12px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: 24px;
}
.tag1 {
width: 64px;
height: 24px;
border-radius: 3px;
background: #e7f2fe;
color: #288bfa;
font-size: 12px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: 24px;
}
.tag2 {
width: 64px;
height: 24px;
border-radius: 3px;
background: #e8f8f2;
color: #00ad74;
font-size: 12px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: 24px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!