2025-02-06 02:20:11 +00:00
|
|
|
|
<script setup>
|
2025-02-26 03:51:21 +00:00
|
|
|
|
import pdfView from './pdfView/index.vue'
|
2025-03-14 01:48:26 +00:00
|
|
|
|
import { contractView, signOffline } from "~/api/goods/index.js"
|
|
|
|
|
import { codeAuthStore } from "~/stores-collect-code/auth/index.js"
|
|
|
|
|
import { useI18n } from "vue-i18n"
|
|
|
|
|
import { fddInfo } from "@/api-collect-code/goods/index.js"
|
2025-03-14 02:07:39 +00:00
|
|
|
|
import { showLoadingToast } from 'vant';
|
2025-02-19 10:19:57 +00:00
|
|
|
|
definePageMeta({
|
2025-02-26 03:51:21 +00:00
|
|
|
|
i18n: 'signature.protocol.title'
|
2025-02-21 03:19:15 +00:00
|
|
|
|
})
|
|
|
|
|
|
2025-03-14 01:48:26 +00:00
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
const { formData, number, qrData } = codeAuthStore()
|
2025-03-14 02:07:39 +00:00
|
|
|
|
const activeNames = ref('')
|
2025-02-21 03:19:15 +00:00
|
|
|
|
const router = useRouter()
|
2025-03-14 01:48:26 +00:00
|
|
|
|
const pmblUrl = ref('')
|
2025-02-21 03:19:15 +00:00
|
|
|
|
|
2025-03-14 01:48:26 +00:00
|
|
|
|
/**
|
|
|
|
|
* 根据签署顺序(number)返回不同的协议列表
|
|
|
|
|
* number = 1: 买家签署阶段,展示竞买协议、竞买须知、拍卖公告、拍卖规则
|
|
|
|
|
* number = 2: 卖家签署阶段,展示拍卖成交确认书、拍卖笔录
|
|
|
|
|
*/
|
2025-02-21 03:19:15 +00:00
|
|
|
|
const protocolList = computed(() => {
|
2025-03-14 01:48:26 +00:00
|
|
|
|
if (number.value === 1) {
|
|
|
|
|
return [
|
|
|
|
|
{ id: '4', title: t('signature.agreement.buyerAgreement'), pdfName: 'jmxy', type: 'local' },
|
|
|
|
|
{ id: '3', title: t('signature.agreement.buyerGuide'), pdfName: 'jmxz', type: 'local' },
|
|
|
|
|
{ id: '1', title: t('signature.agreement.notice'), pdfName: 'pmgg', type: 'local' },
|
|
|
|
|
{ id: '2', title: t('signature.agreement.rules'), pdfName: 'pmgz', type: 'local' },
|
|
|
|
|
]
|
|
|
|
|
} else if (number.value === 2) {
|
|
|
|
|
return [
|
|
|
|
|
{ id: '6', title: t('signature.agreement.transfer'), pdfName: 'pmyjqrs', type: 'local' },
|
|
|
|
|
{ id: '5', title: t('signature.agreement.record'), pdfName: pmblUrl.value, type: 'remote' }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
return []
|
2025-02-19 10:19:57 +00:00
|
|
|
|
})
|
2025-02-21 03:19:15 +00:00
|
|
|
|
|
2025-03-14 01:48:26 +00:00
|
|
|
|
/**
|
|
|
|
|
* 获取拍卖笔录PDF
|
|
|
|
|
* 通过拍品UUID获取拍卖笔录的查看地址
|
|
|
|
|
*/
|
2025-02-21 03:19:15 +00:00
|
|
|
|
const fetchPmblPdf = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const res = await contractView({
|
|
|
|
|
auctionArtworkUuid: qrData.value.auctionArtworkUuid,
|
|
|
|
|
})
|
2025-03-14 01:48:26 +00:00
|
|
|
|
pmblUrl.value = res.data?.viewUrl
|
2025-02-21 03:19:15 +00:00
|
|
|
|
} catch (error) {
|
2025-03-14 01:48:26 +00:00
|
|
|
|
console.error('获取拍卖笔录失败:', error)
|
|
|
|
|
}
|
2025-02-21 03:19:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-14 01:48:26 +00:00
|
|
|
|
/**
|
|
|
|
|
* 折叠面板变化处理
|
|
|
|
|
* 当打开拍卖笔录面板时,获取PDF地址
|
|
|
|
|
*/
|
2025-02-21 03:19:15 +00:00
|
|
|
|
const handleCollapseChange = (name) => {
|
|
|
|
|
activeNames.value = name
|
|
|
|
|
if (name === '5' && !pmblUrl.value) {
|
|
|
|
|
fetchPmblPdf()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-14 01:48:26 +00:00
|
|
|
|
/**
|
|
|
|
|
* 确认签署处理
|
|
|
|
|
* 1. 获取用户法大大认证信息
|
|
|
|
|
* 2. 根据用户类型和地区判断签署流程:
|
|
|
|
|
* - 特殊用户且isMainland=1: 走大陆签署流程
|
|
|
|
|
* - 特殊用户且isMainland=0: 走非大陆签署流程
|
|
|
|
|
* - 普通用户:
|
|
|
|
|
* - 大陆用户(countryCode=86且身份证): 走大陆签署流程
|
|
|
|
|
* - 其他用户: 走非大陆签署流程
|
|
|
|
|
*/
|
|
|
|
|
const confirm = async () => {
|
2025-03-14 02:07:39 +00:00
|
|
|
|
const toast= showLoadingToast({
|
|
|
|
|
message: '加载中...',
|
|
|
|
|
forbidClick: true,
|
|
|
|
|
});
|
|
|
|
|
|
2025-03-14 01:48:26 +00:00
|
|
|
|
try {
|
|
|
|
|
const fddResponse = await fddInfo({ phone: formData.value.phone })
|
|
|
|
|
|
|
|
|
|
if (fddResponse.status === 0) {
|
|
|
|
|
const { userId, isMainland } = fddResponse.data
|
|
|
|
|
|
|
|
|
|
// 特殊用户处理逻辑
|
|
|
|
|
if (userId) {
|
|
|
|
|
if (isMainland === 1) {
|
|
|
|
|
await handleMainlandSign()
|
|
|
|
|
} else {
|
|
|
|
|
router.push('/collectCode/signature/panel')
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 普通用户处理逻辑
|
|
|
|
|
const isMainlandUser = formData.value.countryCode === '86' && formData.value.cardType === 1
|
|
|
|
|
if (isMainlandUser) {
|
|
|
|
|
await handleMainlandSign()
|
|
|
|
|
} else {
|
|
|
|
|
router.push('/collectCode/signature/panel')
|
|
|
|
|
}
|
2025-02-19 10:19:57 +00:00
|
|
|
|
}
|
2025-03-14 01:48:26 +00:00
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('签署确认失败:', error)
|
2025-03-14 02:07:39 +00:00
|
|
|
|
}finally{
|
|
|
|
|
toast1.close();
|
2025-02-19 07:14:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-03-14 01:48:26 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 处理大陆用户签署流程
|
|
|
|
|
*/
|
|
|
|
|
const handleMainlandSign = async () => {
|
|
|
|
|
const res = await signOffline({
|
|
|
|
|
userInfo: formData.value,
|
|
|
|
|
auctionArtworkUuid: qrData.value.auctionArtworkUuid,
|
|
|
|
|
signOrder: Number(number.value),
|
2025-02-21 03:19:15 +00:00
|
|
|
|
})
|
2025-03-14 01:48:26 +00:00
|
|
|
|
|
|
|
|
|
if (res.status === 0) {
|
|
|
|
|
window.location.href = res.data.fddVerifyUrl
|
|
|
|
|
}
|
2025-02-21 03:19:15 +00:00
|
|
|
|
}
|
2025-02-06 02:20:11 +00:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-02-21 03:19:15 +00:00
|
|
|
|
<div class="bg-#EBEBEB h-screen-nav flex flex-col">
|
2025-03-14 01:48:26 +00:00
|
|
|
|
<!-- 顶部提示信息 -->
|
2025-02-21 03:19:15 +00:00
|
|
|
|
<div class="h-50px text-14px text-#191919 bg-#fff flex items-center px-21px mb-6px shrink-0">
|
2025-02-25 11:17:34 +00:00
|
|
|
|
{{ t('signature.tips.prePayment') }}
|
2025-02-21 03:19:15 +00:00
|
|
|
|
</div>
|
2025-02-25 09:00:07 +00:00
|
|
|
|
|
2025-03-14 01:48:26 +00:00
|
|
|
|
<!-- 协议列表折叠面板 -->
|
2025-02-21 03:19:15 +00:00
|
|
|
|
<van-collapse
|
|
|
|
|
accordion
|
|
|
|
|
v-model="activeNames"
|
|
|
|
|
class="grow-1"
|
|
|
|
|
@change="handleCollapseChange"
|
|
|
|
|
>
|
|
|
|
|
<van-collapse-item
|
|
|
|
|
v-for="item in protocolList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:name="item.id"
|
|
|
|
|
class="mb-6px"
|
|
|
|
|
>
|
|
|
|
|
<template #title>
|
|
|
|
|
<div class="text-#2B53AC text-14px">{{ item.title }}</div>
|
|
|
|
|
</template>
|
2025-02-26 07:04:37 +00:00
|
|
|
|
<pdfView
|
2025-03-14 01:48:26 +00:00
|
|
|
|
:pdf-name="item.pdfName"
|
|
|
|
|
:type="item.type"
|
|
|
|
|
:is-active="activeNames === item.id"
|
2025-02-21 03:19:15 +00:00
|
|
|
|
/>
|
|
|
|
|
</van-collapse-item>
|
|
|
|
|
</van-collapse>
|
2025-02-25 09:00:07 +00:00
|
|
|
|
|
2025-03-14 01:48:26 +00:00
|
|
|
|
<!-- 底部确认按钮 -->
|
2025-02-21 03:19:15 +00:00
|
|
|
|
<div class="h-81px bg-#fff flex justify-center pt-7px border-t">
|
|
|
|
|
<van-button
|
|
|
|
|
color="#2B53AC"
|
|
|
|
|
class="w-213px van-btn-h-38px"
|
|
|
|
|
@click="confirm"
|
|
|
|
|
>
|
2025-02-25 11:17:34 +00:00
|
|
|
|
{{ t('signature.action.agree') }}
|
2025-02-21 03:19:15 +00:00
|
|
|
|
</van-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|