Commit ae5added by zhangxw

认证修改

1 parent adf6a523
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
}, },
"auctionOrder": { "auctionOrder": {
"orderState": { "orderState": {
"CONTRACT_UNSIGNED": "待签署合同", // "CONTRACT_UNSIGNED": "待签署合同",
"UNPAID": "待付车款", "UNPAID": "待付车款",
"WAIT_PICKUP": "待提车", "WAIT_PICKUP": "待提车",
"TRANSFERRING": "待过户", "TRANSFERRING": "待过户",
......
...@@ -39,7 +39,7 @@ export const businessRouter: Array<RouteRecordRaw> = [ ...@@ -39,7 +39,7 @@ export const businessRouter: Array<RouteRecordRaw> = [
}, },
{ {
path: '/business/platformContract', path: '/business/platformContract',
component: () => import( '@/views/business/platformContract/platformContractPage.vue'), component: () => import( '@/views/business/platformContract/platFormContractPage.vue'),
meta: { meta: {
breadcrumbs: [{name: '运营管理'}, {name: '平台合同管理'}] breadcrumbs: [{name: '运营管理'}, {name: '平台合同管理'}]
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<!-- 审核过户资料--> <!-- 审核过户资料-->
<a-button type="link" v-if="record.orderState==='TRANSFERRING'&&record.auditState==='UNAUDITED'" size="small" @click="auditAuctionOrder(record)">审核</a-button> <a-button type="link" v-if="record.orderState==='TRANSFERRING'&&record.auditState==='UNAUDITED'" size="small" @click="auditAuctionOrder(record)">审核</a-button>
<!-- <a-button type="link" disabled v-if="record.orderState==='TRANSFERRING'&&!record.auditState" size="small">未提交过户资料</a-button> --> <!-- <a-button type="link" disabled v-if="record.orderState==='TRANSFERRING'&&!record.auditState" size="small">未提交过户资料</a-button> -->
<a-button type="link" size="small" @click="uploadTransferring(record)">修改过户资料</a-button> <a-button type="link" size="small" v-if="record.orderState === 'TRANSFERRING' || record.orderState === 'COMPLETED'" @click="uploadTransferring(record)">修改过户资料</a-button>
<a-button type="link" v-if="record.orderState==='COMPLETED'" size="small" @click="viewTransferring(record)">过户资料</a-button> <a-button type="link" v-if="record.orderState==='COMPLETED'" size="small" @click="viewTransferring(record)">过户资料</a-button>
<router-link :to="{path:'/account/view',query:{accountId:record.account?.accountId}}"> <router-link :to="{path:'/account/view',query:{accountId:record.account?.accountId}}">
<a-button type="link" size="small">联系买家</a-button> <a-button type="link" size="small">联系买家</a-button>
...@@ -83,7 +83,7 @@ import UploadPaymentVoucher from "@/views/auction/order/UploadPaymentVoucher.vue ...@@ -83,7 +83,7 @@ import UploadPaymentVoucher from "@/views/auction/order/UploadPaymentVoucher.vue
}, },
}) })
export default class AuctionOrderPage extends PaginationComponent<AuctionOrder> { export default class AuctionOrderPage extends PaginationComponent<AuctionOrder> {
orderState: AuctionOrder_OrderState | '' = "CONTRACT_UNSIGNED"; orderState: AuctionOrder_OrderState | '' = "UNPAID";
exporting = false; exporting = false;
/** /**
* 表格列配置 * 表格列配置
...@@ -191,7 +191,7 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder> ...@@ -191,7 +191,7 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
const tabs = []; const tabs = [];
if (this.hasPrivilege('auction_order_1')) tabs.push({key: "", tab: `全部(${this.orderStateCount?.total})`}); if (this.hasPrivilege('auction_order_1')) tabs.push({key: "", tab: `全部(${this.orderStateCount?.total})`});
AUCTION_ORDER_ORDER_STATES.forEach(item => { AUCTION_ORDER_ORDER_STATES.forEach(item => {
if (item === 'CONTRACT_UNSIGNED') tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.orderStateCount.contractUnsignedCount})`}); // if (item === 'CONTRACT_UNSIGNED') tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.orderStateCount.contractUnsignedCount})`});
if (item === 'UNPAID' && this.hasPrivilege('auction_order_3')) tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.orderStateCount.unpaidCount})`}); if (item === 'UNPAID' && this.hasPrivilege('auction_order_3')) tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.orderStateCount.unpaidCount})`});
if (item === 'WAIT_PICKUP' && this.hasPrivilege('auction_order_4')) tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.orderStateCount.waitPickupCount})`}); if (item === 'WAIT_PICKUP' && this.hasPrivilege('auction_order_4')) tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.orderStateCount.waitPickupCount})`});
if (item === 'TRANSFERRING' && this.hasPrivilege('auction_order_5')) tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.orderStateCount.transferringCount})`}); if (item === 'TRANSFERRING' && this.hasPrivilege('auction_order_5')) tabs.push({key: item, tab: `${this.$t('enum.auctionOrder.orderState.' + item)}(${this.orderStateCount.transferringCount})`});
......
...@@ -32,6 +32,18 @@ ...@@ -32,6 +32,18 @@
<a-descriptions-item label="创建时间" name="createTime"> <a-descriptions-item label="创建时间" name="createTime">
{{ auctionOrder.createTime }} {{ auctionOrder.createTime }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="保留价" name="updateTime">
¥{{ auctionOrder.vehicle.reservePrice }}
</a-descriptions-item>
<a-descriptions-item label="预计经销差" name="updateTime">
¥{{ expectedProfitMargin }}
</a-descriptions-item>
<a-descriptions-item label="溢价金额" name="updateTime">
¥{{ premiumAmount }}
</a-descriptions-item>
<a-descriptions-item label="实际经销差" name="updateTime">
¥{{ actualProfitMargin }}
</a-descriptions-item>
</a-descriptions> </a-descriptions>
</a-card> </a-card>
<a-card class="mt-10" :bordered="false" size="small"> <a-card class="mt-10" :bordered="false" size="small">
...@@ -429,6 +441,69 @@ export default class ViewAuctionOrder extends Vue { ...@@ -429,6 +441,69 @@ export default class ViewAuctionOrder extends Vue {
return this.auctionOrder?.account; return this.auctionOrder?.account;
} }
/**
* 预计经销差 = 保留价 + 佣金 - 成本价
* 使用 Math.round() 避免精度丢失
*/
get expectedProfitMargin(): string {
if (!this.auctionOrder) return '-';
const reservePrice = this.auctionOrder.vehicle?.reservePrice;
const commissionPrice = this.auctionOrder.commissionPrice;
const purchasePrice = this.auctionOrder.vehicle?.evaluationTransaction?.purchasePrice;
// 如果任一值为空,返回 '-'
if (!reservePrice || !commissionPrice || !purchasePrice) {
return '-';
}
// 使用 Math.round() 避免精度丢失,保留2位小数
const margin = Math.round((reservePrice + commissionPrice - purchasePrice) * 100) / 100;
return margin.toFixed(2);
}
/**
* 溢价金额 = 成交价 + 佣金 - 保留价
* 使用 Math.round() 避免精度丢失
*/
get premiumAmount(): string {
if (!this.auctionOrder) return '-';
const orderPrice = this.auctionOrder.orderPrice;
const commissionPrice = this.auctionOrder.commissionPrice;
const reservePrice = this.auctionOrder.vehicle?.reservePrice;
// 如果任一值为空,返回 '-'
if (!orderPrice || !commissionPrice || !reservePrice) {
return '-';
}
// 使用 Math.round() 避免精度丢失,保留2位小数
const premium = Math.round((orderPrice + commissionPrice - reservePrice) * 100) / 100;
return premium.toFixed(2);
}
/**
* 实际经销差 = 成交价 + 佣金 - 成本价
* 使用 Math.round() 避免精度丢失
*/
get actualProfitMargin(): string {
if (!this.auctionOrder) return '-';
const orderPrice = this.auctionOrder.orderPrice;
const commissionPrice = this.auctionOrder.commissionPrice;
const purchasePrice = this.auctionOrder.vehicle?.evaluationTransaction?.purchasePrice;
// 如果任一值为空,返回 '-'
if (!orderPrice || !commissionPrice || !purchasePrice) {
return '-';
}
// 使用 Math.round() 避免精度丢失,保留2位小数
const margin = Math.round((orderPrice + commissionPrice - purchasePrice) * 100) / 100;
return margin.toFixed(2);
}
viewContract(contract: Contract): void { viewContract(contract: Contract): void {
contract.auctionOrder = this.auctionOrder; contract.auctionOrder = this.auctionOrder;
const modal = ModalService.confirm({ const modal = ModalService.confirm({
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签署状态"> <a-descriptions-item label="签署状态">
<a-tag v-if="contract.signed" color="success">已签署</a-tag> <a-tag :color="contract.contractStatus == '已签署' ? 'success' : 'orange'">{{contract.contractStatus}}</a-tag>
<a-tag v-else color="error">未签署</a-tag>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="合同附件"> <a-descriptions-item label="合同附件">
...@@ -46,16 +45,16 @@ ...@@ -46,16 +45,16 @@
<a-empty v-else description="暂无合同附件" :image="simpleImage"></a-empty> <a-empty v-else description="暂无合同附件" :image="simpleImage"></a-empty>
</a-card> </a-card>
<a-descriptions v-if="contract.auctionOrder?.account" :bordered="false" :column="4" size="small" style="margin-top: 16px;"> <a-descriptions :bordered="false" :column="4" size="small" style="margin-top: 16px;">
<template #title> <template #title>
<title-tip-icon/> <title-tip-icon/>
签署方信息 签署方信息
</template> </template>
<a-descriptions-item label="买受方"> <a-descriptions-item label="买受方" :span="2">
{{ contract.auctionOrder.account.accountName || '-' }} (ID: {{ contract.auctionOrder.account.accountId || '-' }}) {{ contract.signerName || '-' }} (ID: {{ contract.signerIdCard || '-' }})
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="联系方式"> <a-descriptions-item label="联系方式" :span="2">
{{ contract.auctionOrder.account.mobile || '-' }} {{ contract.signerMobile || '-' }}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
</template> </template>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<span>{{ record.accountName || '—' }}</span> <span>{{ record.accountName || '—' }}</span>
</template> </template>
<template v-if="column.key === 'signTime'"> <template v-if="column.key === 'signTime'">
<span>{{ record.signed ? (record.signTime || '—') : '—' }}</span> <span>{{ (record.signTime || '—') }}</span>
</template> </template>
<template v-if="column.key === 'createTime'"> <template v-if="column.key === 'createTime'">
<span>{{ record.createTime || '—' }}</span> <span>{{ record.createTime || '—' }}</span>
...@@ -83,7 +83,7 @@ export default class MasterContractPage extends PaginationComponent<Contract> { ...@@ -83,7 +83,7 @@ export default class MasterContractPage extends PaginationComponent<Contract> {
{ {
title: '签署状态', dataIndex: 'contractStatus', key: 'contractStatus', align: 'center', width: 100, resizable: true, ellipsis: true, sorter: true, title: '签署状态', dataIndex: 'contractStatus', key: 'contractStatus', align: 'center', width: 100, resizable: true, ellipsis: true, sorter: true,
}, },
{title: '签署乙方姓名', dataIndex: 'accountName', key: 'accountName', width: 120, resizable: true, ellipsis: true, sorter: true}, {title: '签署乙方姓名', dataIndex: 'signerName', key: 'signerName', width: 120, resizable: true, ellipsis: true, sorter: true},
{title: '创建时间', dataIndex: 'createTime', key: 'createTime', width: 170, align: 'center', resizable: true, ellipsis: true, sorter: true}, {title: '创建时间', dataIndex: 'createTime', key: 'createTime', width: 170, align: 'center', resizable: true, ellipsis: true, sorter: true},
{title: '签署时间', dataIndex: 'signTime', key: 'signTime', width: 170, align: 'center', resizable: true, ellipsis: true, sorter: true}, {title: '签署时间', dataIndex: 'signTime', key: 'signTime', width: 170, align: 'center', resizable: true, ellipsis: true, sorter: true},
{title: '操作', key: 'action', width: 80, align: 'center', fixed: 'right'}, {title: '操作', key: 'action', width: 80, align: 'center', fixed: 'right'},
......
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
<a-descriptions-item label="佣金金额" name="referencePrice"> <a-descriptions-item label="佣金金额" name="referencePrice">
¥{{ appraisePrice.fixedCommission || appraisePrice.fixedCommission == 0 ? appraisePrice.fixedCommission : '-' }}元 ¥{{ appraisePrice.fixedCommission || appraisePrice.fixedCommission == 0 ? appraisePrice.fixedCommission : '-' }}元
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="成本价" name="referencePrice">
¥{{ appraisePrice.vehicle?.evaluationTransaction?.purchasePrice || appraisePrice.vehicle?.evaluationTransaction?.purchasePrice == 0 ? appraisePrice.vehicle?.evaluationTransaction?.purchasePrice : '-' }}元
</a-descriptions-item>
<a-descriptions-item label="预计经销差" name="referencePrice">
¥{{ expectedProfitMargin }}元
</a-descriptions-item>
</a-descriptions> </a-descriptions>
<a-divider>审批记录</a-divider> <a-divider>审批记录</a-divider>
<approve-history-timeline approve-type="APPRAISE_PRICE" :approve-id="appraisePrice.appraiseId" :create-time="appraisePrice.createTime" <approve-history-timeline approve-type="APPRAISE_PRICE" :approve-id="appraisePrice.appraiseId" :create-time="appraisePrice.createTime"
...@@ -70,6 +76,33 @@ export default class AppraisePriceAuditForm extends EnhanceFormComponent<Approve ...@@ -70,6 +76,33 @@ export default class AppraisePriceAuditForm extends EnhanceFormComponent<Approve
this.formState = reactive<ApproveHistory>(approveHistory); this.formState = reactive<ApproveHistory>(approveHistory);
} }
/**
* 预计经销差 = 保留价 + 佣金 - 成本价
* 使用 Math.round() 避免精度丢失
*/
get expectedProfitMargin(): string {
// 获取保留价
const reservePrice = this.appraisePrice?.reservePrice;
// 获取佣金
const commission = this.appraisePrice?.fixedCommission;
// 获取成本价
const purchasePrice = this.appraisePrice?.vehicle?.evaluationTransaction?.purchasePrice;
// 如果保留价或成本价为空,返回 '-'
if (!reservePrice || !purchasePrice) {
return '-';
}
// 佣金字段可能是0或空,需要特殊处理
const commissionPrice = commission || 0;
// 使用 Math.round() 避免精度丢失,保留2位小数
const margin = Math.round((reservePrice + commissionPrice - purchasePrice) * 100) / 100;
return margin.toFixed(2);
}
onValidSuccess(formValue: ApproveHistory): void { onValidSuccess(formValue: ApproveHistory): void {
formValue.approveId = this.appraisePrice.appraiseId; formValue.approveId = this.appraisePrice.appraiseId;
AppraiseController.auditAppraisePrice(this.axios, formValue).then(res => { AppraiseController.auditAppraisePrice(this.axios, formValue).then(res => {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<a-descriptions-item label="车辆信息">{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</a-descriptions-item> <a-descriptions-item label="车辆信息">{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</a-descriptions-item>
<a-descriptions-item label="市场参考价">¥{{ vehicle.baseInfo.guidePrice }}元</a-descriptions-item> <a-descriptions-item label="市场参考价">¥{{ vehicle.baseInfo.guidePrice }}元</a-descriptions-item>
<a-descriptions-item label="收车成本价">¥{{ vehicle.evaluationTransaction.purchasePrice }}元</a-descriptions-item> <a-descriptions-item label="收车成本价">¥{{ vehicle.evaluationTransaction.purchasePrice }}元</a-descriptions-item>
<a-descriptions-item label="预计经销差">¥{{ difference }}元</a-descriptions-item>
</a-descriptions> </a-descriptions>
<a-alert v-if="(businessConfig&&!businessConfig?.specialPricingEnabled)&&formState.referencePrice <= 0" message="请配置有效的基础参考价规则" <a-alert v-if="(businessConfig&&!businessConfig?.specialPricingEnabled)&&formState.referencePrice <= 0" message="请配置有效的基础参考价规则"
type="error" show-icon class="mb-12"/> type="error" show-icon class="mb-12"/>
...@@ -87,6 +88,31 @@ export default class AppraisePriceForm extends EnhanceFormComponent<AppraisePric ...@@ -87,6 +88,31 @@ export default class AppraisePriceForm extends EnhanceFormComponent<AppraisePric
} }
} }
/**
* 预计经销差 = 手动输入的保留价 + 佣金 - 收车成本价
* 佣金取值:如果开启自定义佣金,取表单输入的固定佣金,否则按 0 处理
* 使用 Math.round() 避免精度丢失
*/
get difference(): string {
// 获取保留价(手动输入)
const reservePrice = this.formState.reservePrice;
// 获取佣金:如果开启自定义佣金,取表单输入的固定佣金,否则为 0
const commissionPrice = this.formState.fixedCommissionSwitch ? (this.formState.fixedCommission || 0) : 0;
// 获取收车成本价
const purchasePrice = this.vehicle?.evaluationTransaction?.purchasePrice;
// 如果保留价或成本价为空,返回 '-'
if (!reservePrice || !purchasePrice) {
return '-';
}
// 使用 Math.round() 避免精度丢失,保留2位小数
const margin = Math.round((reservePrice + commissionPrice - purchasePrice) * 100) / 100;
return margin.toFixed(2);
}
verifyReferencePrice(_rule: RuleObject, referencePrice: number) { verifyReferencePrice(_rule: RuleObject, referencePrice: number) {
if (referencePrice <= 0) { if (referencePrice <= 0) {
return Promise.reject('请配置有效的基础参考价规则!'); return Promise.reject('请配置有效的基础参考价规则!');
......
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
<a-descriptions-item label="保留价"> <a-descriptions-item label="保留价">
¥{{ vehicle.reservePrice }} ¥{{ vehicle.reservePrice }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="成本价">
¥{{ vehicle.evaluationTransaction?.purchasePrice ?? '-' }}
</a-descriptions-item>
<a-descriptions-item label="预计经销差">
¥{{ expectedProfitMargin }}
</a-descriptions-item>
<a-descriptions-item label="延时规则"> <a-descriptions-item label="延时规则">
最后{{ auctionVehicle.auction.beforeEndMinute }}分钟出价,延时{{ auctionVehicle.auction.delayMinute }}分钟 最后{{ auctionVehicle.auction.beforeEndMinute }}分钟出价,延时{{ auctionVehicle.auction.delayMinute }}分钟
</a-descriptions-item> </a-descriptions-item>
...@@ -108,6 +114,24 @@ export default class AuctionVehicleHistory extends Vue { ...@@ -108,6 +114,24 @@ export default class AuctionVehicleHistory extends Vue {
} }
} }
/**
* 计算预计经销差(保留价 - 成本价)
* 使用 Math.round() 避免精度丢失
*/
get expectedProfitMargin(): string {
const reservePrice = this.vehicle.reservePrice;
const purchasePrice = this.vehicle.evaluationTransaction?.purchasePrice;
// 如果保留价或成本价为空,返回 '-'
if (!reservePrice || !purchasePrice) {
return '-';
}
// 使用 Math.round() 避免精度丢失,保留2位小数
const margin = Math.round((reservePrice - purchasePrice) * 100) / 100;
return margin.toFixed(2);
}
created() { created() {
AuctionController.getAuctionVehiclesByVehicleId(this.axios, this.vehicle.vehicleId).then(response => { AuctionController.getAuctionVehiclesByVehicleId(this.axios, this.vehicle.vehicleId).then(response => {
this.auctionVehicles = response.data; this.auctionVehicles = response.data;
......
...@@ -83,4 +83,11 @@ export class AccountController { ...@@ -83,4 +83,11 @@ export class AccountController {
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
/**
* 发起平台合同签署
*/
static initiateSigningApi(axios: AxiosStatic): Promise<AxiosResponse<Account>> {
return axios.post('platformContract/initiateSigning');
}
} }
...@@ -172,7 +172,9 @@ export default { ...@@ -172,7 +172,9 @@ export default {
"COUPON_2": "优惠券协议2", "COUPON_2": "优惠券协议2",
"COUPON_3": "优惠券协议3", "COUPON_3": "优惠券协议3",
"COUPON_4": "优惠券协议4", "COUPON_4": "优惠券协议4",
"COUPON_5": "优惠券协议5" "COUPON_5": "优惠券协议5",
"PURCHASE_CONTRACT": "购车合同",
"PLATFORM_CONTRACT": "平台交易整体合同"
}, },
"agreementState": { "agreementState": {
"DRAFT": "草稿", "DRAFT": "草稿",
......
<template> <template>
<view class="submit-result-container"> <view class="submit-result-container">
<!-- 内容区域 --> <!-- 资料审核中 -->
<view class="content-container"> <template v-if="account?.certifiedState === 'CERTIFICATING'">
<!-- 等待图标 --> <view class="status-center">
<view class="waiting-icon-container"> <image :src="imageUrl" class="state-image"></image>
<view class="waiting-icon"> <text class="status-title">资料审核中</text>
<text class="status-desc">我们将于<text class="highlight">3个工作日内</text>进行审核,审核结果会以短信的形式通知,请您耐心等待</text>
</view>
<view class="footer-submit-bar single">
<van-button type="primary" round @click="navigateToHome" block>返回</van-button>
</view>
</template>
<!-- 已通过认证,请完成平台合同签署 -->
<template v-else-if="account?.certifiedState === 'CERTIFIED' && (!account?.platformContractSigned || !account?.platformContractSignTime)">
<view v-if="account.signDeadline && !isSignDeadline" class="tips-box">
<van-icon name="warning" style="margin-top: 2px;" color="#F47F13" />
若 24h 内未完成签署,可点击下方按钮重新发起签署任务。
</view>
<view class="scroll-page with-notice">
<view class="status-center compact">
<image :src="imageUrl" class="state-image"></image> <image :src="imageUrl" class="state-image"></image>
<text class="status-title">已通过认证,请完成平台合同签署</text>
<text class="status-sub">(签署完成后即可出价参拍)</text>
</view>
<view class="contract-section">
<view class="section-title sticky-title">平台交易整体合同</view>
<view class="contract-content">
<rich-text class="content-text" :nodes="htmlContent"></rich-text>
</view>
</view> </view>
</view> </view>
<!-- 审核状态文字 --> <view class="footer-submit-bar">
<view class="status-text-container" v-if="account?.certifiedState==='CERTIFICATING'"> <template v-if="!account.signDeadline">
<text class="status-title">资料审核中</text> <van-button type="primary" round @click="handleSign" block>发起合同签署</van-button>
<view class="status-desc">我们将于<span style="color:#007FFF ">3个工作日内</span>进行审核,审核结果会以短信的形式通知,请您耐心等待</view> </template>
<template v-else-if="account.signDeadline && isSignDeadline">
<van-button type="primary" round @click="handleSign" block>重新发起签署</van-button>
</template>
<template v-else>
<view class="sign-notice">
<text>签署通过e签宝完成,短信发送至预留手机号</text>
<text>协议将短信发送至{{ maskedMobile }}</text>
</view>
<van-button type="primary" round block>合同签署中</van-button>
</template>
</view> </view>
<view class="status-text-container" v-if="account?.certifiedState==='CERTIFY_FAILED'"> </template>
<text class="status-title">审核失败</text>
<text class="status-desc">很抱歉,您的认证信息中有部分信息未能通过审批,请重新上传资料</text> <!-- 认证失败 -->
<template v-else-if="account?.certifiedState === 'CERTIFY_FAILED'">
<view class="scroll-page">
<view class="status-center compact">
<image :src="imageUrl" class="state-image"></image>
<text class="status-title">认证失败</text>
<text class="status-desc">请重新填写资料并提交</text>
</view>
<uni-forms v-if="account?.accountType === 'COMMON'" ref="form" :model="formData" :rules="rules">
<view class="info-section">
<view class="section-title">请完善您的个人信息</view>
<view class="section-tip">
<van-image width="16" height="16" fit="cover" src="/static/images/account/certifition/certifition.png"></van-image>
<text class="tip-text">信息用于开通车商服务,您的资料将被严格保密</text>
</view>
<uni-forms-item label="" name="accountName" required>
<view class="form-item">
<text class="label-text">真实姓名</text>
<uni-easyinput v-model="formData.accountName" placeholder="请输入真实姓名" :maxlength="18" :inputBorder="false"/>
</view>
</uni-forms-item>
<uni-forms-item label="" name="idCard" required>
<view class="form-item">
<text class="label-text">身份证号</text>
<uni-easyinput v-model="formData.idCard" placeholder="请输入身份证号码" type="idcard" :maxlength="18" :inputBorder="false"/>
</view>
</uni-forms-item>
</view>
<view class="info-section">
<view class="section-title">上传身份证照片</view>
<view class="section-desc">请上传本人的身份证照片,证件信息仅用于身份认证</view>
<view class="upload-section">
<view class="upload-item">
<uni-file-picker fileMediatype="image" :image-styles="imageStyles" @select="selectFile($event,'front')" mode="grid" :auto-upload="true"
:limit="1" file-extname="png,jpg,jpeg">
<view class="upload-placeholder">
<image v-if="formData.idCardPortrait?.url || account?.idCardPortraitUrl" :src="formData.idCardPortrait?.url || account?.idCardPortraitUrl" mode="aspectFill" style="width: 100%; height: 150px;"></image>
<image v-else src="~@/static/images/account/certifition/idcard_0@2x.png" style="width: 100%; height: 150px;"></image>
<text class="upload-text">上传人像面</text>
</view>
</uni-file-picker>
</view>
<view class="upload-item">
<uni-file-picker fileMediatype="image" :image-styles="imageStyles" @select="selectFile($event,'back')" :limit="1" file-extname="png,jpg,jpeg">
<view class="upload-placeholder">
<image v-if="formData.idCardNationalEmblem?.url || account?.idCardNationalEmblemUrl" :src="formData.idCardNationalEmblem?.url || account?.idCardNationalEmblemUrl" mode="aspectFill" style="width: 100%; height: 150px;"></image>
<image v-else src="~@/static/images/account/certifition/idcard_1@2x.png" style="width: 100%; height: 150px;"></image>
<text class="upload-text">上传国徽面</text>
</view>
</uni-file-picker>
</view>
</view>
</view>
</uni-forms>
<view class="contract-section">
<view class="section-title sticky-title">平台交易整体合同</view>
<view class="contract-content">
<rich-text class="content-text" :nodes="htmlContent"></rich-text>
</view>
</view>
</view> </view>
<view class="status-text-container" v-if="account?.certifiedState==='CERTIFIED'">
<text class="status-title">审核成功</text> <view class="footer-submit-bar single">
<text class="status-desc">审核通过,开启您的省赚车商之旅</text> <van-button type="danger" round @click="submitForm" block>重新上传</van-button>
</view> </view>
</template>
<!-- 已通过认证,您可随时参拍 -->
<template v-else-if="account?.certifiedState === 'CERTIFIED' && account?.platformContractSignTime">
<view class="scroll-page">
<view class="status-center compact">
<image :src="imageUrl" class="state-image big-image"></image>
<text class="status-title blue-text">已通过认证,您可随时参拍</text>
<text class="status-desc">平台合同已签署完成,签署时间:2026-07-22 14:08</text>
</view>
<!-- 返回按钮 --> <view class="contract-section">
<view class="button-container"> <view class="section-title sticky-title">平台交易整体合同</view>
<template v-if="account?.certifiedState==='CERTIFY_FAILED'"> <view class="contract-content">
<van-button type="primary" round @click="navigateTo" block>重新上传</van-button> <rich-text class="content-text" :nodes="htmlContent"></rich-text>
<van-button type="default" plain hairline round @click="navigateToHome" block>返回</van-button> </view>
</template> </view>
<van-button v-else type="info" hairline round @click="navigateToHome" block>返回</van-button> </view>
<view class="footer-submit-bar single">
<van-button type="primary" color="#EAF1FF" custom-style="color: #185EFE" round @click="navigateToUpgrade" block>企业可继续升级参拍权</van-button>
</view> </view>
</view> </template>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from "vue-facing-decorator"; import {Component, Vue, Watch} from "vue-facing-decorator";
import {onLoad, onShow} from "@dcloudio/uni-app"; import {onLoad, onShow} from "@dcloudio/uni-app";
import {AccountController} from "@/api/AccountController"; import {AccountController} from "@/api/AccountController";
import {Account} from "lib/src/entity/account/entity/Account"; import {Account} from "lib/src/entity/account/entity/Account";
import {AgreementController} from "@/api/AgreementController";
import {Certification} from "lib/src/entity/account/domain/Certification";
import type {FileInfo} from "lib/src/core/bean/FileInfo";
import {AuthService} from "@/common/AuthService";
import {ID_CARD_18_REGEX} from "@/common/CommonUtils";
@Component({ @Component({})
components: {}
})
export default class CertificationResult extends Vue { export default class CertificationResult extends Vue {
account: Account = null;
agreement: { content: string } = null;
formData: Certification = null;
isFormValid = false;
imageStyles = {
width: 168,
border: {
radius: '2px'
}
};
account: Account = null; rules = {
accountName: {
rules: [{required: true, errorMessage: '请输入真实姓名'}]
},
idCard: {
rules: [
{required: true, errorMessage: '请输入身份证号码'},
{pattern: ID_CARD_18_REGEX, errorMessage: '请输入正确的身份证号码'}
]
},
};
created(): void { created(): void {
onLoad((option) => { this.formData = new Certification();
AccountController.getLoginAccount(this.axios).then(res => { this.formData.idCardNationalEmblem = null;
this.account = res.data; this.formData.idCardPortrait = null;
});
onLoad(() => {
this.loadAccount();
this.loadAgreement();
}); });
// 每次都加载 onShow(() => {
onShow((option) => { this.loadAccount();
}); });
} }
// 返回上一页 loadAccount() {
navigateTo() { AccountController.getLoginAccount(this.axios).then(res => {
if (this.account.accountType === 'COMMON') { this.account = res.data;
uni.navigateTo({url: '/module/account/PersonCertificationPage'});
if (this.account?.certifiedState === 'CERTIFY_FAILED') {
this.formData.accountName = this.account.accountName || '';
this.formData.idCard = this.account.idCard || '';
}
});
}
loadAgreement() {
AgreementController.getAgreementByKey(this.axios, 'PLATFORM_CONTRACT').then(res => {
this.agreement = res.data || {};
}).catch(() => {
this.agreement = {};
});
}
get imageUrl(): string {
switch (this.account?.certifiedState) {
case 'CERTIFICATING':
return '/static/images/account/certifition/auditing@2x.png';
case 'CERTIFIED':
if (this.account?.platformContractSignTime) {
return 'https://img02.glsx.com.cn/weapp/resource/dj-aus/images/account/certifition/platformContractSigned.png'
}
return '/static/images/account/certifition/success@2x.png';
case 'CERTIFY_FAILED':
return '/static/images/account/certifition/fail@2x.png';
default:
return '';
}
}
get htmlContent(): string {
return this.formatRichText(this.agreement?.content ?? '');
}
get maskedMobile(): string {
if (!this.account?.mobile) return '';
const mobile = this.account.mobile;
if (mobile.length === 11) {
return mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
return mobile;
}
get isSignDeadline(): boolean {
try {
const signDeadline = new Date(this.account.signDeadline);
const now = new Date();
return signDeadline <= now;
} catch (error) {
console.error('签署截止时间解析失败:', error);
return false;
}
}
formatRichText(html: string) {
html = html.replace(/class="mce-.*?"/g, '');
html = html.replace(/width:\s*\d+px;/g, '');
html = html.replace(/height:\s*\d+px;/g, 'height: auto;');
html = html.replace(/<(\/)?pre[^>]*>/gi, '');
return html;
}
@Watch("formData", {deep: true, immediate: true})
async watchFormData() {
setTimeout(() => {
this.$refs.form?.validate().then(() => {
this.isFormValid = (this.formData.idCardPortrait != null) && (this.formData.idCardNationalEmblem != null);
}).catch(() => {
this.isFormValid = false;
});
}, 50);
}
async selectFile(e: any, type: string) {
const tempFiles = e.tempFiles;
if (tempFiles && tempFiles.length > 0) {
const fileInfos = [];
for (const tempFile of tempFiles) {
const fileInfo = await this.uploadFiles(tempFile);
if (fileInfo) {
fileInfos.push(fileInfo);
}
}
if (fileInfos.length > 0) {
if (type === 'front') {
this.formData.idCardPortrait = fileInfos[0];
} else {
this.formData.idCardNationalEmblem = fileInfos[0];
}
}
}
}
uploadFiles(tempFile: any): Promise<FileInfo> {
const authService: AuthService = this.$auth;
const action = 'upload/uploadImage?directory=account/certification';
return new Promise((resolve, reject) => {
uni.uploadFile({
url: this.$apiUrl + action,
filePath: tempFile.path,
name: 'file',
file: tempFile,
header: {'Authorization': 'Bearer ' + authService.getToken()},
success: res => {
if (res.statusCode === 200) {
const file = JSON.parse(res.data);
resolve(file);
} else {
reject(null);
}
},
fail: () => {
uni.showToast({title: '上传失败,请检查网络后重试', icon: 'none'});
reject(null);
}
});
});
}
submitForm() {
if (this.account?.accountType == "COMMON") {
this.$refs.form.validate().then(() => {
if (!this.formData.idCardPortrait) {
uni.showToast({title: '请上传身份证人像面', icon: 'none'});
return;
}
if (!this.formData.idCardNationalEmblem) {
uni.showToast({title: '请上传身份证国徽面', icon: 'none'});
return;
}
uni.showLoading({title: '提交中...', mask: true});
AccountController.certifyAccount(this.axios, this.formData).then(() => {
uni.showToast({title: '提交成功', icon: 'success'});
uni.navigateBack();
}).finally(() => {
uni.hideLoading();
});
}).catch((error: any) => {
console.log('表单验证失败', error);
});
} else if (this.account.accountType === 'PERSON') { } else if (this.account.accountType === 'PERSON') {
uni.navigateTo({url: '/module/account/CompanyCertificationPage'}); uni.navigateTo({url: '/module/account/CompanyCertificationPage'});
} }
} }
get imageUrl(): string { handleSign() {
switch (this.account?.certifiedState) { uni.showLoading({title: '发起中...', mask: true})
case "CERTIFICATING": AccountController.initiateSigningApi(this.axios).then(() => {
return "/static/images/account/certifition/auditing@2x.png" uni.showToast({title: '发起成功', icon: 'success'})
case "CERTIFIED": uni.navigateBack();
return "/static/images/account/certifition/success@2x.png" }).finally(() => {
case "CERTIFY_FAILED": uni.hideLoading();
return "/static/images/account/certifition/fail@2x.png" });
case "UNCERTIFIED": }
return "/static/images/account/certifition/success@2x.png"
navigateTo() {
if (this.account?.accountType === 'COMMON') {
uni.navigateTo({url: '/module/account/PersonCertificationPage'});
} else if (this.account?.accountType === 'PERSON') {
uni.navigateTo({url: '/module/account/CompanyCertificationPage'});
} }
} }
// 返回首页
navigateToHome() { navigateToHome() {
uni.switchTab({url: '/pages/tabbar/ProfilePage'}); uni.switchTab({url: '/pages/tabbar/ProfilePage'});
} }
navigateToUpgrade() {
uni.navigateTo({url: '/module/account/CompanyCertificationPage'})
}
} }
</script> </script>
...@@ -93,69 +380,228 @@ export default class CertificationResult extends Vue { ...@@ -93,69 +380,228 @@ export default class CertificationResult extends Vue {
.submit-result-container { .submit-result-container {
min-height: 100vh; min-height: 100vh;
background-color: #fff; background-color: #fff;
box-sizing: border-box;
padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
.tips-box {
padding: 13px 16px;
background: #FEF2E7;
display: flex; display: flex;
flex-direction: column; align-items: flex-start;
gap: 8px;
color: #F47F13;
font-size: 14px;
} }
.scroll-page {
min-height: 100vh;
padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
/* 内容区域样式 */ .scroll-page.with-notice {
.content-container { padding-bottom: calc(112px + env(safe-area-inset-bottom));
flex: 1; }
.status-center {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
//justify-content: center; padding: 80px 30px 40px;
padding: 40px 20px; text-align: center;
} }
/* 等待图标样式 */ .status-center.compact {
.waiting-icon-container { padding: 40px 0 24px;
margin-bottom: 30px;
} }
.waiting-icon { .state-image {
width: 120px; width: 60px;
height: 120px; height: 60px;
//border-radius: 60px; margin-bottom: 20px;
//background-color: #fff7e6;
//display: flex;
//align-items: center;
//justify-content: center;
} }
.state-image { .big-image {
width: 120px; width: 120px;
height: 120px; height: 120px;
} }
/* 状态文字样式 */
.status-text-container {
text-align: center;
margin-bottom: 50px;
padding: 0 20px;
}
.status-title { .status-title {
font-size: 20px; font-size: 20px;
color: #141E34;
margin-bottom: 12px;
}
.blue-text {
color: #185EFE;
}
.status-desc {
font-size: 14px;
color: #828CA0;
line-height: 1.6;
}
.status-desc .highlight {
color: #007FFF;
}
.status-sub {
font-size: 13px;
color: #999;
}
.info-section {
background-color: #fff;
margin-bottom: 10px;
padding: 15px;
}
.section-title {
font-size: 18px;
font-weight: 500; font-weight: 500;
color: #333; color: #333;
margin-bottom: 10px;
display: block; display: block;
}
.section-tip {
display: inline-flex;
align-items: center;
gap: 5px;
margin-bottom: 15px; margin-bottom: 15px;
border-radius: 20px;
padding: 1px 30px 1px 6px;
background: #007FFF19;
} }
.status-desc { .tip-text {
font-size: 14px; font-size: 10px;
color: #1A1A1AFF;
}
.section-desc {
font-size: 12px;
color: #666; color: #666;
line-height: 1.6; margin-bottom: 15px;
display: block;
}
.form-item {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 16px;
}
.form-item:last-child {
margin-bottom: 0;
} }
/* 按钮样式 */ .label-text {
.button-container { font-size: 14px;
color: #333;
width: 90px;
flex-shrink: 0;
}
.required {
color: #ff4d4f;
}
.value-text {
flex: 1;
font-size: 14px;
color: #333;
}
.upload-section {
display: flex;
gap: 15px;
}
.upload-item {
flex: 1;
}
.upload-placeholder {
width: 100%;
height: 120px;
border-radius: 8px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fafafa;
}
.upload-text {
font-size: 12px;
color: #999;
margin-top: 8px;
}
.idcard-image {
width: 100%; width: 100%;
padding: 0 20px; height: 120px;
border-radius: 8px;
background-color: #fafafa;
}
.contract-section {
background-color: #fff;
padding: 15px;
margin-bottom: 10px;
}
.section-title {
font-size: 16px;
font-weight: 500;
color: #333;
margin-bottom: 12px;
} }
.first-button { .sticky-title {
position: sticky;
top: 0;
background: #fff;
z-index: 100;
padding: 15px 15px 12px;
margin: 0 -15px 12px;
}
.contract-content {
background: #F8F8F8;
padding: 12px;
border-radius: 8px; border-radius: 8px;
} }
.content-text {
font-size: 14px;
line-height: 1.6;
color: #333;
}
.sign-notice {
padding: 0 0 12px;
text-align: center;
font-size: 12px;
color: #999;
line-height: 1.5;
}
.sign-notice text {
display: block;
}
.footer-submit-bar {
position: fixed;
right: 0;
bottom: 0;
left: 0;
z-index: 101;
padding: 12px 15px calc(12px + env(safe-area-inset-bottom));
background-color: #fff;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
</style> </style>
<template> <template>
<view class="dealer-application-container"> <view class="dealer-application-container">
<uni-forms ref="form" :model="formData" :rules="rules"> <view class="form-content">
<!-- 个人信息部分 --> <uni-forms ref="form" :model="formData" :rules="rules">
<view class="form-section"> <!-- 个人信息部分 -->
<text class="section-title">请完善您的个人信息</text> <view class="form-section">
<text class="section-title">请完善您的个人信息</text>
<view class="section-tip">
<van-image width="16" height="16" fit="cover" src="/static/images/account/certifition/certifition.png" style="margin-top: 3px"></van-image> <view class="section-tip">
<text class="tip-text">信息用于开通车商服务,您的资料将被严格保密</text> <van-image width="16" height="16" fit="cover" src="/static/images/account/certifition/certifition.png" style="margin-top: 3px"></van-image>
</view> <text class="tip-text">信息用于开通车商服务,您的资料将被严格保密</text>
</view>
<uni-forms-item label="" name="accountName" required> <uni-forms-item label="" name="accountName" required>
<view class="form-item"> <view class="form-item">
<text class="label-text">真实姓名</text> <text class="label-text">真实姓名</text>
<uni-easyinput v-model="formData.accountName" placeholder="请输入真实姓名" :maxlength="18" :inputBorder="false"/> <uni-easyinput v-model="formData.accountName" placeholder="请输入真实姓名" :maxlength="18" :inputBorder="false"/>
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="" name="idCard" required> <uni-forms-item label="" name="idCard" required>
<view class="form-item"> <view class="form-item">
<text class="label-text">身份证号</text> <text class="label-text">身份证号</text>
<uni-easyinput v-model="formData.idCard" placeholder="请输入身份证号码" type="idcard" :maxlength="18" :inputBorder="false"/> <uni-easyinput v-model="formData.idCard" placeholder="请输入身份证号码" type="idcard" :maxlength="18" :inputBorder="false"/>
</view> </view>
</uni-forms-item> </uni-forms-item>
</view> </view>
<!-- 身份证照片上传部分 --> <!-- 身份证照片上传部分 -->
<view class="form-section"> <view class="form-section">
<text class="section-title">上传身份证照片</text> <text class="section-title">上传身份证照片</text>
<text class="section-desc">请上传本人的身份证照片,证件信息仅用于身份认证</text> <text class="section-desc">请上传本人的身份证照片,证件信息仅用于身份认证</text>
<view class="upload-section"> <view class="upload-section">
<view class="upload-item"> <view class="upload-item">
<uni-file-picker fileMediatype="image" :image-styles="imageStyles" @select="selectFile($event,'front')" mode="grid" :auto-upload="true" <uni-file-picker fileMediatype="image" :image-styles="imageStyles" @select="selectFile($event,'front')" mode="grid" :auto-upload="true"
:limit="1" file-extname="png,jpg,jpeg"> :limit="1" file-extname="png,jpg,jpeg">
<view class="upload-placeholder"> <view class="upload-placeholder">
<image src="~@/static/images/account/certifition/idcard_0@2x.png" style="width: 100%; height: 150px;"></image> <image src="~@/static/images/account/certifition/idcard_0@2x.png" style="width: 100%; height: 150px;"></image>
<text class="upload-text">上传人像面</text> <text class="upload-text">上传人像面</text>
</view> </view>
</uni-file-picker> </uni-file-picker>
</view> </view>
<view class="upload-item"> <view class="upload-item">
<uni-file-picker fileMediatype="image" :image-styles="imageStyles" @select="selectFile($event,'back')" :limit="1" file-extname="png,jpg,jpeg"> <uni-file-picker fileMediatype="image" :image-styles="imageStyles" @select="selectFile($event,'back')" :limit="1" file-extname="png,jpg,jpeg">
<view class="upload-placeholder"> <view class="upload-placeholder">
<image class="add-img" src="~@/static/images/account/certifition/idcard_1@2x.png" style="width: 100%; height: 150px;"></image> <image class="add-img" src="~@/static/images/account/certifition/idcard_1@2x.png" style="width: 100%; height: 150px;"></image>
<text class="upload-text">上传国徽面</text> <text class="upload-text">上传国徽面</text>
</view> </view>
</uni-file-picker> </uni-file-picker>
</view>
</view> </view>
</view> </view>
</uni-forms>
</view>
<!-- 合同内容查看 -->
<view class="contract-section">
<view class="section-title sticky-title">平台交易整体合同</view>
<view class="contract-content">
<rich-text class="content-text" :nodes="htmlContent"></rich-text>
</view> </view>
<!-- <view class="form-section">--> </view>
<!-- <uni-forms-item label="" name="recommendCode">-->
<!-- <view class="form-item">--> <!-- 底部固定提交按钮 -->
<!-- <text class="label-text">推荐码</text>--> <view class="footer-submit-bar">
<!-- <uni-easyinput v-model="formData.recommendCode" placeholder="请输入推荐码" :inputBorder="false"/>--> <van-button type="primary" :disabled="!isFormValid" round @click="submitForm" block>提交认证</van-button>
<!-- </view>--> </view>
<!-- </uni-forms-item>-->
<!-- </view>-->
<!-- 提交按钮 -->
<view class="submit-button-container">
<van-button type="primary" :disabled="!isFormValid" round @click="submitForm" block>提交</van-button>
</view>
</uni-forms>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -74,7 +78,7 @@ import {AccountController} from "@/api/AccountController"; ...@@ -74,7 +78,7 @@ import {AccountController} from "@/api/AccountController";
import type {FileInfo} from "lib/src/core/bean/FileInfo"; import type {FileInfo} from "lib/src/core/bean/FileInfo";
import {AuthService} from "@/common/AuthService"; import {AuthService} from "@/common/AuthService";
import {ID_CARD_18_REGEX} from "@/common/CommonUtils"; import {ID_CARD_18_REGEX} from "@/common/CommonUtils";
import {AgreementController} from "@/api/AgreementController"
@Component({}) @Component({})
export default class PersonCertificationPage extends Vue { export default class PersonCertificationPage extends Vue {
formData: Certification = null; formData: Certification = null;
...@@ -90,6 +94,7 @@ export default class PersonCertificationPage extends Vue { ...@@ -90,6 +94,7 @@ export default class PersonCertificationPage extends Vue {
isFormValid = false; isFormValid = false;
agreement: {content: string} = null;
// 110101199001011234 // 110101199001011234
rules = { rules = {
...@@ -117,11 +122,28 @@ export default class PersonCertificationPage extends Vue { ...@@ -117,11 +122,28 @@ export default class PersonCertificationPage extends Vue {
}); });
const recommendCode = uni.getStorageSync('recommendCode'); const recommendCode = uni.getStorageSync('recommendCode');
console.log("recommendCode:" + recommendCode); console.log("recommendCode:" + recommendCode);
// if (recommendCode) { AgreementController.getAgreementByKey(this.axios, 'PLATFORM_CONTRACT').then(res => {
// this.formData.recommendCode = recommendCode; this.agreement = res.data || {};
// } }).catch(() => {
this.agreement = {};
});
}); });
}
get htmlContent(): string {
console.log('htmlContent: this.agreement?.content =', this.agreement?.content);
return this.formatRichText(this.agreement?.content ?? "");
}
formatRichText(html: string) {
// 移除 mce 前缀类名
html = html.replace(/class="mce-.*?"/g, '');
// 移除固定宽度样式
html = html.replace(/width:\s*\d+px;/g, '');
// 移除内联 style 中的 height(保留 auto)
html = html.replace(/height:\s*\d+px;/g, 'height: auto;');
html = html.replace(/<(\/)?pre[^>]*>/gi, '');
return html;
} }
@Watch("formData", {deep: true, immediate: true}) @Watch("formData", {deep: true, immediate: true})
...@@ -238,7 +260,7 @@ export default class PersonCertificationPage extends Vue { ...@@ -238,7 +260,7 @@ export default class PersonCertificationPage extends Vue {
.dealer-application-container { .dealer-application-container {
min-height: 100vh; min-height: 100vh;
background-color: #f5f5f5; background-color: #f5f5f5;
padding-bottom: 30px; padding-bottom: calc(64px + env(safe-area-inset-bottom));
} }
...@@ -261,6 +283,38 @@ export default class PersonCertificationPage extends Vue { ...@@ -261,6 +283,38 @@ export default class PersonCertificationPage extends Vue {
display: block; display: block;
} }
.sticky-title {
position: sticky;
top: 0;
background: #fff;
z-index: 100;
padding: 15px 15px 10px;
margin: 0 -15px 10px;
}
.contract-section {
background-color: #fff;
padding: 15px;
margin-bottom: 10px;
}
.contract-content {
background: #F8F8F8;
padding: 8px 12px;
border-radius: 8px;
}
.footer-submit-bar {
position: fixed;
right: 0;
bottom: 0;
left: 0;
z-index: 101;
padding: 12px 15px calc(12px + env(safe-area-inset-bottom));
background-color: #fff;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
.section-tip { .section-tip {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
...@@ -332,9 +386,10 @@ export default class PersonCertificationPage extends Vue { ...@@ -332,9 +386,10 @@ export default class PersonCertificationPage extends Vue {
} }
/* 提交按钮样式 */ .content-text {
.submit-button-container { font-size: 14px;
padding: 20px 15px 0; line-height: 1.6;
color: #333;
} }
</style> </style>
...@@ -393,7 +393,9 @@ ...@@ -393,7 +393,9 @@
@close="closeBidSuccessDialog"></bid-success-dialog> @close="closeBidSuccessDialog"></bid-success-dialog>
</van-dialog> </van-dialog>
</view> </view>
<van-dialog use-slot :show="showCertifyDialog" :show-cancel-button="false" :show-confirm-button="false">
<certification-dialog @close="onCertifyDialogClosed"></certification-dialog>
</van-dialog>
<coupon-home-benefit-popup v-if="!isSinglePageMode" :show="showCouponBenefitPopup" :payload="couponBenefitPayload" <coupon-home-benefit-popup v-if="!isSinglePageMode" :show="showCouponBenefitPopup" :payload="couponBenefitPayload"
@close="onCouponBenefitPopupClose" /> @close="onCouponBenefitPopupClose" />
...@@ -429,7 +431,7 @@ import roundBidBottom from "@/module/auction/roundBidBottom.vue"; ...@@ -429,7 +431,7 @@ import roundBidBottom from "@/module/auction/roundBidBottom.vue";
import RoundBidPopup from "@/components/RoundBidPopup.vue"; import RoundBidPopup from "@/components/RoundBidPopup.vue";
import customNav from "@/module/auction/customNav.vue"; import customNav from "@/module/auction/customNav.vue";
import InspectionReport from "@/module/auction/InspectionReport.vue"; import InspectionReport from "@/module/auction/InspectionReport.vue";
import CertificationDialog from "@/pages/tabbar/home/CertificationDialog.vue";
/** /**
* 检测是否处于微信朋友圈/短链「单页模式」。 * 检测是否处于微信朋友圈/短链「单页模式」。
* 必须在类字段初始化阶段同步调用:冷启动时 composable onLoad 可能尚未执行, * 必须在类字段初始化阶段同步调用:冷启动时 composable onLoad 可能尚未执行,
...@@ -468,7 +470,7 @@ function parseAucvehIdFromEnterOptions(): number | undefined { ...@@ -468,7 +470,7 @@ function parseAucvehIdFromEnterOptions(): number | undefined {
} }
@Component({ @Component({
components: { BidSuccessDialog, roundBidBottom, RoundBidPopup, customNav, InspectionReport, CouponHomeBenefitPopup } components: { CertificationDialog, BidSuccessDialog, roundBidBottom, RoundBidPopup, customNav, InspectionReport, CouponHomeBenefitPopup }
}) })
export default class AuctionVehiclePage extends Vue { export default class AuctionVehiclePage extends Vue {
...@@ -573,7 +575,9 @@ export default class AuctionVehiclePage extends Vue { ...@@ -573,7 +575,9 @@ export default class AuctionVehiclePage extends Vue {
lightBidPriceRange: LightBidPriceRange; lightBidPriceRange: LightBidPriceRange;
darkBidPriceRange: DarkBidPriceRange; darkBidPriceRange: DarkBidPriceRange;
/** 认证弹窗延迟定时器(避免重复 onShow 叠加多个定时器) */
certifyDelayTimer: ReturnType<typeof setTimeout> | null = null;
showCertifyDialog = false;
change(e: any) { change(e: any) {
// this.show = e.show // this.show = e.show
} }
...@@ -892,7 +896,7 @@ export default class AuctionVehiclePage extends Vue { ...@@ -892,7 +896,7 @@ export default class AuctionVehiclePage extends Vue {
// 代码请求优化 // 代码请求优化
const pages = getCurrentPages(); const pages = getCurrentPages();
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
//this.auctionVehicle.auctionState === 'SOLD' && //this.auctionVehicle.auctionState === 'SOLD' &&
if (this.$auth.isLogin() && currentPage.route == 'module/auction/AuctionVehiclePage') { if (this.$auth.isLogin() && currentPage.route == 'module/auction/AuctionVehiclePage') {
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
AuctionOrderController.getAuctionOrderByVehicleId(this.axios, this.vehicle.vehicleId).then(res => { AuctionOrderController.getAuctionOrderByVehicleId(this.axios, this.vehicle.vehicleId).then(res => {
...@@ -1088,6 +1092,10 @@ export default class AuctionVehiclePage extends Vue { ...@@ -1088,6 +1092,10 @@ export default class AuctionVehiclePage extends Vue {
} }
} }
onCertifyDialogClosed(): void {
this.showCertifyDialog = false;
}
// 增加出价金额 // 增加出价金额
addBidAmount(price: number) { addBidAmount(price: number) {
this.currentAddPrice = price; this.currentAddPrice = price;
...@@ -1157,6 +1165,15 @@ export default class AuctionVehiclePage extends Vue { ...@@ -1157,6 +1165,15 @@ export default class AuctionVehiclePage extends Vue {
} }
} }
}); });
} else if (reason.data && reason.data.code === "platformContract") {
if (this.certifyDelayTimer != null) {
clearTimeout(this.certifyDelayTimer);
this.certifyDelayTimer = null;
}
this.certifyDelayTimer = setTimeout(() => {
this.certifyDelayTimer = null;
this.showCertifyDialog = true;
}, 1000);
} }
}).finally(() => { }).finally(() => {
uni.hideLoading(); uni.hideLoading();
......
...@@ -328,7 +328,7 @@ ...@@ -328,7 +328,7 @@
{ {
"path": "CompanyCertificationPage", "path": "CompanyCertificationPage",
"style": { "style": {
"navigationBarTitleText": "成为车商", "navigationBarTitleText": "升级参拍权",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
...@@ -588,4 +588,4 @@ ...@@ -588,4 +588,4 @@
"van-count-down": "/wxcomponents/vant/weapp/count-down/index" "van-count-down": "/wxcomponents/vant/weapp/count-down/index"
} }
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -32,8 +32,10 @@ ...@@ -32,8 +32,10 @@
</view> </view>
<text class="agreement-text"> <text class="agreement-text">
阅读并同意 阅读并同意
<text class="agreement-link" @click="viewUserAgreement">《优加车拍二手车用户协议》</text> <text class="agreement-link" @click="viewAgreement('ACCOUNT')">《用户协议》</text>
<text class="agreement-link" @click="viewPrivacyAgreement">《优加车拍二手车隐私协议》</text> <text class="agreement-link" @click="viewAgreement('PRIVACY')">《隐私协议》</text>
<text class="agreement-link" @click="viewAgreement('PURCHASE_CONTRACT')">《购车合同》</text>
<text class="agreement-link" @click="viewAgreement('AUCTION')">《竞拍规则》</text>
未登录用户默认注册为平台会员 未登录用户默认注册为平台会员
</text> </text>
</view> </view>
...@@ -139,14 +141,9 @@ export default class LoginPage extends Vue { ...@@ -139,14 +141,9 @@ export default class LoginPage extends Vue {
this.isAgreed = !this.isAgreed; this.isAgreed = !this.isAgreed;
} }
// 查看用户协议 // 查看协议
viewUserAgreement() { viewAgreement(key) {
uni.navigateTo({url: '/module/profile/AgreementPage?key=ACCOUNT'}); uni.navigateTo({url: `/module/profile/AgreementPage?key=${key}`});
}
// 查看隐私协议
viewPrivacyAgreement() {
uni.navigateTo({url: '/module/profile/AgreementPage?key=PRIVACY'});
} }
} }
</script> </script>
......
...@@ -332,10 +332,9 @@ export default class HomePage extends Vue { ...@@ -332,10 +332,9 @@ export default class HomePage extends Vue {
return; return;
} }
const accountInfo = authService.getAuthentication(); const accountInfo = authService.getAuthentication();
/** 仅未认证/认证失败的 COMMON 用户走认证引导;已认证用户直接进入权益弹窗链路 */ /** 仅未认证/认证失败的 COMMON 用户走认证引导 或者未签署平台合同;已认证用户直接进入权益弹窗链路 */
const cs = accountInfo?.certifiedState; const cs = accountInfo?.certifiedState;
const needP1 = !!(accountInfo && accountInfo.accountType === 'COMMON' && cs !== 'CERTIFICATING' && cs !== 'CERTIFIED'); const needP1 = (!!(accountInfo && accountInfo.accountType === 'COMMON' && cs !== 'CERTIFICATING' && cs !== 'CERTIFIED') || (accountInfo && !accountInfo.platformContractSigned));
if (needP1) { if (needP1) {
if (this.certifyDelayTimer != null) { if (this.certifyDelayTimer != null) {
clearTimeout(this.certifyDelayTimer); clearTimeout(this.certifyDelayTimer);
......
...@@ -54,39 +54,57 @@ ...@@ -54,39 +54,57 @@
<template v-if="accountInfo"> <template v-if="accountInfo">
<template v-if="accountInfo.accountType === 'COMMON'"> <template v-if="accountInfo.accountType === 'COMMON'">
<template v-if="accountInfo?.certifiedState === 'UNCERTIFIED'"> <template v-if="accountInfo?.certifiedState === 'UNCERTIFIED'">
<account-auth-section title="获得参拍权" desc="让每一次拍得得心应手" button="立即开通" <account-auth-section title="完成认证,解锁竞拍权限" desc="出价前需完成验证" button="去认证"
url="/module/account/PersonCertificationPage"></account-auth-section> url="/module/account/PersonCertificationPage"></account-auth-section>
</template> </template>
<template v-if="accountInfo?.certifiedState === 'CERTIFICATING'"> <template v-if="accountInfo?.certifiedState === 'CERTIFICATING'">
<account-auth-section title="认证资料审核中" desc="认证资料审核中" button="查看详情" <account-auth-section title="认证资料审核中" desc="出价前需完成验证" button="去查看"
url="/module/account/CertificationResult"></account-auth-section> url="/module/account/CertificationResult"></account-auth-section>
</template> </template>
<template v-if="accountInfo?.certifiedState === 'CERTIFY_FAILED'"> <template v-if="accountInfo?.certifiedState === 'CERTIFY_FAILED'">
<account-auth-section title="认证失败" desc="让获得更专业的服务" button="查看详情" <account-auth-section title="认证失败,请重新认证" desc="出价前需完成验证" button="去认证"
url="/module/account/CertificationResult"></account-auth-section> url="/module/account/CertificationResult"></account-auth-section>
</template> </template>
</template> </template>
<template v-if="accountInfo.accountType === 'PERSON'"> <template v-if="accountInfo.accountType === 'PERSON'">
<!-- 个人未认证 -->
<template <template
v-if="accountInfo?.certifiedState === 'UNCERTIFIED' || accountInfo?.certifiedState === 'CERTIFIED'"> v-if="accountInfo?.certifiedState === 'UNCERTIFIED'">
<account-auth-section title="升级参拍权" desc="让获得更专业的服务" button="立即升级" <account-auth-section title="完成认证,解锁竞拍权限" desc="出价前需完成验证" button="去认证"
url="/module/account/CompanyCertificationPage"></account-auth-section> url="/module/account/PersonCertificationPage"></account-auth-section>
</template> </template>
<!-- 个人认证中 -->
<template v-if="accountInfo?.certifiedState === 'CERTIFICATING'"> <template v-if="accountInfo?.certifiedState === 'CERTIFICATING'">
<account-auth-section title="认证资料审核中" desc="认证资料审核中" button="查看详情" <account-auth-section title="认证资料审核中" desc="出价前需完成验证" button="去查看"
url="/module/account/CertificationResult"></account-auth-section> url="/module/account/CertificationResult"></account-auth-section>
</template> </template>
<!-- 个人认证失败 -->
<template v-if="accountInfo?.certifiedState === 'CERTIFY_FAILED'"> <template v-if="accountInfo?.certifiedState === 'CERTIFY_FAILED'">
<account-auth-section title="认证失败" desc="让获得更专业的服务" button="查看详情" <account-auth-section title="认证失败,请重新认证" desc="出价前需完成验证" button="去认证"
url="/module/account/CertificationResult"></account-auth-section>
</template>
<!-- 个人认证成功未签署合同 -->
<template v-if="accountInfo?.certifiedState === 'CERTIFIED' && !accountInfo?.platformContractSigned && !accountInfo?.signDeadline">
<account-auth-section title="认证成功,待签署合同" desc="合同签署成功后即可参拍" button="去签署"
url="/module/account/CertificationResult"></account-auth-section> url="/module/account/CertificationResult"></account-auth-section>
</template> </template>
<!-- 合同签署中 -->
<template v-if="accountInfo?.certifiedState === 'CERTIFIED' && isSignDeadline">
<account-auth-section title="合同签署中" desc="合同签署成功后即可参拍" button="去查看"
url="/module/account/CertificationResult"></account-auth-section>
</template>
<!-- 升级到车商参拍权 -->
<template v-if="accountInfo?.certifiedState === 'CERTIFIED' && accountInfo?.platformContractSigned && accountInfo?.platformContractSignTime">
<account-auth-section title="恭喜你,获得参拍资格" desc="点击查看按钮可继续升级参拍权" button="去查看"
url="/module/account/CompanyCertificationPage"></account-auth-section>
</template>
</template> </template>
<template v-if="accountInfo.accountType === 'COMPANY'"> <template v-if="accountInfo.accountType === 'COMPANY'">
</template> </template>
</template> </template>
<template v-else> <template v-else>
<account-auth-section title="获得参拍权" desc="让每一次拍得得心应手" button="立即开通" <account-auth-section title="完成认证,解锁竞拍权限" desc="出价前需完成验证" button="去认证"
url="/pages/LoginPage"></account-auth-section> url="/pages/LoginPage"></account-auth-section>
</template> </template>
<!-- 常用工具 --> <!-- 常用工具 -->
...@@ -373,6 +391,25 @@ export default class ProfilePage extends Vue { ...@@ -373,6 +391,25 @@ export default class ProfilePage extends Vue {
return couponImageUrl("ticket.png"); return couponImageUrl("ticket.png");
} }
/**
* 判断签署截止时间是否大于当前时间
* 用于显示"合同签署中"状态
*/
get isSignDeadline(): boolean {
if (!this.accountInfo?.signDeadline) {
return false;
}
try {
const signDeadline = new Date(this.accountInfo.signDeadline);
const now = new Date();
return signDeadline > now;
} catch (error) {
console.error('签署截止时间解析失败:', error);
return false;
}
}
previewAvatar(): void { previewAvatar(): void {
if (this.accountInfo?.avatar && this.accountInfo.avatar?.url) { if (this.accountInfo?.avatar && this.accountInfo.avatar?.url) {
uni.previewImage({ urls: [this.accountInfo.avatar.url], current: 0 }); uni.previewImage({ urls: [this.accountInfo.avatar.url], current: 0 });
......
<template> <template>
<view class="dialog-container"> <view class="dialog-container">
<view class="dialog-body"> <view class="dialog-body">
<view class="dialog-close" @click="closeDialog">
<text class="close-icon">×</text>
</view>
<view class="dialog-icon"> <view class="dialog-icon">
<van-image width="80" height="88" fit="cover" src="/static/images/account/certifition/certifition.png"></van-image> <van-image width="80" height="88" fit="cover" src="/static/images/account/certifition/certifition.png"></van-image>
</view> </view>
...@@ -8,97 +11,105 @@ ...@@ -8,97 +11,105 @@
完成本人认证 完成本人认证
</view> </view>
<view class="dialog-content"> <view class="dialog-content">
<text>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;完成后,您将获得在我们平台上架车辆的权限,享受安全、高效的交易环境</text> <text>认证完成后,您将解锁海量优质车源的竞拍购车权限,畅享透明、安全、高效的在线交易体验。</text>
</view> </view>
<view class="dialog-footer"> <view class="dialog-footer">
<van-button type="primary" hairline round block @click="goCertification">立即认证</van-button> <van-button type="primary" round block @click="goCertification">立即认证</van-button>
<view @click="closeDialog" class="popup-button-text">稍后认证</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from "vue-facing-decorator"; import {Component, Vue} from "vue-facing-decorator";
import { AuthService } from "@/common/AuthService";
@Component({ @Component({
components: {} components: {}
}) })
export default class CertificationDialog extends Vue { export default class CertificationDialog extends Vue {
goCertification(): void { goCertification(): void {
const authService: AuthService = this.$auth
this.$emit('close'); this.$emit('close');
uni.navigateTo({url: '/module/account/PersonCertificationPage'}); if (authService.accountInfo.certifiedState == 'UNCERTIFIED') {
uni.navigateTo({url: '/module/account/PersonCertificationPage'})
} else {
uni.navigateTo({url: '/module/account/CertificationResult'})
}
} }
closeDialog(): void { closeDialog(): void {
this.$emit('close'); this.$emit('close');
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog-container { .dialog-container {
//height: 200px; display: flex;
//min-height: 100vh; align-items: center;
/* 避免内容被顶部导航栏遮挡(可选) */ justify-content: center;
//padding-top: var(--status-bar-height); width: 100%;
//box-sizing: border-box; height: 100%;
} }
.bg-image { .dialog-body {
background-attachment: inherit; /* 将背景图固定不动 */ position: relative;
padding: 32px 24px 28px;
background: #fff;
border-radius: 16px;
box-sizing: border-box;
} }
.dialog-body { .dialog-close {
padding: 20px; position: absolute;
top: 12px;
right: 12px;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
.close-icon {
font-size: 22px;
color: #999;
line-height: 1;
} }
.dialog-icon { .dialog-icon {
text-align: center; text-align: center;
margin-bottom: 16px;
} }
.dialog-header { .dialog-header {
position: relative; font-size: 20px;
font-size: 22px; font-weight: 500;
font-weight: 400;
color: #141E34; color: #141E34;
text-align: center; text-align: center;
margin-top: 20px; margin-bottom: 12px;
margin-bottom: 10px;
} }
.dialog-content { .dialog-content {
position: relative; padding: 0 4px 24px;
padding: 4px 20px 12px 20px; text-align: center;
text { text {
text-indent: 2em;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
line-height: 18.2px; line-height: 1.6;
color: #676D7D; color: #676D7D;
text-justify: newspaper;
} }
} }
.dialog-footer { .dialog-footer {
margin-top: 20px;
position: relative; position: relative;
display: flex;
flex-direction: column;
gap: 3px;;
} }
.popup-button-text { .dialog-footer ::v-deep .van-button--primary {
width: 100%; background: #347BFF;
height: 20px; border-color: #347BFF;
float: left; height: 44px;
line-height: 20px; font-size: 16px;
color: #666666; font-weight: 500;
font-size: 14px;
font-weight: 常规体;
font-family: "苹方-简";
text-align: center;
cursor: pointer;
margin-top: 16px;
} }
</style> </style>
...@@ -50,8 +50,8 @@ export class Agreement extends AuditingEntity { ...@@ -50,8 +50,8 @@ export class Agreement extends AuditingEntity {
* ABOUT_US 关于我们 * ABOUT_US 关于我们
* COUPON_1 ~ COUPON_5 优惠券协议(多档活动可分别配置) * COUPON_1 ~ COUPON_5 优惠券协议(多档活动可分别配置)
*/ */
export type Agreement_AgreementKey = 'AUCTION'|'TRANSACTION'|'VIOLATION'|'CONTRACT'|'ACCOUNT'|'PRIVACY'|'ABOUT_US'|'FAPAI_ACCOUNT'|'FAPAI_PRIVACY'|'COUPON_1'|'COUPON_2'|'COUPON_3'|'COUPON_4'|'COUPON_5'; export type Agreement_AgreementKey = 'AUCTION'|'TRANSACTION'|'VIOLATION'|'CONTRACT'|'ACCOUNT'|'PRIVACY'|'ABOUT_US'|'FAPAI_ACCOUNT'|'FAPAI_PRIVACY'|'COUPON_1'|'COUPON_2'|'COUPON_3'|'COUPON_4'|'COUPON_5'|'PURCHASE_CONTRACT'|'PLATFORM_CONTRACT';
export const AGREEMENT_AGREEMENT_KEYS = ['AUCTION','TRANSACTION','VIOLATION','CONTRACT','ACCOUNT','PRIVACY','ABOUT_US', 'FAPAI_ACCOUNT', 'FAPAI_PRIVACY', 'COUPON_1', 'COUPON_2', 'COUPON_3', 'COUPON_4', 'COUPON_5']; export const AGREEMENT_AGREEMENT_KEYS = ['AUCTION','TRANSACTION','VIOLATION','CONTRACT','ACCOUNT','PRIVACY','ABOUT_US', 'FAPAI_ACCOUNT', 'FAPAI_PRIVACY', 'COUPON_1', 'COUPON_2', 'COUPON_3', 'COUPON_4', 'COUPON_5', 'PURCHASE_CONTRACT', 'PLATFORM_CONTRACT'];
/** /**
* DRAFT 草稿 * DRAFT 草稿
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!