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' }} + /> + - + {