|
@@ -87,6 +87,7 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, computed, ref, onMounted } from 'vue'
|
|
import { shallowRef, computed, ref, onMounted } from 'vue'
|
|
|
import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule, Popup, Picker, PickerConfirmEventParams } from 'vant'
|
|
import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule, Popup, Picker, PickerConfirmEventParams } from 'vant'
|
|
|
|
|
+import { getIdCardAge } from '@/filters'
|
|
|
import { addAuthReq } from '@/business/user'
|
|
import { addAuthReq } from '@/business/user'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { getCerTypePersonList } from "@/constants/account"
|
|
import { getCerTypePersonList } from "@/constants/account"
|
|
@@ -100,15 +101,22 @@ import AppUploader from '@mobile/components/modules/uploader/index.vue'
|
|
|
import AppSelect from '@mobile/components/base/select/index.vue'
|
|
import AppSelect from '@mobile/components/base/select/index.vue'
|
|
|
import certification from '../../../assets/images/certification.png'
|
|
import certification from '../../../assets/images/certification.png'
|
|
|
|
|
|
|
|
-defineProps({
|
|
|
|
|
|
|
+const props = defineProps({
|
|
|
|
|
+ // 是否显示示例
|
|
|
showExample: {
|
|
showExample: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
|
default: true
|
|
default: true
|
|
|
},
|
|
},
|
|
|
|
|
+ // 示例图片
|
|
|
exampleImage: {
|
|
exampleImage: {
|
|
|
type: String,
|
|
type: String,
|
|
|
default: certification
|
|
default: certification
|
|
|
},
|
|
},
|
|
|
|
|
+ // 年龄验证
|
|
|
|
|
+ ageCheck: {
|
|
|
|
|
+ type: Boolean,
|
|
|
|
|
+ default: true
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
@@ -184,14 +192,17 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
cardnum: [{
|
|
cardnum: [{
|
|
|
message: t("user.authentication.pleaseenterthecardnum"),
|
|
message: t("user.authentication.pleaseenterthecardnum"),
|
|
|
validator: (val) => {
|
|
validator: (val) => {
|
|
|
- // 待优化
|
|
|
|
|
- // if (getIdCardAge(val)) {
|
|
|
|
|
- // return t("user.authentication.openfailure")
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
// 任务 #7009
|
|
// 任务 #7009
|
|
|
const enumItem = cerTypePersonList.find((e) => e.enumitemname === formData.cardtype)
|
|
const enumItem = cerTypePersonList.find((e) => e.enumitemname === formData.cardtype)
|
|
|
- return (enumItem && new RegExp(enumItem.param1).test(val)) || t('regex.cardno')
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (enumItem && new RegExp(enumItem.param1).test(val)) {
|
|
|
|
|
+ if (props.ageCheck && getIdCardAge(val)) {
|
|
|
|
|
+ return t("user.authentication.openfailure")
|
|
|
|
|
+ }
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return t('regex.cardno')
|
|
|
}
|
|
}
|
|
|
}],
|
|
}],
|
|
|
cardbackphotourl: [{
|
|
cardbackphotourl: [{
|