|  |  |  | 
|---|
|  |  |  | :limitFileSize="10" | 
|---|
|  |  |  | class="bole-uploader nopaddingtop" | 
|---|
|  |  |  | @my-success="handleFrontImgUrlChange" | 
|---|
|  |  |  | @delete="handleFrontImgUrlDelete" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template #upload-icon> | 
|---|
|  |  |  | <div class="photograph-wrapper"> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; | 
|---|
|  |  |  | import { FormValidator } from '@12333/utils'; | 
|---|
|  |  |  | import Taro from '@tarojs/taro'; | 
|---|
|  |  |  | import { userCredentialVerifyOcrIDCard } from '@12333/hooks'; | 
|---|
|  |  |  | import { EnumOcrAccess } from '@12333/constants'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'InnerPage', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { userDetail } = useUser(); | 
|---|
|  |  |  | const router = Taro.useRouter(); | 
|---|
|  |  |  | const type = router.params?.type ?? ''; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | identityBackImg: [] as FileItem[], | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | identity: '', | 
|---|
|  |  |  | phoneNumber: '', | 
|---|
|  |  |  | phoneNumber: userDetail.value?.contactPhoneNumber, | 
|---|
|  |  |  | verifyCode: '', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleFrontImgUrlChange(response: FileItem) { | 
|---|
|  |  |  | // userCredentialVerifyOcrIDCard(response, { | 
|---|
|  |  |  | //   onSuccess(res) { | 
|---|
|  |  |  | //     if (res.realName) form.legalPersonName = res.realName; | 
|---|
|  |  |  | //     if (res.idcardNum) form.legalPersonIdNumber = res.idcardNum; | 
|---|
|  |  |  | //   }, | 
|---|
|  |  |  | // }); | 
|---|
|  |  |  | userCredentialVerifyOcrIDCard({ | 
|---|
|  |  |  | response: response, | 
|---|
|  |  |  | access: EnumOcrAccess.Baidu, | 
|---|
|  |  |  | isOssUrl: true, | 
|---|
|  |  |  | onSuccess(res) { | 
|---|
|  |  |  | if (res.model?.name) form.name = res.model?.name; | 
|---|
|  |  |  | if (res.model?.identity) form.identity = res.model?.identity; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleSubmit() { | 
|---|
|  |  |  | console.log('type: ', type); | 
|---|
|  |  |  | if (!formRef.value) return; | 
|---|
|  |  |  | formRef.value.validate().then(({ valid, errors }: any) => { | 
|---|
|  |  |  | if (valid) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleFrontImgUrlDelete({ files, fileList, index }) { | 
|---|
|  |  |  | if (fileList?.length === 0) { | 
|---|
|  |  |  | form.name = ''; | 
|---|
|  |  |  | form.identity = ''; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style lang="scss"> | 
|---|