修改引导页、登录页等页面样式
This commit is contained in:
@@ -29,9 +29,9 @@
|
||||
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode"
|
||||
placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle">
|
||||
</uni-easyinput>
|
||||
|
||||
<button
|
||||
class="get-verify-btn"
|
||||
|
||||
<button
|
||||
class="get-verify-btn"
|
||||
:disabled="!canGetVerify || countDown > 0"
|
||||
@click="getVerifyCode"
|
||||
>
|
||||
@@ -48,7 +48,7 @@
|
||||
<uni-easyinput class="input-content" type="text" v-model="account"
|
||||
placeholder="请输入账号" :inputBorder="false" :placeholderStyle="placeholderStyle">
|
||||
</uni-easyinput>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 密码输入框 -->
|
||||
@@ -60,29 +60,25 @@
|
||||
<uni-easyinput class="input-content" type="password" v-model="password"
|
||||
placeholder="请输入密码" :inputBorder="false" :placeholderStyle="placeholderStyle" >
|
||||
</uni-easyinput>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 协议勾选 -->
|
||||
<view class="agreement-item" @click="toggleAgreement">
|
||||
<uni-icons
|
||||
type="checkbox-filled"
|
||||
size="24"
|
||||
color="#4D5DFA"
|
||||
v-if="agreeAgreement"
|
||||
></uni-icons>
|
||||
<uni-icons
|
||||
type="checkbox"
|
||||
size="24"
|
||||
color="#999"
|
||||
v-else
|
||||
></uni-icons>
|
||||
<text class="agreement-text">我已阅读并同意《用户隐私政策》</text>
|
||||
</view>
|
||||
<!-- 协议勾选 -->
|
||||
<view class="agreement-item" >
|
||||
<view @click="toggleAgreement">
|
||||
<uni-icons type="checkbox-filled" size="24" color="#4D5DFA" v-if="agreeAgreement"></uni-icons>
|
||||
<uni-icons type="checkbox" size="24" color="#999" v-else></uni-icons>
|
||||
</view>
|
||||
|
||||
<text class="agreement-text" @click.stop="goToPrivacy">我已阅读并同意
|
||||
<text class="agreePrivacy">《用户隐私政策》</text>
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<!-- 立即注册按钮 -->
|
||||
<button
|
||||
class="register-btn"
|
||||
<button
|
||||
class="register-btn"
|
||||
:disabled="!canRegister"
|
||||
@click="handleRegister"
|
||||
>
|
||||
@@ -98,7 +94,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onUnmounted } from 'vue';
|
||||
import {getRegisterUser,getSendCode} from '../api/api.js'
|
||||
import {getRegisterUser,getSendCode} from '../../api/api.js'
|
||||
|
||||
// ========== 响应式数据 ==========
|
||||
// 表单数据
|
||||
@@ -127,10 +123,10 @@ const canRegister = computed(() => {
|
||||
const accountReg = /^.{4,20}$/; // 账号4-20位
|
||||
const pwdReg = /^.{6,16}$/; // 密码6-16位
|
||||
|
||||
return phoneReg.test(phoneNumber.value)
|
||||
&& verifyReg.test(verifyCode.value)
|
||||
&& accountReg.test(account.value)
|
||||
&& pwdReg.test(password.value)
|
||||
return phoneReg.test(phoneNumber.value)
|
||||
&& verifyReg.test(verifyCode.value)
|
||||
&& accountReg.test(account.value)
|
||||
&& pwdReg.test(password.value)
|
||||
&& agreeAgreement.value;
|
||||
});
|
||||
|
||||
@@ -139,6 +135,12 @@ const canRegister = computed(() => {
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
// 跳转隐私协议
|
||||
const goToPrivacy = () => {
|
||||
uni.navigateTo({
|
||||
url:'/pageSubPack/loginSub/privacy',
|
||||
})
|
||||
}
|
||||
|
||||
// 切换协议勾选状态
|
||||
const toggleAgreement = () => {
|
||||
@@ -161,7 +163,7 @@ const getVerifyCode = () => {
|
||||
uni.showToast({
|
||||
title: '验证码已发送',
|
||||
icon: 'success'
|
||||
});
|
||||
});
|
||||
// 开始60秒倒计时
|
||||
countDown.value = 60;
|
||||
timer = setInterval(() => {
|
||||
@@ -171,21 +173,21 @@ const getVerifyCode = () => {
|
||||
timer = null;
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '验证码发送失败',
|
||||
icon: 'error'
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(err =>{
|
||||
uni.showToast({
|
||||
title: '网路异常',
|
||||
icon: 'error'
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 处理注册逻辑
|
||||
@@ -207,27 +209,27 @@ const handleRegister = () => {
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' });
|
||||
}, 1500);
|
||||
|
||||
}, 1500);
|
||||
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '注册失败',
|
||||
icon: 'error'
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch((err) =>{
|
||||
uni.showToast({
|
||||
title: '网络异常',
|
||||
icon: 'error'
|
||||
title: '网络异常',
|
||||
icon: 'error'
|
||||
});
|
||||
})
|
||||
// 注册成功后跳转到登录页
|
||||
// uni.redirectTo({
|
||||
// url: '/pages/login/pwd-login'
|
||||
// });
|
||||
|
||||
// setTimeout(() => {
|
||||
|
||||
|
||||
// setTimeout(() => {
|
||||
|
||||
// }, 1500);
|
||||
};
|
||||
|
||||
@@ -264,14 +266,15 @@ onUnmounted(() => {
|
||||
.nav-title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-right: 100rpx;
|
||||
}
|
||||
|
||||
/* 注册标题 */
|
||||
.register-title {
|
||||
font-size: 48rpx;
|
||||
font-size: 40rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 60rpx;
|
||||
@@ -326,8 +329,8 @@ onUnmounted(() => {
|
||||
line-height: 70rpx;
|
||||
background-color: #4D5DFA;
|
||||
color: #fff;
|
||||
border-radius: 35rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 198rpx;
|
||||
font-size: 26rpx;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
@@ -335,13 +338,17 @@ onUnmounted(() => {
|
||||
.get-verify-btn:disabled {
|
||||
background-color: #ccc;
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
.get-verify-btn:after{
|
||||
border-radius: 50px;
|
||||
}
|
||||
|
||||
/* 协议勾选项 */
|
||||
.agreement-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 40rpx 0;
|
||||
margin: 70rpx 0 28rpx 0;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
@@ -350,6 +357,9 @@ onUnmounted(() => {
|
||||
color: #666;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.agreePrivacy{
|
||||
color: #4D5DFA;
|
||||
}
|
||||
|
||||
/* 立即注册按钮 */
|
||||
.register-btn {
|
||||
@@ -358,12 +368,12 @@ onUnmounted(() => {
|
||||
line-height: 88rpx;
|
||||
background-color: #4D5DFA;
|
||||
color: #fff;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
button:after{
|
||||
border-radius: 50px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.register-btn:disabled {
|
||||
background-color: #99c8ff;
|
||||
@@ -380,4 +390,4 @@ button:after{
|
||||
color: #4D5DFA;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user