|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<app-view class="g-form register">
|
|
|
<template #header>
|
|
|
- <app-navbar :title="$t('user.register.title')" />
|
|
|
+ <app-navbar :title="$t('user.register.title')" :show-back-button="showBackButton" />
|
|
|
</template>
|
|
|
<Form ref="formRef" class="g-form__container register__form" @submit="formSubmit">
|
|
|
<CellGroup :inset="insetStyle">
|
|
|
@@ -72,13 +72,13 @@
|
|
|
</Button>
|
|
|
</div>
|
|
|
<app-reward :show="showReward" :value="redEnvelope" :title="$t('user.register.registersuccess')"
|
|
|
- @click="router.back()" />
|
|
|
+ @click="routerAction" />
|
|
|
</template>
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { reactive, shallowRef, ref, computed, onMounted } from 'vue'
|
|
|
+import { reactive, shallowRef, ref, computed, onMounted, useAttrs } from 'vue'
|
|
|
import { CellGroup, Cell, Button, Field, Form, FormInstance, Checkbox, showFailToast, showToast, FieldRule, Popup, Picker, PickerConfirmEventParams, showSuccessToast } from 'vant'
|
|
|
import { useCountDown } from '@vant/use'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
@@ -93,6 +93,10 @@ import AppReward from '@mobile/components/modules/reward/index.vue'
|
|
|
// import AppQrcodeScan from '@mobile/components/base/qrcode-scan/index.vue'
|
|
|
|
|
|
defineProps({
|
|
|
+ showBackButton: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true
|
|
|
+ },
|
|
|
showYhkhfxgzs: {
|
|
|
type: Boolean,
|
|
|
default: true
|
|
|
@@ -103,6 +107,10 @@ defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
|
|
|
+
|
|
|
+const attrs = useAttrs()
|
|
|
+
|
|
|
// 是否弹出选择器
|
|
|
const show = shallowRef(false)
|
|
|
const datalist = computed(() => {
|
|
|
@@ -121,7 +129,7 @@ const onConfirm = ({ selectedValues: [value] }: PickerConfirmEventParams) => {
|
|
|
countryCode.value = value.toString()
|
|
|
}
|
|
|
|
|
|
-const { router, routerTo } = useNavigation()
|
|
|
+const { router, routerTo, getQueryString } = useNavigation()
|
|
|
const globalStore = useGlobalStore()
|
|
|
const errorInfoStore = useErrorInfoStore()
|
|
|
const registrationCodeRule = globalStore.getSystemInfo('registrationCodeRule')
|
|
|
@@ -161,7 +169,7 @@ const formData = reactive<Model.RegisterReq>({
|
|
|
mobilephone: '',
|
|
|
loginpwd: '',
|
|
|
vcode: '',
|
|
|
- refernum: '',
|
|
|
+ refernum: getQueryString('code') ?? '',
|
|
|
isaudit: 1,
|
|
|
userinfotype: 1,
|
|
|
usertype: 5,
|
|
|
@@ -231,6 +239,15 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
// formData.refernum = text
|
|
|
// }
|
|
|
|
|
|
+// 路由跳转
|
|
|
+const routerAction = () => {
|
|
|
+ if (attrs.onRouterAction) {
|
|
|
+ emit('routerAction')
|
|
|
+ } else {
|
|
|
+ router.back()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 发送手机验证码
|
|
|
const sendVerifyCode = () => {
|
|
|
formRef.value?.validate('mobilephone').then(() => {
|
|
|
@@ -256,7 +273,7 @@ const getRegisterMoney = (accountid: number) => {
|
|
|
message: t('user.register.tips8'),
|
|
|
confirmButtonText: t('operation.confirm')
|
|
|
}).then(() => {
|
|
|
- router.back()
|
|
|
+ routerAction()
|
|
|
})
|
|
|
}
|
|
|
return queryMyRegisterMoney({
|