This commit is contained in:
张成
2025-08-24 14:54:04 +08:00
parent 74174c504e
commit b92301a887
6 changed files with 49 additions and 33 deletions

View File

@@ -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',

View File

@@ -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;
}

View File

@@ -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,

View File

@@ -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);
}
}
// 协议区域

View File

@@ -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 ? (
'获取验证码'
) : (
<View className="countdown_text">
<Text className="countdown_line1"></Text>
<Text className="countdown_line2">{countdown}</Text>
</View>
)}
</Button>
</View>
</View>

View File

@@ -47,20 +47,21 @@ export const wechat_auth_login = async (): Promise<LoginResponse> => {
};
}
// 获取用户信息
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<LoginR
code: params.verification_code
});
if (verify_response.success) {
if (verify_response.code===0) {
return {
success: true,
message: '登录成功',