From f01d711d550feb8b4068e9dd106a043a64c9f108 Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Fri, 14 Mar 2025 09:48:26 +0800 Subject: [PATCH 1/6] 1231 --- .../signature/personal-Info/index.vue | 55 +++++-- .../collectCode/signature/protocol/index.vue | 139 ++++++++++++------ 2 files changed, 138 insertions(+), 56 deletions(-) diff --git a/app/pages/collectCode/signature/personal-Info/index.vue b/app/pages/collectCode/signature/personal-Info/index.vue index ccaa6dc..c9eaa05 100644 --- a/app/pages/collectCode/signature/personal-Info/index.vue +++ b/app/pages/collectCode/signature/personal-Info/index.vue @@ -26,6 +26,11 @@ const columns1 = ref([ {text: t('realAuth.passport'), value: 2}, {text: t('realAuth.other'), value: 3}, ]) + +/** + * 根据当前语言获取默认国家/地区信息 + * @returns {{zone: string, name: string}} 返回国家区号和名称 + */ const getDefaultCountry = () => { let defaultCode = 'CN' // 默认中国大陆 switch (locale.value) { @@ -53,11 +58,20 @@ const getDefaultCountry = () => { } } -const goCountryRegion=()=>{ +/** + * 跳转到国家/地区选择页面 + */ +const goCountryRegion = () => { router.push({ - path:'/countryRegion' + path: '/countryRegion' }) } + +/** + * 检查表单是否完整填写 + * @param {Object} obj - 要检查的表单对象 + * @returns {boolean} 是否完整 + */ function isFormComplete(obj) { for (const key in obj) { if (typeof obj[key] === 'object' && obj[key] !== null) { @@ -71,15 +85,25 @@ function isFormComplete(obj) { return true; } -const getData=async ()=>{ -const res=await offlineQrcode({ - qrUid:qrUid.value -}) - if (res.status===0){ - qrData.value=res.data +/** + * 获取线下二维码支付状态 + */ +const getData = async () => { + const res = await offlineQrcode({ + qrUid: qrUid.value + }) + if (res.status === 0) { + qrData.value = res.data } } -const initData= async ()=>{ + +/** + * 初始化页面数据 + * 1. 处理URL参数 + * 2. 检查支付状态(扫付款码场景) + * 3. 设置默认国家/地区信息 + */ +const initData = async () => { if (route.query.number){ number.value=Number(route.query.number) } @@ -101,7 +125,18 @@ const initData= async ()=>{ formData.value.countryCode=route.query.zone } } -const nextClick=async ()=>{ + +/** + * 处理下一步按钮点击 + * 场景1(number=1): 扫号牌进入 + * - 验证表单完整性 + * - 检查用户号牌是否存在 + * - 根据国家区号判断签署方式(国内用法大大,国外直接签字) + * + * 场景2(number=2): 扫付款码进入 + * - 验证必填信息(手机、区号、用户名) + */ +const nextClick = async () => { //扫号牌 if (number.value==1){ if (!isFormComplete(formData.value)){ diff --git a/app/pages/collectCode/signature/protocol/index.vue b/app/pages/collectCode/signature/protocol/index.vue index 4af944b..857d6e2 100644 --- a/app/pages/collectCode/signature/protocol/index.vue +++ b/app/pages/collectCode/signature/protocol/index.vue @@ -1,86 +1,132 @@ +
Date: Fri, 14 Mar 2025 10:07:39 +0800 Subject: [PATCH 2/6] 1231 --- app/pages/collectCode/signature/protocol/index.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/pages/collectCode/signature/protocol/index.vue b/app/pages/collectCode/signature/protocol/index.vue index 857d6e2..653d781 100644 --- a/app/pages/collectCode/signature/protocol/index.vue +++ b/app/pages/collectCode/signature/protocol/index.vue @@ -4,14 +4,14 @@ 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" - +import { showLoadingToast } from 'vant'; definePageMeta({ i18n: 'signature.protocol.title' }) const { t } = useI18n() const { formData, number, qrData } = codeAuthStore() -const activeNames = ref([]) +const activeNames = ref('') const router = useRouter() const pmblUrl = ref('') @@ -74,6 +74,11 @@ const handleCollapseChange = (name) => { * - 其他用户: 走非大陆签署流程 */ const confirm = async () => { +const toast= showLoadingToast({ + message: '加载中...', + forbidClick: true, +}); + try { const fddResponse = await fddInfo({ phone: formData.value.phone }) @@ -100,6 +105,8 @@ const confirm = async () => { } } catch (error) { console.error('签署确认失败:', error) + }finally{ + toast1.close(); } } From 3b60502ae32ed4ef43b8bb6646b071df1ec6c794 Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Fri, 14 Mar 2025 10:08:45 +0800 Subject: [PATCH 3/6] 12 --- app/pages/collectCode/signature/protocol/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/collectCode/signature/protocol/index.vue b/app/pages/collectCode/signature/protocol/index.vue index 653d781..277398b 100644 --- a/app/pages/collectCode/signature/protocol/index.vue +++ b/app/pages/collectCode/signature/protocol/index.vue @@ -106,7 +106,7 @@ const toast= showLoadingToast({ } catch (error) { console.error('签署确认失败:', error) }finally{ - toast1.close(); + toast.close(); } } From 9402c8b7194e18e7cf7be32840619204a3dbf34b Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Fri, 14 Mar 2025 10:57:50 +0800 Subject: [PATCH 4/6] =?UTF-8?q?refactor(app):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=92=8C=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 puzzleComponent 中添加 watch 监听 loading 状态,以重置验证状态 - 修改 personal-Info 页面中路由跳转方式 - 在 nuxt.config.js 中添加 imagemin 插件,优化图片压缩 - 更新 package.json,添加 vite-plugin-imagemin 依赖 --- app/components/puzzleComponent/index.vue | 18 +- .../signature/personal-Info/index.vue | 2 +- nuxt.config.js | 44 +- package.json | 3 +- pnpm-lock.yaml | 2161 ++++++++++++++++- 5 files changed, 2200 insertions(+), 28 deletions(-) diff --git a/app/components/puzzleComponent/index.vue b/app/components/puzzleComponent/index.vue index b636f63..c031771 100644 --- a/app/components/puzzleComponent/index.vue +++ b/app/components/puzzleComponent/index.vue @@ -1,7 +1,7 @@