fix: 重发验证码&图片路径
This commit is contained in:
@@ -79,19 +79,19 @@ const validatePassword = (password: string) => {
|
|||||||
const validateForm = () => {
|
const validateForm = () => {
|
||||||
// 验证邮箱
|
// 验证邮箱
|
||||||
if (!formData.email) {
|
if (!formData.email) {
|
||||||
showToast('请输入邮箱地址')
|
showToast('place input your email')
|
||||||
return false
|
return false
|
||||||
} else if (!validateEmail(formData.email)) {
|
} else if (!validateEmail(formData.email)) {
|
||||||
showToast('请输入有效的邮箱地址')
|
showToast('please input valid email')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证密码
|
// 验证密码
|
||||||
if (!formData.password) {
|
if (!formData.password) {
|
||||||
showToast('请输入密码')
|
showToast('please input password')
|
||||||
return false
|
return false
|
||||||
} else if (!validatePassword(formData.password)) {
|
} else if (!validatePassword(formData.password)) {
|
||||||
showToast('密码至少需要6位字符')
|
showToast('please input correct password')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
v-else-if="step === 'verify'"
|
v-else-if="step === 'verify'"
|
||||||
:ct="emailCode"
|
:ct="emailCode"
|
||||||
@nextStep="handleCheckVerifyCode"
|
@nextStep="handleCheckVerifyCode"
|
||||||
|
@resend="handleSendVerifyCode"
|
||||||
/>
|
/>
|
||||||
<Password v-else-if="step === 'password'" @sucess="handleSuccess" />
|
<Password v-else-if="step === 'password'" @sucess="handleSuccess" />
|
||||||
</div>
|
</div>
|
||||||
@@ -75,8 +76,10 @@ const handleStep = (type: 'mail' | 'verify' | 'password') => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSendVerifyCode = (data: any) => {
|
const handleSendVerifyCode = (data: any) => {
|
||||||
fromData.value.email = data.email
|
if (data?.email) {
|
||||||
precheckEmail({ email: data.email }).then(() => {
|
fromData.value.email = data?.email
|
||||||
|
}
|
||||||
|
precheckEmail({ email: fromData.value.email }).then(() => {
|
||||||
showToast('the verification code has been sent to your email')
|
showToast('the verification code has been sent to your email')
|
||||||
handleStep('verify')
|
handleStep('verify')
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="mail-container">
|
<div class="mail-container">
|
||||||
<div class="label">Your Email</div>
|
<div class="label">Your Email</div>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="email" v-model="formData.email" placeholder="Email" class="input-field" />
|
<input type="email" v-model="formData.email" placeholder="Enter your email" class="input-field" />
|
||||||
</div>
|
</div>
|
||||||
<div class="btn" @click="handleNext">Next</div>
|
<div class="btn" @click="handleNext">Next</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const agreePolicy = ref(false)
|
const agreePolicy = ref(false)
|
||||||
// Emits
|
// Emits
|
||||||
const emit = defineEmits(['nextStep'])
|
const emit = defineEmits(['nextStep','resend'])
|
||||||
|
|
||||||
// Reactive data
|
// Reactive data
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
@@ -83,6 +83,7 @@ const handleResend = () => {
|
|||||||
if (countdown.value > 0) return
|
if (countdown.value > 0) return
|
||||||
countdown.value = 60
|
countdown.value = 60
|
||||||
handleSendVerifyCode()
|
handleSendVerifyCode()
|
||||||
|
emit('resend')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleConfirmCaptcha = () => {
|
const handleConfirmCaptcha = () => {
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ import { ref, watch } from 'vue'
|
|||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import Video from './components/Video.vue'
|
import Video from './components/Video.vue'
|
||||||
import { useUserInfoStore } from '@/stores'
|
import { useUserInfoStore } from '@/stores'
|
||||||
|
import male from '@/assets/images/male.png'
|
||||||
|
import female from '@/assets/images/female.png'
|
||||||
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const userInfoStore = useUserInfoStore()
|
const userInfoStore = useUserInfoStore()
|
||||||
@@ -64,28 +67,28 @@ const stylists = ref<any[]>([
|
|||||||
value: 'mini',
|
value: 'mini',
|
||||||
name: 'Vera Lo',
|
name: 'Vera Lo',
|
||||||
description: 'Contemporary, Classic, Simple Silhouettes, Statement Pieces',
|
description: 'Contemporary, Classic, Simple Silhouettes, Statement Pieces',
|
||||||
image: '/src/assets/images/female.png'
|
image: female
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
value: 'crystal',
|
value: 'crystal',
|
||||||
name: 'Sarah Chen',
|
name: 'Sarah Chen',
|
||||||
description: 'Modern, Edgy, Bold Colors, Street Style',
|
description: 'Modern, Edgy, Bold Colors, Street Style',
|
||||||
image: '/src/assets/images/male.png'
|
image: male
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
value: 'mini',
|
value: 'mini',
|
||||||
name: 'Emma Wilson',
|
name: 'Emma Wilson',
|
||||||
description: 'Elegant, Feminine, Vintage Inspired, Soft Tones',
|
description: 'Elegant, Feminine, Vintage Inspired, Soft Tones',
|
||||||
image: '/src/assets/images/female.png'
|
image: female
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
value: 'crystal',
|
value: 'crystal',
|
||||||
name: 'Alex Johnson',
|
name: 'Alex Johnson',
|
||||||
description: 'Minimalist, Professional, Neutral Palette, Clean Lines',
|
description: 'Minimalist, Professional, Neutral Palette, Clean Lines',
|
||||||
image: '/src/assets/images/male.png'
|
image: male
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
const currentChoosed = ref(1)
|
const currentChoosed = ref(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user