修复审核不通过的代码
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
<template>
|
||||
<view class="login-page">
|
||||
<view class="status_bar"></view>
|
||||
<!-- 自定义导航栏:返回按钮 — 用户可拒绝登录 -->
|
||||
<view class="custom-nav">
|
||||
<view class="back-btn" @click="handleCancel">
|
||||
<uni-icons type="arrow-left" size="24" color="#333"></uni-icons>
|
||||
<text class="back-text">返回</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标题 -->
|
||||
<view class="login-title">账号密码登录</view>
|
||||
|
||||
@@ -42,11 +49,11 @@
|
||||
size="24"
|
||||
color="#999"
|
||||
v-else
|
||||
></uni-icons>
|
||||
></uni-icons>
|
||||
</view>
|
||||
|
||||
|
||||
<text class="agreement-text" @click.stop="goToPrivacy">我已阅读并同意
|
||||
<text class="agreePrivacy" >《用户隐私政策》</text>
|
||||
<text class="agreePrivacy" @click.stop="goToPrivacy">《用户隐私政策》</text>
|
||||
</text>
|
||||
</view>
|
||||
<navigator class="forget-pwd" url="/pageSubPack/loginSub/forget-pwd">忘记密码?</navigator>
|
||||
@@ -73,6 +80,7 @@ import { ref, computed } from 'vue';
|
||||
import {onLoad} from "@dcloudio/uni-app"
|
||||
import {getLoginPassword} from '../api/api.js'
|
||||
import { showApiError } from '../api/request.js'
|
||||
import { saveLoginData } from '../api/auth.js'
|
||||
|
||||
// 响应式数据
|
||||
const phoneNumber = ref('');
|
||||
@@ -103,6 +111,16 @@ const goToPrivacy = () => {
|
||||
// 检查表单
|
||||
const checkForm = () => {};
|
||||
|
||||
// 用户取消登录 — 返回上一页
|
||||
const handleCancel = () => {
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length > 1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad(() =>{
|
||||
});
|
||||
@@ -141,25 +159,18 @@ const handleLogin = () => {
|
||||
}
|
||||
getLoginPassword(params).then(res =>{
|
||||
if(res.code === 200){
|
||||
uni.setStorageSync('token', res.data.token);
|
||||
// 存用户ID
|
||||
if(res.data) {
|
||||
// 存当前绑定的小区ID,0 表示未绑定
|
||||
const currentVillageId = res.data.currentVillageId || 0;
|
||||
uni.setStorageSync('currentVillageId', currentVillageId);
|
||||
uni.setStorageSync('userId',res.data.userId)
|
||||
}
|
||||
saveLoginData(res.data);
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
setTimeout(() =>{
|
||||
uni.switchTab({
|
||||
url: '/pages/paymentIndex/paymentIndex'
|
||||
},1000);
|
||||
})
|
||||
// 登录成功后返回来源页
|
||||
uni.navigateBack({
|
||||
fail: () => {
|
||||
uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' });
|
||||
}
|
||||
});
|
||||
},1000)
|
||||
}
|
||||
// else {
|
||||
// uni.showToast({ title: res.msg, icon: 'error' });
|
||||
// }
|
||||
|
||||
}).catch(err => {
|
||||
// console.log(err)
|
||||
@@ -177,15 +188,34 @@ const handleLogin = () => {
|
||||
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF );
|
||||
}
|
||||
.status_bar {
|
||||
height: 160px;
|
||||
height: var(--status-bar-height, 88rpx);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* ===== 自定义导航:返回/取消按钮 ===== */
|
||||
.custom-nav {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 10rpx 20rpx;
|
||||
background: rgba(255,255,255,0.9);
|
||||
border-radius: 30rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
|
||||
}
|
||||
.back-text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.login-title {
|
||||
font-size: 52rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin-bottom: 142rpx;
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
|
||||
.input-item {
|
||||
@@ -248,9 +278,6 @@ const handleLogin = () => {
|
||||
.agreePrivacy{
|
||||
color: #2F77FD;
|
||||
}
|
||||
/* .agreePrivacy.active{
|
||||
color: #2F77FD;
|
||||
} */
|
||||
|
||||
.forget-pwd {
|
||||
font-size: 24rpx;
|
||||
@@ -272,7 +299,6 @@ const handleLogin = () => {
|
||||
.login-btn:disabled {
|
||||
background-color: #99c8ff;
|
||||
color: #fff;
|
||||
/* border-radius: 50px; */
|
||||
|
||||
}
|
||||
/* 禁用按钮边框 */
|
||||
@@ -291,4 +317,4 @@ button:after{
|
||||
color: #007aff;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user