From 52f5d19029aad501ccac17c13a4f9fecfd240959 Mon Sep 17 00:00:00 2001 From: bootx Date: Tue, 4 Nov 2025 13:40:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(system):=20=E6=96=B0=E5=A2=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9FAPI=E5=8F=8A=E5=95=86=E6=88=B7=E8=BF=9B=E4=BB=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除FileUpload.api.ts中冗余的headers参数 - System.api.ts新增地区树、OCR识别等相关接口与类型定义 - BUpload.vue组件移除webHeader属性及相关逻辑 - 路由配置新增进件相关路由(DaxPayOnboardedRoute, DaxPayMiniRoute) - 新增token状态管理模块(useTokenStore)- axios请求拦截器集成token和clientCode自动注入- OnbMchApply.api.ts重构,移除重复定义并优化接口调用 - HkrtApply.vue和LeshuaApply.vue移除web-header绑定,使用全局token管理 - 所有API调用统一去除headers参数传递,改为全局拦截器处理 --- src/api/FileUpload.api.ts | 6 +- src/api/System.api.ts | 201 ++++- src/components/BUpload.vue | 6 +- src/router/daxpay.ts | 44 + src/router/index.ts | 4 +- src/store/modules/designSetting.ts | 2 +- src/store/modules/token.ts | 37 + src/utils/http/axios/index.ts | 16 + .../h5/onboarded/common/OnbMchApply.api.ts | 211 +---- .../h5/onboarded/common/OnbMchApplyUtil.ts | 4 +- .../daxpay/h5/onboarded/hkrt/HkrtApply.api.ts | 12 +- .../daxpay/h5/onboarded/hkrt/HkrtApply.vue | 49 +- .../h5/onboarded/leshua/LeshuaApply.api.ts | 12 +- .../h5/onboarded/leshua/LeshuaApply.vue | 63 +- .../daxpay/h5/onboarded/sand/SandApply.api.ts | 12 +- .../daxpay/h5/onboarded/sand/SandApply.vue | 51 +- .../h5/onboarded/vbill/VbillApply.api.ts | 12 +- .../daxpay/h5/onboarded/vbill/VbillApply.vue | 62 +- .../miniapp/merchant/profile/MchMainBody.vue | 821 ++++++++++++++++++ .../merchant/profile/MchSettleInfo.vue | 367 ++++++++ .../miniapp/merchant/profile/MchShopInfo.vue | 273 ++++++ .../merchant/profile/MerchantProfile.api.ts | 283 ++++++ 22 files changed, 2167 insertions(+), 381 deletions(-) create mode 100644 src/store/modules/token.ts create mode 100644 src/views/daxpay/miniapp/merchant/profile/MchMainBody.vue create mode 100644 src/views/daxpay/miniapp/merchant/profile/MchSettleInfo.vue create mode 100644 src/views/daxpay/miniapp/merchant/profile/MchShopInfo.vue create mode 100644 src/views/daxpay/miniapp/merchant/profile/MerchantProfile.api.ts diff --git a/src/api/FileUpload.api.ts b/src/api/FileUpload.api.ts index 3fc8b94..e69bf69 100644 --- a/src/api/FileUpload.api.ts +++ b/src/api/FileUpload.api.ts @@ -4,24 +4,22 @@ import { http } from '@/utils/http/axios' /** * 对象存储预签名 */ -export function getUploadParams(param: FileUploadRequestParams, headers) { +export function getUploadParams(param: FileUploadRequestParams) { return http.request>({ url: '/file/getUploadParams', method: 'post', data: param, - headers, }) } /** * 保存前端直传文件信息 */ -export function saveOssFileInfo(fileInfo: UpdateFileInfo, headers) { +export function saveOssFileInfo(fileInfo: UpdateFileInfo) { return http.request>({ url: '/file/saveFileInfo', method: 'post', data: fileInfo, - headers, }) } diff --git a/src/api/System.api.ts b/src/api/System.api.ts index e8d3727..6cc6cba 100644 --- a/src/api/System.api.ts +++ b/src/api/System.api.ts @@ -1,8 +1,8 @@ -import type { Result } from '#/axios' +import type { MchEntity, Result } from '#/axios' import { http } from '@/utils/http/axios' /** - * 对象存储预签名 + * 获取站点信息 */ export function getWebsite() { return http.request>({ @@ -11,6 +11,53 @@ export function getWebsite() { }) } +/** + * 地区树 + */ +export function findAllProvinceAndCityAndArea() { + return http.request>({ + url: '/china/region/findAllProvinceAndCityAndArea', + method: 'get', + }) +} + +/** + * 获取 + */ + +/** + * 身份证OCR + */ +export function idCardOcr(uri, type: 'ID_CARD_FRONT' | 'ID_CARD_BACK') { + return http.request>({ + url: '/ocr/idCard', + method: 'post', + params: { uri, type }, + }) +} + +/** + * 营业执照识别 + */ +export function licenseOcr(uri) { + return http.request>({ + url: '/ocr/businessLicense', + method: 'post', + params: { uri }, + }) +} + +/** + * 银行卡识别 + */ +export function bankCardOcr(uri) { + return http.request>({ + url: '/ocr/bankCard', + method: 'post', + params: { uri }, + }) +} + /** * 站点显示内容配置 * @author xxm @@ -50,4 +97,154 @@ export interface PlatformWebsiteConfig { /** 版权信息链接 */ copyrightLink?: string } +/** + * 区域 + */ +export interface Region { + code: string + name: string + /** 省市区街道 */ + level: 1 | 2 | 3 | 4 + isLeaf?: boolean + children: Region[] +} +/** + * 商户主体信息参数 + */ +export interface MchMainBody { + // 基础信息 + base: MchBaseProfile + // 法人信息 + legal: MchLegalProfile + // 营业执照信息 + license: MchLicenseProfile +} + +/** + * 商户基础信息 + */ +export interface MchBaseProfile extends MchEntity { + // 商户类型 + merchantType?: string + // 商户名称 + merchantName?: string + // 商户简称 + merchantShortName?: string +} + +/** + * 商户法人信息 + */ +export interface MchLegalProfile extends MchEntity { + // 法人姓名 + legalName?: string + // 法人证件号 + certNo?: string + // 联系手机号 + contactPhone?: string + // 长期有效 + periodLong?: boolean + // 法人证件开始日期 + startDate?: string + // 法人证件结束日期 + endDate?: string + // 身份证地址 + address?: string + // 法人身份证正面照片 + frontPic?: string + // 法人身份证反面照片 + backPic?: string +} + +/** + * 商户营业执照信息 + */ +export interface MchLicenseProfile extends MchEntity { + // 营业执照号 + licenseNo?: string + // 营业执照名称 + licenseName?: string + // 执照地址-省市区编码 + regionCode?: string[] + // 营业执照详细地址 + address?: string + // 营业执照长期有效 + periodLong?: boolean + // 营业执照开始日期 + startDate?: string + // 营业执照结束日期 + endDate?: string + // 营业执照照片 + licensePic?: string +} + +/** + * 身份证识别结果 + */ +export interface IdCardOCRResult { + /** 身份证号 */ + idNumber?: string + /** 姓名 */ + name?: string + /** 性别 */ + sex?: string + /** 生日 */ + birthDate?: string + /** 地址 */ + address?: string + /** 民族 */ + nation?: string + /** 签发机关 */ + issue?: string + /** 有效期限 */ + expire?: string + /** 是否长期有效 */ + periodLong?: boolean + /** 开始时间 */ + startDate?: string + /** 结束时间 */ + endDate?: string +} + +/** + * 营业执照识别结果 + */ +export interface BusinessLicenseOCRResult { + /** 公司名称 */ + name?: string + /** 公司编号 */ + number?: string + /** 注册地址 */ + address?: string + /** 法人 */ + legalPerson?: string + /** 是否长期有效 */ + periodLong?: boolean + /** 营业期开始时间 */ + startDate?: string + /** 营业期结束时间 */ + endDate?: string + /** 公司类型 */ + companyType?: string + /** 经营范围 */ + businessScope?: string + /** 注册时间 */ + registeredDate?: string + /** 证件签发时间 */ + issueDate?: string +} + +/** + * 银行卡识别结果 + */ +export interface BankCardOCRResult { + /** 银行名称 */ + bankName?: string + /** 银行卡号 */ + cardNumber?: string + /** 银行卡类型 */ + cardType?: string + /** 有效期 */ + validToDate?: string +} diff --git a/src/components/BUpload.vue b/src/components/BUpload.vue index 0781d6c..bbb60eb 100644 --- a/src/components/BUpload.vue +++ b/src/components/BUpload.vue @@ -20,7 +20,7 @@ import { getUploadParams, saveOssFileInfo, uploadFile } from '@/api/FileUpload.a import type { WebHeaders } from '#/web' // size大小为kb -const { showable = false, maxSize = 1024, webHeader } = defineProps<{ +const { showable = false, maxSize = 1024 } = defineProps<{ showable?: boolean maxSize?: number webHeader?: WebHeaders @@ -48,7 +48,7 @@ async function afterRead(fileObj) { fileName: file.name, mediaType: file.type || '*/*', fileSize: file.size, - }, webHeader) + }) .then(({ data }) => { // 预签名形式 uploadUrl.value = data.url @@ -68,7 +68,7 @@ async function afterRead(fileObj) { originalFilename: file.name, filename: uploadAttachName.value, contentType: file.type, - }, webHeader) + }) .then(() => { picUrl.value = url showNotify({ type: 'success', message: '文件上传成功' }) diff --git a/src/router/daxpay.ts b/src/router/daxpay.ts index ecb9032..09fc164 100644 --- a/src/router/daxpay.ts +++ b/src/router/daxpay.ts @@ -109,6 +109,16 @@ export const DaxPayH5Route: RouteRecordRaw = { title: '错误提示', }, }, + ], +} + +/** + * 进件相关 + */ +export const DaxPayOnboardedRoute: RouteRecordRaw = { + path: '/onboarded', + name: 'onboarded', + children: [ { path: '/onboarded/leshua_pay', name: 'leshua', @@ -143,6 +153,40 @@ export const DaxPayH5Route: RouteRecordRaw = { }, ], } + +/** + * 小程序内嵌页面 + */ +export const DaxPayMiniRoute: RouteRecordRaw = { + path: '/mini', + name: 'mini', + children: [ + { + path: '/mini/mch/profile/main', + name: 'MchMainBody', + component: () => import('@/views/daxpay/miniapp/merchant/profile/MchMainBody.vue'), + meta: { + title: '主体信息', + }, + }, + { + path: '/mini/mch/profile/shop', + name: 'MchShopInfo', + component: () => import('@/views/daxpay/miniapp/merchant/profile/MchShopInfo.vue'), + meta: { + title: '经营信息', + }, + }, + { + path: '/mini/mch/profile/settle', + name: 'MchSettleInfo', + component: () => import('@/views/daxpay/miniapp/merchant/profile/MchSettleInfo.vue'), + meta: { + title: '结算信息', + }, + }, + ], +} /** * pc页面 */ diff --git a/src/router/index.ts b/src/router/index.ts index 7d74b6f..0c85607 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -5,13 +5,15 @@ import { ErrorPageRoute, routeModuleList } from '@/router/base' import { useRouteStoreWidthOut } from '@/store/modules/route' // 菜单 -import { DaxPayH5Route, DaxPayPcRoute } from '@/router/daxpay' +import { DaxPayH5Route, DaxPayMiniRoute, DaxPayOnboardedRoute, DaxPayPcRoute } from '@/router/daxpay' import { getSystemTitle } from '@/settings/initWebsiteConfig' // 普通路由 export const constantRouter: RouteRecordRaw[] = [ DaxPayH5Route, DaxPayPcRoute, + DaxPayOnboardedRoute, + DaxPayMiniRoute, ErrorPageRoute, ] diff --git a/src/store/modules/designSetting.ts b/src/store/modules/designSetting.ts index b03bb95..8386ea6 100644 --- a/src/store/modules/designSetting.ts +++ b/src/store/modules/designSetting.ts @@ -3,7 +3,7 @@ import { store } from '@/store' import designSetting from '@/settings/designSetting' import type { DesignSettingState } from '@/settings/designSetting' -const { appTheme, appThemeList, isPageAnimate, pageAnimateType } = designSetting +const { appTheme, appThemeList, isPageAnimate, pageAnimateType } = designSetting export const useDesignSettingStore = defineStore({ id: 'app-design-setting', diff --git a/src/store/modules/token.ts b/src/store/modules/token.ts new file mode 100644 index 0000000..773b4db --- /dev/null +++ b/src/store/modules/token.ts @@ -0,0 +1,37 @@ +import { defineStore } from 'pinia' + +export const useTokenStore = defineStore( + 'token-store', + () => { + const tokenValue = ref('') + const clientCode = ref('') + const setToken = (val: string) => { + tokenValue.value = val + } + const getToken = () => { + return tokenValue.value + } + + const clearToken = () => { + tokenValue.value = '' + } + const setClientCode = (val: string) => { + clientCode.value = val + } + const getClientCode = () => { + return clientCode.value + } + const isLogin = computed(() => !!tokenValue.value) + + return { + setToken, + getToken, + clearToken, + setClientCode, + getClientCode, + isLogin, + tokenValue, + clientCode, + } + }, +) diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index e148bae..ce761a5 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -13,6 +13,7 @@ import { isString } from '@/utils/is/' import { deepMerge, isUrl } from '@/utils' import { setObjToUrlParams } from '@/utils/urlUtils' import type { Result } from '#/axios' +import { useTokenStore } from '@/store/modules/token' const globSetting = useGlobSetting() const urlPrefix = globSetting.urlPrefix @@ -102,6 +103,21 @@ const transform: AxiosTransform = { if (!isUrlStr && apiUrl && isString(apiUrl)) { /* empty */ } const params = config.params || {} const data = config.data || false + // token + const { getToken, getClientCode } = useTokenStore() + if ((config as Recordable).headers) { + config.headers = { + ...config.headers, + 'AccessToken': getToken(), + 'x-client-code': getClientCode(), + } + } + else { + ;(config as Recordable).headers = { + 'AccessToken': getToken(), + 'x-client-code': getClientCode(), + } + } if (config.method?.toUpperCase() === RequestEnum.GET) { if (!isString(params)) { // 给 get 请求加上时间戳参数,避免从缓存中拿数据。 diff --git a/src/views/daxpay/h5/onboarded/common/OnbMchApply.api.ts b/src/views/daxpay/h5/onboarded/common/OnbMchApply.api.ts index 9b4a795..2d7d3e3 100644 --- a/src/views/daxpay/h5/onboarded/common/OnbMchApply.api.ts +++ b/src/views/daxpay/h5/onboarded/common/OnbMchApply.api.ts @@ -1,248 +1,47 @@ import { http } from '@/utils/http/axios' import type { MchEntity, Result } from '#/axios' -/** - * 地区树 - */ -export function findAllProvinceAndCityAndArea() { - return http.request>({ - url: '/china/region/findAllProvinceAndCityAndArea', - method: 'get', - }) -} +import {MchMainBody} from "@/api/System.api"; /** * 提交进件申请(独立H5模式) */ -export function submitH5(id, sign, headers) { +export function submitH5(id, sign) { return http.request({ url: '/onb/mch/apply/h5/submit', method: 'post', params: { id, sign }, - headers, }) } /** * 提交进件申请(嵌入模式) */ -export function submit(id, headers) { +export function submit(id) { return http.request({ url: '/onb/mch/apply/submit', method: 'post', params: { id }, - headers, }) } - -/** - * 身份证OCR - */ -export function idCardOcr(uri, type: 'ID_CARD_FRONT' | 'ID_CARD_BACK', headers) { - return http.request>({ - url: '/ocr/idCard', - method: 'post', - params: { uri, type }, - headers, - }) -} - -/** - * 营业执照识别 - */ -export function licenseOcr(uri, headers) { - return http.request>({ - url: '/ocr/businessLicense', - method: 'post', - params: { uri }, - headers, - }) -} - -/** - * 银行卡识别 - */ -export function bankCardOcr(uri, headers) { - return http.request>({ - url: '/ocr/bankCard', - method: 'post', - params: { uri }, - headers, - }) -} - /** * 获取商户主体信息(嵌入) */ -export function getMainBody(mchNo: string, headers) { +export function getMainBody(mchNo: string) { return http.request>({ url: '/merchant/profile/getMainBody', params: { mchNo }, - headers, }) } /** * 获取商户店铺信息(嵌入) */ -export function getShopInfo(mchNo: string, headers) { +export function getShopInfo(mchNo: string) { return http.request>({ url: '/merchant/profile/shop/findByMchNo', params: { mchNo }, - headers, }) } -/** - * 区域 - */ -export interface Region { - code: string - name: string - /** 省市区街道 */ - level: 1 | 2 | 3 | 4 - isLeaf?: boolean - children: Region[] -} - -/** - * 身份证识别结果 - */ -export interface IdCardOCRResult { - /** 身份证号 */ - idNumber?: string - /** 姓名 */ - name?: string - /** 性别 */ - sex?: string - /** 生日 */ - birthDate?: string - /** 地址 */ - address?: string - /** 民族 */ - nation?: string - /** 签发机关 */ - issue?: string - /** 有效期限 */ - expire?: string - /** 是否长期有效 */ - periodLong?: boolean - /** 开始时间 */ - startDate?: string - /** 结束时间 */ - endDate?: string -} - -/** - * 营业执照识别结果 - */ -export interface BusinessLicenseOCRResult { - /** 公司名称 */ - name?: string - /** 公司编号 */ - number?: string - /** 注册地址 */ - address?: string - /** 法人 */ - legalPerson?: string - /** 是否长期有效 */ - periodLong?: boolean - /** 营业期开始时间 */ - startDate?: string - /** 营业期结束时间 */ - endDate?: string - /** 公司类型 */ - companyType?: string - /** 经营范围 */ - businessScope?: string - /** 注册时间 */ - registeredDate?: string - /** 证件签发时间 */ - issueDate?: string -} - -/** - * 银行卡识别结果 - */ -export interface BankCardOCRResult { - /** 银行名称 */ - bankName?: string - /** 银行卡号 */ - cardNumber?: string - /** 银行卡类型 */ - cardType?: string - /** 有效期 */ - validToDate?: string -} - -/** - * 商户主体信息参数 - */ -export interface MchMainBody { - // 基础信息 - base: MchBaseProfile - // 法人信息 - legal: MchLegalProfile - // 营业执照信息 - license: MchLicenseProfile -} - -/** - * 商户基础信息 - */ -export interface MchBaseProfile extends MchEntity { - // 商户类型 - merchantType?: string - // 商户名称 - merchantName?: string - // 商户简称 - merchantShortName?: string -} - -/** - * 商户法人信息 - */ -export interface MchLegalProfile extends MchEntity { - // 法人姓名 - legalName?: string - // 法人证件号 - certNo?: string - // 联系手机号 - contactPhone?: string - // 长期有效 - periodLong?: boolean - // 法人证件开始日期 - startDate?: string - // 法人证件结束日期 - endDate?: string - // 身份证地址 - address?: string - // 法人身份证正面照片 - frontPic?: string - // 法人身份证反面照片 - backPic?: string -} - -/** - * 商户营业执照信息 - */ -export interface MchLicenseProfile extends MchEntity { - // 营业执照号 - licenseNo?: string - // 营业执照名称 - licenseName?: string - // 执照地址-省市区编码 - regionCode?: string[] - // 营业执照详细地址 - address?: string - // 营业执照长期有效 - periodLong?: boolean - // 营业执照开始日期 - startDate?: string - // 营业执照结束日期 - endDate?: string - // 营业执照照片 - licensePic?: string -} - /** * 商户店铺信息 */ diff --git a/src/views/daxpay/h5/onboarded/common/OnbMchApplyUtil.ts b/src/views/daxpay/h5/onboarded/common/OnbMchApplyUtil.ts index 929e954..e1c9b37 100644 --- a/src/views/daxpay/h5/onboarded/common/OnbMchApplyUtil.ts +++ b/src/views/daxpay/h5/onboarded/common/OnbMchApplyUtil.ts @@ -3,9 +3,9 @@ import { getMainBody, getShopInfo } from '@/views/daxpay/h5/onboarded/common/Onb /** * 初始化商户信息 */ -export async function initMerchantProfile(form, mchNo, headers) { +export async function initMerchantProfile(form, mchNo) { // 并行调用三个接口获取数据 - const [mainBodyRes, shopInfoRes] = await Promise.all([getMainBody(mchNo, headers), getShopInfo(mchNo, headers)]) + const [mainBodyRes, shopInfoRes] = await Promise.all([getMainBody(mchNo), getShopInfo(mchNo)]) // 映射主体信息到表单 if (mainBodyRes.data) { diff --git a/src/views/daxpay/h5/onboarded/hkrt/HkrtApply.api.ts b/src/views/daxpay/h5/onboarded/hkrt/HkrtApply.api.ts index c96b033..3a7652f 100644 --- a/src/views/daxpay/h5/onboarded/hkrt/HkrtApply.api.ts +++ b/src/views/daxpay/h5/onboarded/hkrt/HkrtApply.api.ts @@ -12,49 +12,45 @@ import type { /** * 查询(独立H5模式) */ -export function findH5ById(id, sign, headers) { +export function findH5ById(id, sign) { return http.request>({ method: 'get', url: '/hkrt/onb/apply/h5/findById', params: { id, sign }, - headers, }) } /** * 保存信息(独立H5模式) */ -export function saveH5(param: MerchantApply, sign, headers) { +export function saveH5(param: MerchantApply, sign) { return http.request>({ method: 'post', url: '/hkrt/onb/apply/h5/save', data: param, params: { sign }, - headers, }) } /** * 查询(嵌入模式) */ -export function findById(id, headers) { +export function findById(id) { return http.request>({ method: 'get', url: '/hkrt/onb/apply/findById', params: { id }, - headers, }) } /** * 保存信息(嵌入模式) */ -export function save(param: MerchantApply, headers) { +export function save(param: MerchantApply) { return http.request>({ method: 'post', url: '/hkrt/onb/apply/save', data: param, - headers, }) } diff --git a/src/views/daxpay/h5/onboarded/hkrt/HkrtApply.vue b/src/views/daxpay/h5/onboarded/hkrt/HkrtApply.vue index b0ade82..7df8280 100644 --- a/src/views/daxpay/h5/onboarded/hkrt/HkrtApply.vue +++ b/src/views/daxpay/h5/onboarded/hkrt/HkrtApply.vue @@ -69,7 +69,6 @@ @@ -361,7 +357,6 @@ @@ -378,7 +373,6 @@ @@ -442,7 +436,6 @@ @@ -564,7 +556,6 @@ @@ -592,7 +583,6 @@ @@ -609,7 +599,6 @@ @@ -644,25 +633,22 @@ + + diff --git a/src/views/daxpay/miniapp/merchant/profile/MchSettleInfo.vue b/src/views/daxpay/miniapp/merchant/profile/MchSettleInfo.vue new file mode 100644 index 0000000..43a3892 --- /dev/null +++ b/src/views/daxpay/miniapp/merchant/profile/MchSettleInfo.vue @@ -0,0 +1,367 @@ + + + + + diff --git a/src/views/daxpay/miniapp/merchant/profile/MchShopInfo.vue b/src/views/daxpay/miniapp/merchant/profile/MchShopInfo.vue new file mode 100644 index 0000000..8985d9d --- /dev/null +++ b/src/views/daxpay/miniapp/merchant/profile/MchShopInfo.vue @@ -0,0 +1,273 @@ + + + + + diff --git a/src/views/daxpay/miniapp/merchant/profile/MerchantProfile.api.ts b/src/views/daxpay/miniapp/merchant/profile/MerchantProfile.api.ts new file mode 100644 index 0000000..71abee2 --- /dev/null +++ b/src/views/daxpay/miniapp/merchant/profile/MerchantProfile.api.ts @@ -0,0 +1,283 @@ +import { http } from '@/utils/http/axios' +import type { MchEntity, Result } from '#/axios' + +/** + * 查询主体信息 + */ +export function getMainBody() { + return http.request>({ + method: 'get', + url: '/mini/mch/profile/getMainBody', + }) +} + +/** + * 更新主体信息 + */ +export function updateMainBody(params: MchMainBodyParam) { + return http.request>({ + method: 'post', + url: '/mini/mch/profile/updateMainBody', + data: params, + }) +} + +/** + * 查询经营场所信息 + */ +export function getShopInfo() { + return http.request>({ + method: 'get', + url: '/mini/mch/profile/shop/getShopProfile', + }) +} + +/** + * 更新经营场所信息 + */ +export function updateShopInfo(params: MchShopProfileParam) { + return http.request>({ + method: 'post', + url: '/mini/mch/profile/shop/update', + data: params, + }) +} + +/** + * 查询结算信息 + */ +export function getSettleInfo() { + return http.request>({ + method: 'get', + url: '/mini/mch/profile/getSettleInfo', + }) +} + +/** + * 更新结算信息 + */ +export function updateSettleInfo(params: MchSettleParam) { + return http.request>({ + method: 'post', + url: '/mini/mch/profile/updateSettleInfo', + data: params, + }) +} + +/** + * 提交主体认证 + */ +export function applyProfileAuth() { + return http.request>({ + method: 'post', + url: '/mini/mch/profile/applyProfileAuth', + }) +} + +/** + * 根据商户号查询商户状态信息 + */ +export function getMerchantStatus() { + return http.request>({ + method: 'get', + url: '/mini/mch/findMchStatus', + }) +} + +/** + * 商户主体信息参数 + */ +export interface MchMainBodyParam extends MchEntity { + // 基础信息 + base: MchBaseProfile + // 法人信息 + legal: MchLegalProfile + // 营业执照信息 + license: MchLicenseProfile +} + +/** + * 商户主体信息结果 + */ +export interface MchMainBodyResult extends MchEntity { + // 基础信息 + base: MchBaseProfile + // 法人信息 + legal: MchLegalProfile + // 营业执照信息 + license: MchLicenseProfile +} + +/** + * 商户经营场所信息参数 + */ +export interface MchShopProfileParam extends MchEntity { + // 经营场所名称 + name?: string + // 省市区编码 + regionCode?: string[] + // 经营场所详细地址 + address?: string + // 门头照 + doorPic?: string + // 室内照 + insidePic?: string + // 收银台照片 + cashierPic?: string +} + +/** + * 商户经营场所信息结果 + */ +export interface MchShopProfileResult extends MchEntity { + // 经营场所名称 + name?: string + // 省市区编码 + regionCode?: string[] + // 经营场所详细地址 + address?: string + // 门头照 + doorPic?: string + // 室内照 + insidePic?: string + // 收银台照片 + cashierPic?: string +} + +/** + * 商户结算信息参数 + */ +export interface MchSettleParam extends MchEntity { + // 银行卡信息 + bankCard: MchBankCardProfile + // 持卡人信息 + cardHolder: MchCardHolderProfile +} + +/** + * 商户结算信息结果 + */ +export interface MchSettleResult extends MchEntity { + // 银行卡信息 + bankCard: MchBankCardProfile + // 持卡人信息 + cardHolder: MchCardHolderProfile +} + +/** + * 商户基础信息 + */ +export interface MchBaseProfile extends MchEntity { + // 商户类型 + merchantType?: string + // 商户名称 + merchantName?: string + // 商户简称 + merchantShortName?: string + // 认证状态 + profileAuth?: string + // 认证失败原因 + profileAuthErrorMsg?: string +} + +/** + * 商户法人信息 + */ +export interface MchLegalProfile extends MchEntity { + // 法人姓名 + legalName?: string + // 法人证件号 + certNo?: string + // 联系手机号 + contactPhone?: string + // 长期有效 + periodLong?: boolean + // 法人证件开始日期 + startDate?: string + // 法人证件结束日期 + endDate?: string + // 身份证地址 + address?: string + // 法人身份证正面照片 + frontPic?: string + // 法人身份证反面照片 + backPic?: string +} + +/** + * 商户授权函照片 + */ +export interface MchLicenseProfile extends MchEntity { + // 营业执照号 + licenseNo?: string + // 营业执照名称 + licenseName?: string + // 省市区编码 + regionCode?: string[] + // 营业执照详细地址 + address?: string + // 营业执照长期有效 + periodLong?: boolean + // 营业执照开始日期 + startDate?: string + // 营业执照结束日期 + endDate?: string + // 营业执照照片 + licensePic?: string +} + +/** + * 商户状态信息 + */ +export interface MerchantStatus extends MchEntity { + /** 商户号 */ + mchNo?: string + /** 主体认证状态 */ + profileAuth?: string + /** 认证错误信息 */ + profileAuthErrorMsg?: string +} + +/** + * 商户银行卡信息 + */ +export interface MchBankCardProfile extends MchEntity { + // 账户类型 + accountType?: string + // 银行卡账户名 + accountName?: string + // 银行卡号 + cardNo?: string + // 银行卡开户行名称 + bankName?: string + // 银行卡开户行联行号 + branchNo?: string + // 银行预留手机号 + bankPhone?: string + // 银行卡正面照片 + cardFrontPic?: string + // 银行卡反面照片 + cardBackPic?: string +} + +/** + * 商户持卡人信息 + */ +export interface MchCardHolderProfile extends MchEntity { + // 持卡人姓名 + holderName?: string + // 持卡人证件号 + certNo?: string + // 身份证长期有效 + periodLong?: boolean + // 身份证开始时间 + startDate?: string + // 身份证结束时间 + endDate?: string + // 持卡人身份证正面照片 + frontPic?: string + // 持卡人身份证反面照片 + backPic?: string + // 非法人结算授权函图片 + letterOfAuthPic?: string +}