From 38a7b4320d9e495ebbc4afbe57335d8ec07e1bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 15 Jul 2026 01:40:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(user):=20=E4=BC=98=E5=8C=96=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E8=80=85=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97=E5=8F=8A?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=A4=E4=BA=92=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除点击步数提示和震动反馈,改为静默计数,点击11次后弹出登录弹窗 - 将弹窗宽度从300px调整为320px,增加内边距提升视觉效果 - 登录按钮由block属性改为style设置宽度100%,确保按钮样式一致 - 优化弹窗标题和关闭按钮样式,提高界面层次感 - 调整手机号输入框和布局间距,提升整体排版协调性 --- .workbuddy/memory/2025-07-15.md | 2 ++ src/pages/user/about/index.tsx | 53 +++++++++++++-------------------- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/.workbuddy/memory/2025-07-15.md b/.workbuddy/memory/2025-07-15.md index 567c6ee..c1c081b 100644 --- a/.workbuddy/memory/2025-07-15.md +++ b/.workbuddy/memory/2025-07-15.md @@ -5,5 +5,7 @@ - 登录方式:手机号 + 短信验证码,复用 `loginBySms` / `sendSmsCaptcha` API(from `@/api/passport/login`) - 点击计数使用 `useRef` 保证快速点击时的同步性,超过 3 秒未点击自动重置 - 第 4 次点击起显示步数提示(类似 Android 开发者模式),前 3 次仅轻震动反馈 +- **(已更新)** 移除了步数提示和震动,改为静默计数,点够 11 次直接弹窗 +- **(已更新)** 弹窗宽度从 300px 加大到 320px,登录按钮改用 `style={{ width: '100%' }}` 替代 `block` prop 确保显示 - 登录成功后调用 `useUserContext().syncFromStorage()` 同步 React 登录态(`loginBySms` 内部已写入 storage 但不返回数据) - 弹窗 UI 使用 NutUI `Input` + `Button`,带 60 秒倒计时 diff --git a/src/pages/user/about/index.tsx b/src/pages/user/about/index.tsx index d7b3058..6082e74 100644 --- a/src/pages/user/about/index.tsx +++ b/src/pages/user/about/index.tsx @@ -45,24 +45,9 @@ const AboutPage: React.FC = () => { lastClickTime.current = now const current = clickCountRef.current - const remaining = DEV_LOGIN_CLICK_COUNT - current - if (current >= DEV_LOGIN_CLICK_COUNT) { clickCountRef.current = 0 setShowLogin(true) - return - } - - // 从第 4 次开始给步数提示 - if (current >= 4) { - Taro.showToast({ - title: `再点击 ${remaining} 次开启开发者登录`, - icon: 'none', - duration: 1200, - }) - } else { - // 前 3 次给极轻的震动反馈,避免用户误触无感 - Taro.vibrateShort({ type: 'light' }) } } @@ -212,32 +197,36 @@ const AboutPage: React.FC = () => { catchMove > e.stopPropagation()} > - - 开发者登录 + + 开发者登录 - + 仅限开发测试使用,通过手机号+验证码登录指定账号 - setFormData({ ...formData, phone: val })} - style={{ backgroundColor: '#f5f5f5', borderRadius: '8px' }} - /> + + setFormData({ ...formData, phone: val })} + style={{ backgroundColor: '#f5f5f5', borderRadius: '8px' }} + /> + - + {