1
This commit is contained in:
@@ -6,7 +6,7 @@ export default defineAppConfig({
|
|||||||
// 'pages/publishBall/index',
|
// 'pages/publishBall/index',
|
||||||
// 'pages/mapDisplay/index',
|
// 'pages/mapDisplay/index',
|
||||||
// 'pages/list/index',
|
// 'pages/list/index',
|
||||||
// 'pages/index/index'
|
'pages/index/index'
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
backgroundTextStyle: 'light',
|
backgroundTextStyle: 'light',
|
||||||
|
|||||||
@@ -115,13 +115,13 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: flex-end;
|
||||||
|
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 品牌区域
|
// 品牌区域
|
||||||
.brand_section {
|
.brand_section {
|
||||||
margin-top: 237px;
|
|
||||||
|
|
||||||
.logo_container {
|
.logo_container {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -138,8 +138,8 @@
|
|||||||
.slogan_container {
|
.slogan_container {
|
||||||
margin-bottom: 51px;
|
margin-bottom: 51px;
|
||||||
background: url('../../../static/login/bro.svg') no-repeat left top;
|
background: url('../../../static/login/bro.svg') no-repeat left top;
|
||||||
background-size: inherit;
|
background-size: contain;
|
||||||
width: 363px;
|
width: 100%;
|
||||||
height: 114px;
|
height: 114px;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
|
|
||||||
// 微信登录按钮
|
// 微信登录按钮
|
||||||
&.wechat_button {
|
&.wechat_button {
|
||||||
|
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border: 1px solid rgba(0, 0, 0, 0.06);
|
border: 1px solid rgba(0, 0, 0, 0.06);
|
||||||
box-shadow: 0px 8px 64px rgba(0, 0, 0, 0.1);
|
box-shadow: 0px 8px 64px rgba(0, 0, 0, 0.1);
|
||||||
|
|||||||
@@ -26,14 +26,10 @@ const LoginPage: React.FC = () => {
|
|||||||
const response = await wechat_auth_login();
|
const response = await wechat_auth_login();
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
save_login_state(response.token!, response.user_info!);
|
save_login_state(response.token!, response.user_info!);
|
||||||
Taro.showToast({
|
|
||||||
title: '登录成功',
|
|
||||||
icon: 'success',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.switchTab({ url: '/pages/index/index' });
|
Taro.redirectTo({ url: '/pages/index/index' });
|
||||||
}, 1500);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: response.message,
|
title: response.message,
|
||||||
|
|||||||
@@ -348,9 +348,30 @@
|
|||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not(.disabled):hover {
|
// 倒计时文案样式
|
||||||
transform: translateY(-2px);
|
.countdown_text {
|
||||||
box-shadow: 0px 12px 80px 0px rgba(0, 0, 0, 0.15);
|
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;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not(.loading):hover {
|
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: 0px 12px 80px 0px rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 协议区域
|
// 协议区域
|
||||||
|
|||||||
@@ -98,17 +98,12 @@ const VerificationPage: React.FC = () => {
|
|||||||
const result = await phone_auth_login({ phone, verification_code });
|
const result = await phone_auth_login({ phone, verification_code });
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
Taro.showToast({
|
|
||||||
title: '登录成功',
|
|
||||||
icon: 'success',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.switchTab({
|
Taro.redirectTo({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
});
|
});
|
||||||
}, 1500);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: result.message || '登录失败',
|
title: result.message || '登录失败',
|
||||||
@@ -187,7 +182,14 @@ const VerificationPage: React.FC = () => {
|
|||||||
onClick={handle_send_code}
|
onClick={handle_send_code}
|
||||||
disabled={!can_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>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -47,20 +47,21 @@ export const wechat_auth_login = async (): Promise<LoginResponse> => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户信息
|
|
||||||
const user_profile = await get_user_profile();
|
|
||||||
|
|
||||||
// 使用 httpService 调用微信授权接口
|
// 使用 httpService 调用微信授权接口
|
||||||
const auth_response = await httpService.post('/user/wx_auth', {
|
const auth_response = await httpService.post('/user/wx_auth', {
|
||||||
code: login_result.code
|
code: login_result.code
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (auth_response.success) {
|
if (auth_response.code === 0) {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
message: '微信登录成功',
|
message: '微信登录成功',
|
||||||
token: auth_response.data?.token || 'wx_token_' + Date.now(),
|
token: auth_response.data?.token || 'wx_token_' + Date.now(),
|
||||||
user_info: user_profile
|
user_info: auth_response.data?.user_info
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
@@ -92,7 +93,7 @@ export const phone_auth_login = async (params: PhoneLoginParams): Promise<LoginR
|
|||||||
code: params.verification_code
|
code: params.verification_code
|
||||||
});
|
});
|
||||||
|
|
||||||
if (verify_response.success) {
|
if (verify_response.code===0) {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
message: '登录成功',
|
message: '登录成功',
|
||||||
|
|||||||
Reference in New Issue
Block a user