Browse Source

完成找回密码逻辑

wangyi/feature-20251022162725-启动页登录注册
Ethereal 4 weeks ago
parent
commit
1571a304ba
  1. 75
      pages/start/recoverPassword/recoverPassword.vue

75
pages/start/recoverPassword/recoverPassword.vue

@ -56,15 +56,15 @@
/> />
<input <input
class="input-field" class="input-field"
type="text"
:type="newPasswordLookFirst ? 'text' : 'password'"
placeholder="输入新密码" placeholder="输入新密码"
v-model="newPassword"
v-model="newPasswordFirst"
/> />
<image <image
class="input-icon-eye" class="input-icon-eye"
@click="newPasswordLookFirst=!newPasswordLookFirst"
@click="newPasswordLookFirst = !newPasswordLookFirst"
:src=" :src="
newPasswordLookFirst
!newPasswordLookFirst
? '../../../static/icons/unlook.png' ? '../../../static/icons/unlook.png'
: '../../../static/icons/look.png' : '../../../static/icons/look.png'
" "
@ -79,15 +79,15 @@
/> />
<input <input
class="input-field" class="input-field"
type="text"
:type="newPasswordLookSecond ? 'text' : 'password'"
placeholder="再次确认" placeholder="再次确认"
v-model="password"
v-model="newPasswordSecond"
/> />
<image <image
class="input-icon-eye" class="input-icon-eye"
@click="newPasswordLookSecond=!newPasswordLookSecond"
@click="newPasswordLookSecond = !newPasswordLookSecond"
:src=" :src="
newPasswordLookSecond
!newPasswordLookSecond
? '../../../static/icons/unlook.png' ? '../../../static/icons/unlook.png'
: '../../../static/icons/look.png' : '../../../static/icons/look.png'
" "
@ -236,7 +236,8 @@ import { verificationPhone, verificationEmail } from "../login/verification";
const type = ref("member"); const type = ref("member");
const email = ref(""); const email = ref("");
const password = ref(""); const password = ref("");
const newPassword = ref("");
const newPasswordFirst = ref("");
const newPasswordSecond = ref("");
const phone = ref(""); const phone = ref("");
const country = ref("+86"); const country = ref("+86");
const agreed = ref(false); const agreed = ref(false);
@ -293,36 +294,29 @@ function switchPhone() {
switchType.value = "Phone"; switchType.value = "Phone";
} }
// function register() {
// if (switchType.value === "Email") {
// //
// if (!email.value) {
// uni.showToast({
// title: "",
// icon: "none",
// });
// return;
// }
// //
// console.log(":", email.value);
// }
// if (switchType.value === "Phone") {
// //
// if (!phone.value) {
// uni.showToast({
// title: "",
// icon: "none",
// });
// return;
// }
// //
// console.log(":", phone.value);
// }
// }
function register() { function register() {
if (isRecovering.value) {
if(!newPasswordFirst.value || !newPasswordSecond.value){
uni.showToast({
title: "密码不能为空",
icon: "none",
});
return;
}
if (newPasswordFirst.value !== newPasswordSecond.value) {
uni.showToast({
title: "前后密码不一致",
icon: "none",
});
return;
}
//
return;
}
if (switchType.value === "Phone") { if (switchType.value === "Phone") {
// //
if (!phone.value) { if (!phone.value) {
@ -384,11 +378,7 @@ function register() {
console.log("登录:", email.value); console.log("登录:", email.value);
} }
// if (!agreed.value) {
// //
// agreementPopup.value.open();
// return;
// }
isRecovering.value = !isRecovering.value; isRecovering.value = !isRecovering.value;
@ -575,7 +565,6 @@ function handleAgree() {
checkboxUrl.value = "../../../static/icons/Check-one-true.png"; checkboxUrl.value = "../../../static/icons/Check-one-true.png";
// //
} }
</script> </script>
<style scoped> <style scoped>

Loading…
Cancel
Save