Commit b6ac2787 by yancanhua Committed by 章家宝

fix: 轮询竞拍前端开发

1 parent 16e918ae
......@@ -63,23 +63,20 @@
<!-- <a-descriptions-item label="拍卖说明">{{ auction.remark }}</a-descriptions-item>-->
</a-descriptions>
<a-typography-text> 预计结束前 {{ auction.beforeEndMinute }}分钟,自动化延时{{ auction.delayMinute }}分钟</a-typography-text>
</div>
</a-space>
<div v-if="auction.auctionMode == '2'" class="auctionModeBox">
<div class="auctionModeBox-title">竞拍规则配置</div>
<div style="display: flex;" >
<div style="padding-left: 48px;line-height: 32px;" >明拍模式选择: <span style="color: #185EFE;">轮询出价模式</span></div>
<div style="padding-left: 48px;line-height: 32px;" >结来后自动跳转延迟: <span style="font-weight: 600;" >{{ returnExtraJsonData('delay') }} 秒</span></div>
<div style="padding-left: 48px;line-height: 32px;" >接近保留价提醒阈值: <span style="font-weight: 600;">{{ returnExtraJsonData('nearReservePriceThreshold') }} 元</span></div>
<div style="padding-left: 48px;line-height: 32px;" >系统&用户加价延时: <span style="font-weight: 600;">{{ returnExtraJsonData('resetDelay') }} 秒</span></div>
<div style="padding-left: 48px;line-height: 32px;" >倒计时在 <span style="font-weight: 600;">0-10秒</span> 之间时出价,倒计时才会重置 为{{ returnExtraJsonData('resetDelayDuration') }} 秒。</div>
</div>
</div>
<div v-if="auction.auctionMode == '2'" class="auctionModeBox">
<a-space :size="20" class="mt-8 mb-8 ml-16">
<a-statistic title="结束后自动跳转延时" :value="returnExtraJsonData('delay')+'秒'" :value-style="statisticStyle"/>
<a-statistic title="系统&用户加价延时" :value="returnExtraJsonData('resetDelay')+'秒'" :value-style="statisticStyle"/>
<a-statistic title="接近保留价提醒阈值" :value="'¥'+returnExtraJsonData('nearReservePriceThreshold') " :value-style="statisticStyle"/>
<a-statistic title="分段延时规则" :value="'倒计时剩余0-'+returnExtraJsonData('resetDelayDuration')+ '秒出价,倒计时重置为'+returnExtraJsonData('resetDelay')+'秒'" :value-style="statisticStyle"/>
</a-space>
</div>
</div>
</a-space>
</a-page-header>
</template>
<script lang="ts">
import {Component, Emit, Prop, Vue} from 'vue-facing-decorator';
......@@ -229,16 +226,10 @@ export default class AuctionBaseInfo extends Vue {
<style scoped lang="less">
.auctionModeBox {
width: 100%;
border: 1px solid #D9D9D9FF;
border-radius: 4px;
margin-top: 24px;
margin-top: 16px;
height: 68px;
border-radius: 6px;
background: #ffffff80;
}
.auctionModeBox-title {
width: 100%;
height: 32px;
line-height: 32px;
text-indent: 28px;
color: #185EFE;
}
</style>
......@@ -53,19 +53,19 @@
:field-names="{ label: 'realName', value: 'userId' }" placeholder="请选择拍卖管理员"></m-select>
</a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="结束后自动跳转延期" name="delay"
<a-form-item v-if="formState.auctionMode == '2'" label="结束后自动跳转延期" name="delay" tooltip="用户在小程序端完成认证/充值或一辆车拍卖结束后,触发自动跳转前的等待时间。"
:rules="[{ required: true, message: '请输入结束后自动跳转延期时间!' }]">
<a-input-number style="width: 100%" v-model:value="formState.delay" :min="0" :step="1"
:max="99999" :maxlength="5" addon-after="秒" placeholder="请输入结束后自动跳转延期时间" />
<a-input-number style="width: 100%" v-model:value="formState.delay" :min="1" :step="1"
:max="60" :maxlength="2" addon-after="秒" placeholder="请输入结束后自动跳转延期时间" />
</a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="接近保留价提醒阈值" name="nearReservePriceThreshold"
<a-form-item v-if="formState.auctionMode == '2'" label="接近保留价提醒阈值" tooltip="当车辆当前价达到(保留价-此阈值)时,小程序端将对用户展示‘’的标签。" name="nearReservePriceThreshold"
:rules="[{ required: true, message: '请输入接近保留价提醒阈值!' }]">
<a-input-number style="width: 100%" v-model:value="formState.nearReservePriceThreshold"
:min="0" :step="1" :max="99999" :maxlength="5" addon-after="元" placeholder="请输入接近保留价提醒阈值" />
:min="0" :step="100" :max="100000" :maxlength="5" addon-after="元" placeholder="请输入接近保留价提醒阈值" />
</a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="系统&用户加价重置延时" name="resetDelay"
<a-form-item v-if="formState.auctionMode == '2'" label="系统&用户加价重置延时" tooltip="在价格未达到保留价前,由系统自动加价或后台用户手动加价后,重置给下一位出价者的倒计时时长。该时长会受到下方的“分段延时规则”影响。" name="resetDelay"
:rules="[{ required: true, message: '请输入重置延时!' }]">
<a-input-number v-model:value="formState.resetDelay" :min="1" :max="99999" :maxlength="5"
style="width: 100%" addon-after="秒" placeholder="请输入重置延时">
......@@ -83,7 +83,12 @@
<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: '请输入分段延时规则!' }]">
<a-form-item v-if="formState.auctionMode == '2'" label="拍卖车辆间隔时间" name="bidAucVehDuration"
:rules="[{ required: true, message: '请输入拍卖车辆间隔时间!' }]">
<a-input-number v-model:value="formState.bidAucVehDuration" :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" tooltip="这是对“用户加价重置倒计时”的高级补充规则,用于在最后阶段制造紧张感。校验规则: 此处设置的时长必须为正整数,且不能超过“用户加价重置倒计时”的总时长。逻辑示例: 若“用户加价重置”为20秒,此处设为10秒。那么:倒计时在 10-30秒 之间时出价,倒计时不重置。倒计时在 0-10秒 之间时出价,倒计时才会重置为20秒。" :rules="[{ required: true, message: '请输入分段延时规则!' }]">
<span style="line-height: 32px;">在倒计时剩余 </span>
<a-input-number v-model:value="formState.resetDelayDuration" :min="1" :max="formState.resetDelay-1"
:maxlength="5" style="width: 48%" addon-after="秒" placeholder="请输入">
......@@ -325,6 +330,7 @@ export default class AuctionForm extends FormComponent<Auction> {
this.formState.nearReservePriceThreshold = '1000';
this.formState.resetDelay = '10';
this.formState.resetDelayDuration = '10';
this.formState.bidAucVehDuration = '5';
this.formState.aucvehDuration = '10';
this.resetDelayUnit = 'second';
this.resetDelayDurationUnit = 'second';
......@@ -351,6 +357,7 @@ export default class AuctionForm extends FormComponent<Auction> {
resetDelay: extraJson.resetDelay || '10',
resetDelayDuration: extraJson.resetDelayDuration || '10',
aucvehDuration: extraJson.aucvehDuration || '10',
bidAucVehDuration: extraJson.bidAucVehDuration || '10',
resetDelayUnit: extraJson.resetDelayUnit || 'second',
resetDelayDurationUnit: extraJson.resetDelayDurationUnit || 'second',
});
......@@ -587,18 +594,21 @@ export default class AuctionForm extends FormComponent<Auction> {
item.originLabel = null;
});
}
console.log(formValue);
console.log('1111111111111111111111111111111111111',formValue);
const extraJson = {
delay: String(formValue.delay || 0),
nearReservePriceThreshold: String(formValue.nearReservePriceThreshold || 0),
resetDelay: String(formValue.resetDelay || 0),
resetDelayDuration: String(formValue.resetDelayDuration || 0),
bidAucVehDuration: String(formValue.bidAucVehDuration || 0),
aucvehDuration: String(formValue.aucvehDuration || 0),
resetDelayUnit: this.resetDelayUnit || 'second',
resetDelayDurationUnit: this.resetDelayDurationUnit || 'second',
};
console.log('1111111111111111111111111111111111111',extraJson);
// if(formValue.delay){
// delete formlue.delay
// }
......@@ -611,7 +621,6 @@ export default class AuctionForm extends FormComponent<Auction> {
// if(formValue.resetDelayDuration){
// delete formValue.resetDelayDuration
// }
switch (this.action) {
case 'create':
case 'add':
......
......@@ -26,14 +26,15 @@
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="竞价记录">
<bid-page :aucveh-id="auctionVehicle.aucvehId" />
<bid-page ref="bidPageRef" :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>
<vehicle-browser-history-page ref="vehicleBrowserHistoryPageRef"
:aucveh-id="auctionVehicle.aucvehId"></vehicle-browser-history-page>
</a-tab-pane>
</a-tabs>
</div>
</template>
<script lang="ts">
......@@ -103,13 +104,12 @@ export default class ViewAuctionVehicle extends Vue {
that.auctionState = itemData.auctionState || '';
that.formatTime(itemData.remainSecond || 0);
if (that.auctionVehicle.auctionMode == 2 && itemData.auctionState == 'AUCTIONING' && itemData.remainSecond) {
//判断该组件是否销毁
// setTimeout(() => {
// that.getBidRemainSecData();
// }, 1000);
if (this.$refs.bidPageRef || this.$refs.vehicleBrowserHistoryPageRef) {
setTimeout(() => {
that.getBidRemainSecData();
}, 1000);
}
that.$refs.bidPageRef.refreshList();
}
});
}
......@@ -125,11 +125,13 @@ export default class ViewAuctionVehicle extends Vue {
handleAddBid(): void {
const that = this;
if (that.isDestroyed) return;
if (!that.bidPrice) {
message.error('请输入出价金额');
return;
}
AuctionController.addBid(that.axios, { aucvehId: that.auctionVehicle.aucvehId, bidPrice: that.bidPrice }).then(() => {
if (that.isDestroyed) return;
message.success('操作成功!');
});
}
......
......@@ -4,7 +4,7 @@
<!--查询栏end-->
<!--投标竞价列表start-->
<a-table :columns="columns" :data-source="pagination.content" :loading="loading" :bordered="false" @change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn"
<a-table :columns="columns" :data-source="pagination.content" :bordered="false" @change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn"
size="small" :pagination="pageState" :row-key="record => record.bidId" :scroll="{y: 'calc(100vh - 446px)'}">
<template #customFilterDropdown="{setSelectedKeys, selectedKeys, confirm, clearFilters, column}">
<m-filter-text-render :pagination="pagination" :column="column" :confirm="confirm"></m-filter-text-render>
......@@ -17,7 +17,7 @@
<template v-if="column.key === 'accountType'">
<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>
<div class="tag2" v-if="record.bidType === 2 ">管理员加价</div>
<!-- <account-type-tag :account-type="record.account.accountType"></account-type-tag> -->
</template>
</template>
......@@ -75,6 +75,10 @@ export default class BidPage extends PaginationComponent<Bid> {
];
selectedBid: Bid | null = null;
refreshList() {
this.pageLoad();
}
/**
* 初始化配置
......
......@@ -43,13 +43,13 @@ export default class PriceAddModal extends Vue {
autoBidSwitch: false,
autoBidRange: '',
autoBidTrigger: '',
auctionId:'',
};
pageData: any = {};
init(data) {
this.pageData = data;
console.log('init111111111111111111111priceAddModal', data);
const vehicle = data.vehicle || {};
const baseInfo = vehicle.baseInfo || {};
this.modalTitle = `系统自动加价设置(车辆:${baseInfo.carSeriesName} ${baseInfo.carTypeName})`;
......@@ -57,6 +57,7 @@ export default class PriceAddModal extends Vue {
this.postData.autoBidSwitch = vehicle.autoBidSwitch == 1 ? true : false;
this.postData.autoBidRange = vehicle.autoBidRange || '';
this.postData.autoBidTrigger = vehicle.autoBidTrigger || '';
this.postData.auctionId = data?.auction?.auctionId || '';
this.exitVisible = true;
}
......
......@@ -116,7 +116,7 @@
<view class="downBox_custom_hand">
<view class="downBox_custom_input">
<view class="downBox_custom_unit">¥</view>
<van-field :value="customBid" style="height: 36px;" type="digit" placeholder="最低100" />
<van-field :value="customBid" style="height: 36px;" placeholder="最低100" />
</view>
<view class="downBox_custom_but" @click="handleCustomBidConfirm()">确认</view>
</view>
......@@ -371,7 +371,7 @@ export default class roundBidBottom extends Vue {
this.resultPrice = (Number(data.price || 0)) / 10000;
if (this.endState != '2') {
this.getNextAucVehData();
if(this.pageState != 'END'){
if(this.pageState == 'END'){
this.noticeBidEnd();
}
}
......@@ -414,7 +414,7 @@ export default class roundBidBottom extends Vue {
this.isShowCustom = false;
this.handleAddBid();
} else {
this.addPrice = '';
// this.addPrice = '';
this.customBid = '';
this.isShowCustom = true;
}
......@@ -425,25 +425,23 @@ export default class roundBidBottom extends Vue {
if (!this.customBid) {
uni.showToast({ title: '请输入自定义加价金额', icon: 'none' })
} else {
this.addPrice = this.customBid;
// this.addPrice = this.customBid;
this.handleAddBid();
}
}
//自定义金额输入框
handleCustomBidInput(value: any) {
let numStr = String(value?.detail?.value || '').replace(/\D/g, '');
let num = parseInt(numStr, 10);
if (num > 0) {
num = Math.floor(num / 100) * 100;
if (num < 100) num = 100;
this.customBid = num.toString();
} else {
this.customBid = '100';
}
}
// handleCustomBidInput(value: any) {
// let numStr = String(value?.detail?.value || '').replace(/\D/g, '');
// let num = parseInt(numStr, 10);
// if (num > 0) {
// num = Math.floor(num / 100) * 100;
// if (num < 100) num = 100;
// this.customBid = num.toString();
// } else {
// this.customBid = '100';
// }
// }
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!