Commit b2c4fe3c by yancanhua Committed by 章家宝

fix: 轮询出价pc端开发

1 parent b7808dae
......@@ -211,6 +211,13 @@ export class AuctionController {
return axios.post('vehicle/autoBid', pagination);
}
static addBid(axios: AxiosStatic, pagination: Pagination<Auction>): Promise<AxiosResponse<Page<AuctionControl>>> {
return axios.post('bid/addBid', pagination);
}
static getBidRemainSec(axios: AxiosStatic, pagination: Pagination<Auction>): Promise<AxiosResponse<Page<AuctionControl>>> {
return axios.post('auction/getBidRemainSec', pagination);
}
// region 前端扩展代码区
// endregion
......
......@@ -78,6 +78,11 @@
</a-input-number>
</a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="车辆持续时间" name="aucvehDuration"
:rules="[{ required: true, message: '请输入车辆持续时间!' }]">
<a-input-number v-model:value="formState.aucvehDuration" :min="1" :max="99999" :maxlength="5" style="width: 100%" addon-after="秒" placeholder="请输入车辆持续时间"></a-input-number>
</a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="分段延时规则" name="resetDelayDuration" :rules="[{ required: true, message: '请输入分段延时规则!' }]">
<span style="line-height: 32px;">在倒计时剩余 </span>
<a-input-number v-model:value="formState.resetDelayDuration" :min="1" :max="formState.resetDelay-1"
......@@ -318,6 +323,7 @@ export default class AuctionForm extends FormComponent<Auction> {
this.formState.nearReservePriceThreshold = '1000';
this.formState.resetDelay = '10';
this.formState.resetDelayDuration = '10';
this.formState.aucvehDuration = '10';
this.resetDelayUnit = 'second';
this.resetDelayDurationUnit = 'second';
......@@ -342,6 +348,7 @@ export default class AuctionForm extends FormComponent<Auction> {
nearReservePriceThreshold: extraJson.nearReservePriceThreshold || '1000',
resetDelay: extraJson.resetDelay || '10',
resetDelayDuration: extraJson.resetDelayDuration || '10',
aucvehDuration: extraJson.aucvehDuration || '10',
resetDelayUnit: extraJson.resetDelayUnit || 'second',
resetDelayDurationUnit: extraJson.resetDelayDurationUnit || 'second',
});
......@@ -585,6 +592,7 @@ export default class AuctionForm extends FormComponent<Auction> {
nearReservePriceThreshold: String(formValue.nearReservePriceThreshold || 0),
resetDelay: String(formValue.resetDelay || 0),
resetDelayDuration: String(formValue.resetDelayDuration || 0),
aucvehDuration: String(formValue.aucvehDuration || 0),
resetDelayUnit: this.resetDelayUnit || 'second',
resetDelayDurationUnit: this.resetDelayDurationUnit || 'second',
};
......
<template>
<vehicle-info-header :vehicle="vehicle"></vehicle-info-header>
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="竞价记录">
<bid-page :aucveh-id="auctionVehicle.aucvehId"/>
</a-tab-pane>
<a-tab-pane key="2" tab="围观记录">
<vehicle-browser-history-page :aucveh-id="auctionVehicle.aucvehId"></vehicle-browser-history-page>
</a-tab-pane>
</a-tabs>
<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_colon">:</div>
<div class="timeBox_time">02</div>
<div class="timeBox_colon">:</div>
<div class="timeBox_time">01</div>
</div>
<vehicle-info-header :vehicle="vehicle"></vehicle-info-header>
<div v-if="auctionVehicle.auctionMode == 2 && auctionState == 'AUCTIONING'" class="bidBox">
<div class="bidBox_title">手动出价金额 <span class="color_eb2f2f">*</span></div>
<div class="bidBox_customt">
<a-input-number v-model:value="bidPrice" :min="100" :max="99999" :maxlength="5" style="width: 376px;"
addon-after="元" placeholder="请输入"></a-input-number>
<div v-for="(item, index) in operationButList" :key="index" @click="bidPrice = item.value"
class="listButton_item" :class="{ 'listButton_active': item.value == bidPrice }">
+{{ item.value }}
</div>
<a-button class="ml-16" style="height: 28px;" @click="handleAddBid()">确认出价</a-button>
</div>
</div>
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="竞价记录">
<bid-page :aucveh-id="auctionVehicle.aucvehId" />
</a-tab-pane>
<a-tab-pane key="2" tab="围观记录">
<vehicle-browser-history-page :aucveh-id="auctionVehicle.aucvehId"></vehicle-browser-history-page>
</a-tab-pane>
</a-tabs>
</div>
</template>
<script lang="ts">
import {Component, Prop, Vue} from "vue-facing-decorator";
import {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle";
import { Component, Prop, Vue } from "vue-facing-decorator";
import { AuctionVehicle } from "lib/src/entity/auction/entity/AuctionVehicle";
import BidPage from "@/views/auction/bid/BidPage.vue";
import VehicleStateTag from "@/views/vehicle/inventory/VehicleStateTag.vue";
import {Vehicle} from "lib/src/entity/vehicle/entity/Vehicle";
import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";
import VehicleBrowserHistoryPage from "@/views/auction/auction/vehicle/VehicleBrowserHistoryPage.vue";
import VehicleInfoHeader from "@/views/vehicle/inventory/VehicleInfoHeader.vue";
import { EditOutlined } from "@ant-design/icons-vue";
import { AuctionController } from "@/api/AuctionController";
import { message } from 'ant-design-vue';
@Component({
components: {VehicleInfoHeader, VehicleBrowserHistoryPage, VehicleStateTag, BidPage}
components: { VehicleInfoHeader, VehicleBrowserHistoryPage, VehicleStateTag, BidPage, EditOutlined }
})
export default class ViewAuctionVehicle extends Vue {
activeKey = "1";
@Prop({type: Object, required: true})
@Prop({ type: Object, required: true })
auctionVehicle: AuctionVehicle;
auctionState = '';
bidPrice = '100';
operationButList = [{
value: '100',
}, {
value: '300',
}, {
value: '500',
}, {
value: '1000',
}];
get vehicle(): Vehicle {
return this.auctionVehicle.vehicle;
}
......@@ -38,10 +86,116 @@ export default class ViewAuctionVehicle extends Vue {
// this.axios.get('auctionVehicle/getAuctionVehicleById', {params: {aucvehId: this.aucvehId}}).then(response => {
// this.auctionVehicle = response.data;
// });
setTimeout(() => {
this.getBidRemainSecData();
}, 1000);
}
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 || '';
});
}
handleAddBid(): void {
const that = this;
if (!that.bidPrice) {
message.error('请输入出价金额');
return;
}
AuctionController.addBid(that.axios, { aucvehId: that.auctionVehicle.aucvehId, bidPrice: that.bidPrice }).then(() => {
message.success('操作成功!');
});
}
}
</script>
<style scoped lang="ts">
<style lang="less" scoped>
.modalPage {
position: relative;
}
.timeBox {
height: 30px;
line-height: 30px;
position: absolute;
top: -46px;
left: 80px;
z-index: 99;
color: #eb2f2f;
font-size: 14px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
}
.timeBox_title {
float: left;
}
.timeBox_time {
width: 32px;
height: 30px;
border-radius: 5px;
background: #ffeded;
float: left;
margin-left: 6px;
text-align: center;
}
.timeBox_colon {
float: left;
margin-left: 6px;
}
.bidBox {
width: 100%;
margin-top: 20px;
}
.bidBox_title {
width: 100%;
height: 20px;
line-height: 20px;
color: #565d6b;
font-size: 14px;
font-weight: 400;
}
.color_eb2f2f {
color: #eb2f2f;
}
.bidBox_customt {
width: 100%;
height: 32px;
margin-top: 10px;
display: flex;
}
.listButton_item {
padding: 0 12px;
height: 28px;
float: left;
margin-left: 8px;
line-height: 28px;
border-radius: 4px;
background: #f0f2f5;
color: #2f3133;
font-size: 12px;
font-weight: 400;
text-align: center;
border: 1px solid #f0f2f5;
cursor: pointer;
}
.listButton_active {
border: 1px solid #185efe !important;
color: #185efe !important;
}
</style>
......@@ -39,6 +39,7 @@
</template>
<!--拍卖车辆列表end-->
</a-table>
<a-drawer v-model:open="showVehicle" title="车辆信息" placement="right" width="936">
<vehicle-drawer v-if="selectedAuctionVehicle" :vehicle="selectedAuctionVehicle?.vehicle"></vehicle-drawer>
</a-drawer>
......@@ -178,7 +179,7 @@ export default class AuctionVehiclePage extends PaginationComponent<AuctionVehic
const modal = ModalService.confirm({
title: '竞价数据', component: ViewAuctionVehicle, closable: true, appContext: this.$.appContext, width: 1300,
props: {
auctionVehicle: auctionVehicle
auctionVehicle: {...auctionVehicle,auctionMode:this.auction.auctionMode}
},
onOk: (component): void => {
modal.destroy();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!