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] 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 @@ +