From 6887129e91d32557c2b57178180329f46df09d12 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期一, 10 三月 2025 13:23:49 +0800 Subject: [PATCH] feat: api --- apps/bMiniApp/src/subpackages/authentication/hooks/index.ts | 156 ++++++++++++++++++++++++++-------------------------- 1 files changed, 78 insertions(+), 78 deletions(-) diff --git a/apps/bMiniApp/src/subpackages/authentication/hooks/index.ts b/apps/bMiniApp/src/subpackages/authentication/hooks/index.ts index 47afee2..8fddc35 100644 --- a/apps/bMiniApp/src/subpackages/authentication/hooks/index.ts +++ b/apps/bMiniApp/src/subpackages/authentication/hooks/index.ts @@ -10,9 +10,9 @@ UserCertificationPayType, } from '@12333/constants'; import * as commonServices from '@12333/services/api/Common'; -import * as userServices from '@12333/services/api/User'; +// import * as userServices from '@12333/services/api/User'; import { FormValidator, Message } from '@12333/utils'; -import { useUserCertificationSetting } from '@12333/hooks'; +// import { useUserCertificationSetting } from '@12333/hooks'; import Taro from '@tarojs/taro'; type UseAuthenticationFlowOptions = { @@ -28,7 +28,7 @@ const form = reactive({ licenseUrl: [] as FileItem[], - enterpriseType: userDetail.value?.authType ?? EnterpriseType.HREnterprise, + // enterpriseType: userDetail.value?.authType ?? EnterpriseType.HREnterprise, enterpriseName: '', societyCreditCode: '', certificationMode: certificationMode, @@ -89,7 +89,7 @@ ], }; - const { updateUserInfo } = useUser(); + // const { updateUserInfo } = useUser(); const formRef = ref<any>(null); @@ -97,59 +97,59 @@ if (!formRef.value) return; formRef.value.validate().then(({ valid, errors }: any) => { if (valid) { - addUserCertificationAudit(); + // addUserCertificationAudit(); } }); } const loading = ref(false); - async function addUserCertificationAudit() { - try { - let params: API.AddUserCertificationAuditInput = { - enterpriseType: form.enterpriseType, - licenseUrl: form.licenseUrl[0].path, - enterpriseName: form.enterpriseName, - societyCreditCode: form.societyCreditCode, - certificationMode: form.certificationMode, - legalPersonName: form.legalPersonName, - legalPersonIdNumber: form.legalPersonIdNumber, - legalPersonIdImgUrl: form.legalPersonIdFrontImgUrl?.[0]?.path ?? '', - legalPersonIdBackImgUrl: form.legalPersonIdBackImgUrl?.[0]?.path ?? '', - legalPersonBankCardImgUrl: form.legalPersonBankCardImgUrl?.[0]?.path ?? '', - certificationContact: - form.certificationElement === UserCertificationElementEnum.Identity4 - ? form.legalPersonName - : form.proxyPersonName, - certificationContactPhone: - form.certificationElement === UserCertificationElementEnum.Identity4 - ? form.legalPersonContactPhone - : form.proxyPersonContactPhone, - proxyPersonName: form.proxyPersonName, - proxyPersonIdNumber: form.proxyPersonIdNumber, - proxyPersonIdImgUrl: form.proxyPersonIdFrontImgUrl?.[0]?.path ?? '', - proxyPersonIdBackImgUrl: form.proxyPersonIdBackImgUrl?.[0]?.path ?? '', - proxyPersonBankCardImgUrl: form.proxyPersonBankCardImgUrl?.[0]?.path ?? '', - proxyPowerAttorneyUrl: form.proxyPowerAttorneyUrl?.[0]?.path ?? '', - certificationChannel: UserCertificationChannelEnum.ThirdParty, - certificationElement: form.certificationElement, - vCode: form.verificationCode, - bankCardNumber: form.bankCardNumber, - payType: UserCertificationPayType.NotNeedPay, - }; - loading.value = true; - let res = await userServices.addUserCertificationAudit(params, { showLoading: false }); - if (res) { - updateUserInfo(); - Taro.redirectTo({ - url: RouterPath.authenticationResult, - }); - } - } catch (error) { - } finally { - loading.value = false; - } - } + // async function addUserCertificationAudit() { + // try { + // let params: API.AddUserCertificationAuditInput = { + // enterpriseType: form.enterpriseType, + // licenseUrl: form.licenseUrl[0].path, + // enterpriseName: form.enterpriseName, + // societyCreditCode: form.societyCreditCode, + // certificationMode: form.certificationMode, + // legalPersonName: form.legalPersonName, + // legalPersonIdNumber: form.legalPersonIdNumber, + // legalPersonIdImgUrl: form.legalPersonIdFrontImgUrl?.[0]?.path ?? '', + // legalPersonIdBackImgUrl: form.legalPersonIdBackImgUrl?.[0]?.path ?? '', + // legalPersonBankCardImgUrl: form.legalPersonBankCardImgUrl?.[0]?.path ?? '', + // certificationContact: + // form.certificationElement === UserCertificationElementEnum.Identity4 + // ? form.legalPersonName + // : form.proxyPersonName, + // certificationContactPhone: + // form.certificationElement === UserCertificationElementEnum.Identity4 + // ? form.legalPersonContactPhone + // : form.proxyPersonContactPhone, + // proxyPersonName: form.proxyPersonName, + // proxyPersonIdNumber: form.proxyPersonIdNumber, + // proxyPersonIdImgUrl: form.proxyPersonIdFrontImgUrl?.[0]?.path ?? '', + // proxyPersonIdBackImgUrl: form.proxyPersonIdBackImgUrl?.[0]?.path ?? '', + // proxyPersonBankCardImgUrl: form.proxyPersonBankCardImgUrl?.[0]?.path ?? '', + // proxyPowerAttorneyUrl: form.proxyPowerAttorneyUrl?.[0]?.path ?? '', + // certificationChannel: UserCertificationChannelEnum.ThirdParty, + // certificationElement: form.certificationElement, + // vCode: form.verificationCode, + // bankCardNumber: form.bankCardNumber, + // payType: UserCertificationPayType.NotNeedPay, + // }; + // loading.value = true; + // let res = await userServices.addUserCertificationAudit(params, { showLoading: false }); + // if (res) { + // updateUserInfo(); + // Taro.redirectTo({ + // url: RouterPath.authenticationResult, + // }); + // } + // } catch (error) { + // } finally { + // loading.value = false; + // } + // } return { form, @@ -160,32 +160,32 @@ }; } -export function useDownloadPowerAttorneyTemplate() { - const { userCertificationSetting } = useUserCertificationSetting(); +// export function useDownloadPowerAttorneyTemplate() { +// // const { userCertificationSetting } = useUserCertificationSetting(); - function downloadPowerAttorneyTemplate() { - Taro.showLoading({ - title: '涓嬭浇涓�', - }); - Taro.downloadFile({ - url: userCertificationSetting.value.enterprisePowerAttorneyTempPath, - success: function (res) { - Taro.hideLoading(); - // Message.success('涓嬭浇鎴愬姛'); - var filePath = res.tempFilePath; - Taro.openDocument({ - filePath: filePath, - showMenu: true, - }); - }, - fail: function (error: any) { - Taro.hideLoading(); - Message.error('涓嬭浇澶辫触'); - }, - }); - } +// function downloadPowerAttorneyTemplate() { +// Taro.showLoading({ +// title: '涓嬭浇涓�', +// }); +// Taro.downloadFile({ +// url: userCertificationSetting.value.enterprisePowerAttorneyTempPath, +// success: function (res) { +// Taro.hideLoading(); +// // Message.success('涓嬭浇鎴愬姛'); +// var filePath = res.tempFilePath; +// Taro.openDocument({ +// filePath: filePath, +// showMenu: true, +// }); +// }, +// fail: function (error: any) { +// Taro.hideLoading(); +// Message.error('涓嬭浇澶辫触'); +// }, +// }); +// } - return { - downloadPowerAttorneyTemplate, - }; -} +// return { +// downloadPowerAttorneyTemplate, +// }; +// } -- Gitblit v1.9.1