改变故障上报路径 修改样式
This commit is contained in:
@@ -9,26 +9,26 @@
|
||||
|
||||
<!-- 旧密码输入框 -->
|
||||
<view class="input-item">
|
||||
<uni-easyinput
|
||||
class="input-content"
|
||||
type="password"
|
||||
<uni-easyinput
|
||||
class="input-content"
|
||||
type="password"
|
||||
v-model="oldPassword"
|
||||
placeholder="请输入旧密码"
|
||||
:inputBorder="false"
|
||||
placeholder="请输入旧密码"
|
||||
:inputBorder="false"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
@input="checkForm"
|
||||
>
|
||||
</uni-easyinput>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 新密码输入框 -->
|
||||
<view class="input-item">
|
||||
<uni-easyinput
|
||||
class="input-content"
|
||||
type="password"
|
||||
<uni-easyinput
|
||||
class="input-content"
|
||||
type="password"
|
||||
v-model="newPassword"
|
||||
placeholder="请输入新密码(6-16位,含字母+数字)"
|
||||
:inputBorder="false"
|
||||
placeholder="请输入新密码(6-16位,含字母+数字)"
|
||||
:inputBorder="false"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
@input="checkForm"
|
||||
>
|
||||
@@ -37,12 +37,12 @@
|
||||
|
||||
<!-- 确认密码输入框 -->
|
||||
<view class="input-item">
|
||||
<uni-easyinput
|
||||
class="input-content"
|
||||
type="password"
|
||||
<uni-easyinput
|
||||
class="input-content"
|
||||
type="password"
|
||||
v-model="confirmPassword"
|
||||
placeholder="请再次输入新密码"
|
||||
:inputBorder="false"
|
||||
placeholder="请再次输入新密码"
|
||||
:inputBorder="false"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
@input="checkForm"
|
||||
>
|
||||
@@ -55,8 +55,8 @@
|
||||
</view>
|
||||
|
||||
<!-- 确定按钮 -->
|
||||
<button
|
||||
class="confirm-btn"
|
||||
<button
|
||||
class="confirm-btn"
|
||||
:disabled="!canConfirm"
|
||||
@click="handleConfirm"
|
||||
>
|
||||
@@ -88,15 +88,15 @@ const smsCode = ref('');
|
||||
const canConfirm = computed(() => {
|
||||
// 密码格式规则:6-16位,必须包含字母+数字
|
||||
const pwdReg = /^(?=.*[a-zA-Z])(?=.*\d).{6,16}$/;
|
||||
|
||||
|
||||
// 校验条件:
|
||||
// 1. 旧密码不为空
|
||||
// 2. 新密码符合格式
|
||||
// 3. 确认密码和新密码一致
|
||||
// 1. 旧密码不为空
|
||||
// 2. 新密码符合格式
|
||||
// 3. 确认密码和新密码一致
|
||||
// 4. 所有密码输入框不为空
|
||||
return oldPassword.value.trim()
|
||||
&& pwdReg.test(newPassword.value)
|
||||
&& newPassword.value === confirmPassword.value
|
||||
return oldPassword.value.trim()
|
||||
&& pwdReg.test(newPassword.value)
|
||||
&& newPassword.value === confirmPassword.value
|
||||
&& newPassword.value && confirmPassword.value;
|
||||
});
|
||||
|
||||
@@ -109,11 +109,11 @@ const goBack = () => {
|
||||
// 页面显示时读取缓存参数
|
||||
onShow(() => {
|
||||
// 从缓存读取参数
|
||||
const params = uni.getStorageSync('tempChangePwdParams') || {};
|
||||
const params = uni.getStorageSync('tempChangePwdParams') || {};
|
||||
// 赋值
|
||||
phone.value = params.phoneNumber || ''
|
||||
smsCode.value = params.verifyCode || ''
|
||||
|
||||
|
||||
// 校验参数是否完整
|
||||
// if (!phone.value || !smsCode.value) {
|
||||
// uni.showToast({
|
||||
@@ -124,7 +124,7 @@ onShow(() => {
|
||||
// goBack()
|
||||
// }, 1500)
|
||||
// }
|
||||
|
||||
|
||||
// 用完删除缓存(避免下次跳转读取旧值)
|
||||
uni.removeStorageSync('tempChangePwdParams');
|
||||
});
|
||||
@@ -266,7 +266,7 @@ const handleConfirm = () => {
|
||||
background-color: #4D5DFA;
|
||||
color: #fff;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-size: 28rpx;
|
||||
margin-top: 20rpx;
|
||||
border: none;
|
||||
}
|
||||
@@ -282,4 +282,4 @@ button:after {
|
||||
border: none;
|
||||
border-radius: 44rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" trim="all"
|
||||
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"
|
||||
>
|
||||
@@ -32,18 +32,18 @@
|
||||
</button>
|
||||
</view>
|
||||
<!-- 确定 -->
|
||||
<button
|
||||
class="forget-btn"
|
||||
<button
|
||||
class="forget-btn"
|
||||
:disabled="!canRegister"
|
||||
@click="handleConfirm"
|
||||
>
|
||||
确定
|
||||
</button>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, computed, onUnmounted } from 'vue';
|
||||
import { ref, computed, onUnmounted } from 'vue';
|
||||
import {getSendCode} from '../api/api.js'
|
||||
|
||||
// ====响应式数据======
|
||||
@@ -73,7 +73,7 @@ const getVerifyCode = () => {
|
||||
uni.showToast({
|
||||
title: '验证码已发送',
|
||||
icon: 'success'
|
||||
});
|
||||
});
|
||||
// 开始60秒倒计时
|
||||
countDown.value = 60;
|
||||
timer = setInterval(() => {
|
||||
@@ -82,25 +82,25 @@ const getVerifyCode = () => {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
}, 1000);
|
||||
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '验证码发送失败',
|
||||
icon: 'error'
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
};
|
||||
// 是否确认
|
||||
const canRegister = computed(() => {
|
||||
const phoneReg = /^1[3-9]\d{9}$/; // 手机号11位
|
||||
const verifyReg = /^\d{6}$/; // 验证码6位
|
||||
|
||||
return phoneReg.test(phoneNumber.value)
|
||||
&& verifyReg.test(verifyCode.value)
|
||||
return phoneReg.test(phoneNumber.value)
|
||||
&& verifyReg.test(verifyCode.value)
|
||||
});
|
||||
// 确认
|
||||
const handleConfirm = () =>{
|
||||
@@ -118,7 +118,7 @@ const handleConfirm = () =>{
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.forget-page{
|
||||
@@ -126,7 +126,7 @@ const goBack = () => {
|
||||
min-height: 100vh;
|
||||
background-color: #f9f9f9;
|
||||
/* background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF ); */
|
||||
}
|
||||
}
|
||||
.status_bar{
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
@@ -211,7 +211,7 @@ const goBack = () => {
|
||||
background-color: #4D5DFA;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
font-size: 32rpx;
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.forget-btn:disabled{
|
||||
@@ -223,5 +223,5 @@ button:after{
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user