From 3d83be503aa6d46e0a0591a517c1428dc4fc0364 Mon Sep 17 00:00:00 2001 From: 15233722133 <15233722133@163.com> Date: Tue, 16 Jun 2026 16:49:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=98=E7=8E=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=89=8B=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/liquidation.vue | 52 ++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/pages/home/liquidation.vue b/pages/home/liquidation.vue index 2c501bb..622f4f3 100644 --- a/pages/home/liquidation.vue +++ b/pages/home/liquidation.vue @@ -32,7 +32,18 @@ 请输入去变现数量 - + + + + + {}); - } - const mobile = userStore?.userInfo?.mobile; - if (!mobile) { - sheep.$helper.toast('未绑定手机号'); - return; - } + const mobile = resolveMobile(); + if (!mobile) return; const money = Math.round(amt * 100); const payload = { money, mobile, scene: smsScene, code: smsCode.value }; const res = await incrementApi.walletLiquidation(payload).catch(() => ({ code: -1 })); @@ -157,6 +162,15 @@ } }; + const resolveMobile = () => { + const mobile = String(smsMobile.value || '').trim(); + if (!/^1\d{10}$/.test(mobile)) { + sheep.$helper.toast('请输入正确手机号'); + return ''; + } + return mobile; + }; + const sendSmsCode = async () => { if (smsCountdown.value > 0) return; const amt = amountNumber.value; @@ -168,15 +182,8 @@ sheep.$helper.toast('变现金额不能大于钱包余额'); return; } - const userStore = sheep.$store('user'); - if (!userStore?.userInfo?.mobile) { - await userStore?.getInfo?.().catch(() => {}); - } - const mobile = userStore?.userInfo?.mobile; - if (!mobile) { - sheep.$helper.toast('未绑定手机号'); - return; - } + const mobile = resolveMobile(); + if (!mobile) return; const res = await AuthUtil.sendSmsCode({ mobile, scene: smsScene }).catch(() => ({ code: -1 })); if (res?.code !== 0) return; smsCountdown.value = 60; @@ -199,6 +206,9 @@ onShow(() => { refreshWallet(); + const userStore = sheep.$store('user'); + const mobile = userStore?.userInfo?.mobile; + if (!smsMobile.value && mobile) smsMobile.value = mobile; }); @@ -283,6 +293,10 @@ align-items: center; } + .code-row--mobile { + margin-bottom: 12rpx; + } + .code-btn { margin-left: 18rpx; min-width: 168rpx;