diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 32cba38..6569a56 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -15,6 +15,7 @@ const viewEn: any = { "view.billing_billservice":"Bill service", "view.set-meal": "Package", "view.userInfo":"User Information", + "view.userInfo_kyc":"KYC certification", "view.userInfo_profile":"Change Information", "view.userInfo_resetpwd":"Reset Password", "view.userInfo_device":"Device management", @@ -535,6 +536,7 @@ const local: any = { deviceCount: "Device", }, userInfo:{ + kyc:'KYC certification', user:'User', ownInfo:'Personal Information', changepassword:'Change password', @@ -613,7 +615,7 @@ const local: any = { usercard:{ changeInfo:"Change Information", resetpwd:"Reset password", - KYC:"KYC Certification", + kyc:"KYC Certification", deviceconsole:"Device management", access:"Currently connected device", records:"History connected", @@ -635,6 +637,7 @@ const local: any = { updateFailed: 'Update failed' }, recharge:{ + recharge:"Recharge", balanceRecharge:'Banlance Recharge', packageSubscription:'Package Subscription', }, diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 1da9bb5..5f54ebb 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -15,6 +15,7 @@ const viewZh: any = { "view.billing_Internetdetails":"上网详单", "view.set-meal": "套餐", "view.userInfo":"个人信息", + "view.userInfo_kyc":"KYC认证", "view.userInfo_profile":"修改信息", "view.userInfo_resetpwd":"修改密码", "view.userInfo_device":"设备管理", @@ -535,6 +536,7 @@ const local:any = { deviceCount: "设备数", }, userInfo:{ + kyc:'KYC认证', user:'用户', ownInfo:'个人信息', changepassword:'修改密码', @@ -613,7 +615,7 @@ const local:any = { usercard:{ changeInfo:"修改信息", resetpwd:"修改密码", - KYC:"KYC认证", + kyc:"KYC认证", deviceconsole:"设备管理", access:"当前设备", records:"历史连接", @@ -635,6 +637,7 @@ const local:any = { updateFailed: '更新失败' }, recharge:{ + recharge:"充值服务", balanceRecharge:'余额充值', packageSubscription:'套餐办理', }, diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index 494c1f5..e8a6171 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -334,6 +334,18 @@ export const customRoutes: GeneratedRoute[] = [ hideInMenu: true }, }, + { + name: 'billing_recharge', + path: '/billing/recharge', + component: 'view.billing_recharge', + meta: { + title: '充值服务', + i18nKey: 'view.recharge_rechargeservice', + icon: 'material-symbols:filter-list-off', + order: 2, + hideInMenu: true + }, + }, { name: 'billing_histories', path: '/billing/histories', @@ -342,7 +354,7 @@ export const customRoutes: GeneratedRoute[] = [ title: '历史查询', i18nKey: 'view.billing_histories', icon: 'material-symbols:filter-list-off', - order: 2 + order: 3 }, }, { @@ -353,7 +365,7 @@ export const customRoutes: GeneratedRoute[] = [ title: '充值记录', i18nKey: 'view.billing_Rechargehistory', icon: 'material-symbols:filter-list-off', - order: 7 + order: 4 }, }, { @@ -415,6 +427,17 @@ export const customRoutes: GeneratedRoute[] = [ hideInMenu: true } }, + { + name: 'user-info_kyc', + path: '/userInfo/kyc', + component: 'view.userInfo_kyc', + meta: { + title: 'KYC认证', + i18nKey: 'view.userInfo_kyc', + order:18, + hideInMenu: true + } + }, { name: 'user-info_profile', path: '/userInfo/profile', diff --git a/src/service/api/auth.ts b/src/service/api/auth.ts index 28bf84c..66dd6a7 100644 --- a/src/service/api/auth.ts +++ b/src/service/api/auth.ts @@ -160,4 +160,36 @@ export function fetchPackageHistory(params: Api.Package.PackageHistoryQueryParam params }); } +/** Get KYC status */ +export function fetchKYCStatus() { + return request({ + url: '/u/kyc/page', + method: 'get' + }); +} + +/** Submit KYC verification */ +export function submitKYCVerification(data: Api.KYC.KYCVerifyParams) { + return request({ + url: '/u/kyc/verify', + method: 'post', + data + }); +} + +/** Upload file */ +export function uploadFile(file: File) { + const formData = new FormData(); + formData.append('file', file); + return request<{ name: string; url: string }>({ + url: '/file/upload', + method: 'post', + headers: { + 'Content-Type': 'multipart/form-data' + }, + data: formData + }); +} + + diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index b8f2cdb..dc9f571 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -721,4 +721,46 @@ declare namespace Api { /** Combined order params type */ type SubmitOrderParams = PackageOrderParams | RechargeOrderParams; } + namespace KYC { + /** KYC status enum */ + type KYCStatus = 0 | 1 | 2; // 0: 未认证, 1: 认证中, 2: 已认证 + + /** KYC info */ + interface KYCInfo { + status: KYCStatus; + fullName?: string; + birthDate?: string; + idCardFile?: string; + photoFile?: string; + rejectReason?: string; + verifiedTime?: string; + } + + /** KYC response */ + interface KYCResponse { + code: number; + msg: string; + data: KYCInfo; + } + + /** ID Type enum */ + enum IDType { + DRIVERS_LICENSE = 1, + PASSPORT = 2, + RESIDENCE_PERMIT = 3, + STUDENT_ID = 4, + MEDICARE_CARD = 5, + BIRTH_CERTIFICATE = 6 + } + + /** KYC verify params */ + interface KYCVerifyParams { + realName:string; + birthDate: string; + idType: IDType; // 改为数字类型 + idFile: string; + identifyPicture: string; + kycRequestStatus: number; + } + } } diff --git a/src/typings/auto-imports.d.ts b/src/typings/auto-imports.d.ts index e9ad4da..aba38b0 100644 --- a/src/typings/auto-imports.d.ts +++ b/src/typings/auto-imports.d.ts @@ -102,6 +102,7 @@ declare global { const fetchGetMenuTree: typeof import('../service/api/menu')['fetchGetMenuTree'] const fetchHistoricalDevices: typeof import('../service/api/auth')['fetchHistoricalDevices'] const fetchIsRouteExist: typeof import('../service/api/route')['fetchIsRouteExist'] + const fetchKYCStatus: typeof import('../service/api/auth')['fetchKYCStatus'] const fetchLogin: typeof import('../service/api/auth')['fetchLogin'] const fetchPackageHistory: typeof import('../service/api/auth')['fetchPackageHistory'] const fetchPackageList: typeof import('../service/api/auth')['fetchPackageList'] @@ -204,6 +205,7 @@ declare global { const shallowRef: typeof import('vue')['shallowRef'] const sortRoutesByOrder: typeof import('../store/modules/route/shared')['sortRoutesByOrder'] const storeToRefs: typeof import('pinia')['storeToRefs'] + const submitKYCVerification: typeof import('../service/api/auth')['submitKYCVerification'] const submitOrder: typeof import('../service/api/auth')['submitOrder'] const submitPackageOrder: typeof import('../service/api/auth')['submitPackageOrder'] const suite: typeof import('vitest')['suite'] @@ -236,6 +238,7 @@ declare global { const updateLocaleOfGlobalMenus: typeof import('../store/modules/route/shared')['updateLocaleOfGlobalMenus'] const updateTabByI18nKey: typeof import('../store/modules/tab/shared')['updateTabByI18nKey'] const updateTabsByI18nKey: typeof import('../store/modules/tab/shared')['updateTabsByI18nKey'] + const uploadFile: typeof import('../service/api/auth')['uploadFile'] const useActiveElement: typeof import('@vueuse/core')['useActiveElement'] const useAnimate: typeof import('@vueuse/core')['useAnimate'] const useAntdForm: typeof import('../hooks/common/form')['useAntdForm'] diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index d0dcd11..7838d49 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -7,6 +7,7 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { + AAlert: typeof import('ant-design-vue/es')['Alert'] ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb'] ABreadcrumbItem: typeof import('ant-design-vue/es')['BreadcrumbItem'] AButton: typeof import('ant-design-vue/es')['Button'] @@ -54,6 +55,7 @@ declare module 'vue' { ATooltip: typeof import('ant-design-vue/es')['Tooltip'] ATree: typeof import('ant-design-vue/es')['Tree'] ATreeSelect: typeof import('ant-design-vue/es')['TreeSelect'] + AUpload: typeof import('ant-design-vue/es')['Upload'] BetterScroll: typeof import('./../components/custom/better-scroll.vue')['default'] ButtonIcon: typeof import('./../components/custom/button-icon.vue')['default'] CountTo: typeof import('./../components/custom/count-to.vue')['default'] diff --git a/src/views/userInfo/kyc/index.vue b/src/views/userInfo/kyc/index.vue new file mode 100644 index 0000000..0ba801a --- /dev/null +++ b/src/views/userInfo/kyc/index.vue @@ -0,0 +1,549 @@ + + + + +