|
@@ -60,7 +60,7 @@ import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { validateRules } from '@/constants/regex'
|
|
import { validateRules } from '@/constants/regex'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { userRegister, sendRegisterVerifyCode, queryMyRegisterMoney } from '@/services/api/common'
|
|
import { userRegister, sendRegisterVerifyCode, queryMyRegisterMoney } from '@/services/api/common'
|
|
|
-import { useGlobalStore } from '@/stores'
|
|
|
|
|
|
|
+import { i18n, useGlobalStore } from '@/stores'
|
|
|
import cryptojs from 'crypto-js'
|
|
import cryptojs from 'crypto-js'
|
|
|
import plus from '@/utils/h5plus'
|
|
import plus from '@/utils/h5plus'
|
|
|
import AppReward from '@mobile/components/modules/reward/index.vue'
|
|
import AppReward from '@mobile/components/modules/reward/index.vue'
|
|
@@ -75,6 +75,8 @@ const isCountdown = ref(false) // 是否正在倒计时
|
|
|
const showReward = ref(false) // 显示红包
|
|
const showReward = ref(false) // 显示红包
|
|
|
const redEnvelope = ref(0) // 红包金额
|
|
const redEnvelope = ref(0) // 红包金额
|
|
|
|
|
|
|
|
|
|
+const { global: { t } } = i18n
|
|
|
|
|
+
|
|
|
const confirmpassword = ref('') // 确认密码
|
|
const confirmpassword = ref('') // 确认密码
|
|
|
|
|
|
|
|
// 倒计时函数
|
|
// 倒计时函数
|
|
@@ -106,7 +108,7 @@ const formData = reactive<Model.RegisterReq>({
|
|
|
const formRules: { [key: string]: FieldRule[] } = {
|
|
const formRules: { [key: string]: FieldRule[] } = {
|
|
|
mobilephone: [{
|
|
mobilephone: [{
|
|
|
required: true,
|
|
required: true,
|
|
|
- message: '请输入手机号码',
|
|
|
|
|
|
|
+ message: t('user.register.tips1'),
|
|
|
validator: (val) => {
|
|
validator: (val) => {
|
|
|
if (validateRules.phone.validate(val)) {
|
|
if (validateRules.phone.validate(val)) {
|
|
|
return true
|
|
return true
|
|
@@ -116,7 +118,7 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
}],
|
|
}],
|
|
|
loginpwd: [{
|
|
loginpwd: [{
|
|
|
required: true,
|
|
required: true,
|
|
|
- message: '请输入登录密码',
|
|
|
|
|
|
|
+ message: t('user.register.tips2'),
|
|
|
validator: (val) => {
|
|
validator: (val) => {
|
|
|
if (validateRules.password.validate(val)) {
|
|
if (validateRules.password.validate(val)) {
|
|
|
return true
|
|
return true
|
|
@@ -126,24 +128,24 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
}],
|
|
}],
|
|
|
confirmpassword: [{
|
|
confirmpassword: [{
|
|
|
required: true,
|
|
required: true,
|
|
|
- message: '请输入确认密码',
|
|
|
|
|
|
|
+ message: t('user.register.tips3'),
|
|
|
validator: (val) => {
|
|
validator: (val) => {
|
|
|
if (formData.loginpwd === val) {
|
|
if (formData.loginpwd === val) {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
- return '登录密码和确认密码不一致'
|
|
|
|
|
|
|
+ return t('user.register.tips4')
|
|
|
}
|
|
}
|
|
|
}],
|
|
}],
|
|
|
vcode: [{
|
|
vcode: [{
|
|
|
required: true,
|
|
required: true,
|
|
|
- message: '请输入短信验证码',
|
|
|
|
|
|
|
+ message: t('user.register.tips5'),
|
|
|
}],
|
|
}],
|
|
|
refernum: [{
|
|
refernum: [{
|
|
|
validator: (val) => {
|
|
validator: (val) => {
|
|
|
if (!registrationCodeRule || val) {
|
|
if (!registrationCodeRule || val) {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
- return '请输入注册编码'
|
|
|
|
|
|
|
+ return t('user.register.tips6')
|
|
|
}
|
|
}
|
|
|
}],
|
|
}],
|
|
|
}
|
|
}
|
|
@@ -164,7 +166,7 @@ const sendVerifyCode = () => {
|
|
|
isCountdown.value = true
|
|
isCountdown.value = true
|
|
|
countdown.start()
|
|
countdown.start()
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
- showFailToast('发送失败')
|
|
|
|
|
|
|
+ showFailToast(t('user.register.tips7'))
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -172,7 +174,7 @@ const sendVerifyCode = () => {
|
|
|
// 获取注册红包
|
|
// 获取注册红包
|
|
|
const getRegisterMoney = (accountid: number) => {
|
|
const getRegisterMoney = (accountid: number) => {
|
|
|
const toggleDialog = () => {
|
|
const toggleDialog = () => {
|
|
|
- dialog('您的账号已成功注册。').then(() => {
|
|
|
|
|
|
|
+ dialog(t('user.register.tips8')).then(() => {
|
|
|
router.back()
|
|
router.back()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -222,9 +224,9 @@ const formSubmit = () => {
|
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
|
showFailToast(err)
|
|
showFailToast(err)
|
|
|
})
|
|
})
|
|
|
- }, '正在注册...')
|
|
|
|
|
|
|
+ }, t('user.register.tips9'))
|
|
|
} else {
|
|
} else {
|
|
|
- showToast('请先同意注册条款')
|
|
|
|
|
|
|
+ showToast(t('user.register.tips10'))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|