diff --git a/src/app.config.ts b/src/app.config.ts index cef33f9..7c74bbe 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -6,7 +6,7 @@ export default defineAppConfig({ // 'pages/publishBall/index', // 'pages/mapDisplay/index', // 'pages/list/index', - // 'pages/index/index' + 'pages/index/index' ], window: { backgroundTextStyle: 'light', diff --git a/src/pages/login/index/index.scss b/src/pages/login/index/index.scss index 8c1959e..6436bd6 100644 --- a/src/pages/login/index/index.scss +++ b/src/pages/login/index/index.scss @@ -115,13 +115,13 @@ flex: 1; display: flex; flex-direction: column; - justify-content: space-between; + justify-content: flex-end; + padding: 0 20px; } // 品牌区域 .brand_section { - margin-top: 237px; .logo_container { display: flex; @@ -138,8 +138,8 @@ .slogan_container { margin-bottom: 51px; background: url('../../../static/login/bro.svg') no-repeat left top; - background-size: inherit; - width: 363px; + background-size: contain; + width: 100%; height: 114px; } @@ -179,7 +179,7 @@ // 微信登录按钮 &.wechat_button { - + background: #FFFFFF; border: 1px solid rgba(0, 0, 0, 0.06); box-shadow: 0px 8px 64px rgba(0, 0, 0, 0.1); diff --git a/src/pages/login/index/index.tsx b/src/pages/login/index/index.tsx index 6f249ba..09951c0 100644 --- a/src/pages/login/index/index.tsx +++ b/src/pages/login/index/index.tsx @@ -26,14 +26,10 @@ const LoginPage: React.FC = () => { const response = await wechat_auth_login(); if (response.success) { save_login_state(response.token!, response.user_info!); - Taro.showToast({ - title: '登录成功', - icon: 'success', - duration: 1500 - }); + setTimeout(() => { - Taro.switchTab({ url: '/pages/index/index' }); - }, 1500); + Taro.redirectTo({ url: '/pages/index/index' }); + }, 200); } else { Taro.showToast({ title: response.message, diff --git a/src/pages/login/verification/index.scss b/src/pages/login/verification/index.scss index 0598cac..c19131f 100644 --- a/src/pages/login/verification/index.scss +++ b/src/pages/login/verification/index.scss @@ -348,9 +348,30 @@ cursor: not-allowed; } - &:not(.disabled):hover { - transform: translateY(-2px); - box-shadow: 0px 12px 80px 0px rgba(0, 0, 0, 0.15); + // 倒计时文案样式 + .countdown_text { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + gap: 2px; + + .countdown_line1 { + font-family: 'PingFang SC'; + font-weight: 500; + font-size: 12px; + line-height: 1.2; + color: #FFFFFF; + } + + .countdown_line2 { + font-family: 'PingFang SC'; + font-weight: 400; + font-size: 11px; + line-height: 1.2; + color: rgba(255, 255, 255, 0.8); + } } } } @@ -379,10 +400,6 @@ cursor: not-allowed; } - &:not(.loading):hover { - transform: translateY(-2px); - box-shadow: 0px 12px 80px 0px rgba(0, 0, 0, 0.15); - } } // 协议区域 diff --git a/src/pages/login/verification/index.tsx b/src/pages/login/verification/index.tsx index 3e2da74..f34e5f6 100644 --- a/src/pages/login/verification/index.tsx +++ b/src/pages/login/verification/index.tsx @@ -98,17 +98,12 @@ const VerificationPage: React.FC = () => { const result = await phone_auth_login({ phone, verification_code }); if (result.success) { - Taro.showToast({ - title: '登录成功', - icon: 'success', - duration: 1500 - }); setTimeout(() => { - Taro.switchTab({ + Taro.redirectTo({ url: '/pages/index/index' }); - }, 1500); + }, 200); } else { Taro.showToast({ title: result.message || '登录失败', @@ -187,7 +182,14 @@ const VerificationPage: React.FC = () => { onClick={handle_send_code} disabled={!can_send_code} > - {can_send_code ? '获取验证码' : `${countdown}s`} + {can_send_code ? ( + '获取验证码' + ) : ( + + 验证码已发送 + {countdown}秒后可重发 + + )} diff --git a/src/services/loginService.ts b/src/services/loginService.ts index 3852bd7..603f85f 100644 --- a/src/services/loginService.ts +++ b/src/services/loginService.ts @@ -47,20 +47,21 @@ export const wechat_auth_login = async (): Promise => { }; } - // 获取用户信息 - const user_profile = await get_user_profile(); + // 使用 httpService 调用微信授权接口 const auth_response = await httpService.post('/user/wx_auth', { code: login_result.code }); + + - if (auth_response.success) { + if (auth_response.code === 0) { return { success: true, message: '微信登录成功', token: auth_response.data?.token || 'wx_token_' + Date.now(), - user_info: user_profile + user_info: auth_response.data?.user_info }; } else { return { @@ -92,7 +93,7 @@ export const phone_auth_login = async (params: PhoneLoginParams): Promise