mirror of
https://gitee.com/bootx/dax-pay-h5
synced 2026-08-13 07:45:42 +08:00
ref 网关支付接口对接调整
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
import { showFailToast } from 'vant'
|
||||
|
||||
export function checkStatus(status: number, msg: string): void {
|
||||
switch (status) {
|
||||
case 400:
|
||||
showFailToast(msg)
|
||||
break
|
||||
// 401: 未登录
|
||||
// 未登录则跳转登录页面,并携带当前页面的路径
|
||||
// 在登录成功后返回当前页面,这一步需要在登录页操作。
|
||||
case 401:
|
||||
showFailToast('用户没有权限(令牌、用户名、密码错误)!')
|
||||
break
|
||||
case 403:
|
||||
showFailToast('用户得到授权,但是访问是被禁止的。!')
|
||||
break
|
||||
// 404请求不存在
|
||||
case 404:
|
||||
showFailToast('网络请求错误,未找到该资源!')
|
||||
break
|
||||
case 405:
|
||||
showFailToast('网络请求错误,请求方法未允许!')
|
||||
break
|
||||
case 408:
|
||||
showFailToast('网络请求超时')
|
||||
break
|
||||
case 500:
|
||||
showFailToast('服务器错误,请联系管理员!')
|
||||
break
|
||||
case 501:
|
||||
showFailToast('网络未实现')
|
||||
break
|
||||
case 502:
|
||||
showFailToast('网络错误')
|
||||
break
|
||||
case 503:
|
||||
showFailToast('服务不可用,服务器暂时过载或维护!')
|
||||
break
|
||||
case 504:
|
||||
showFailToast('网络超时')
|
||||
break
|
||||
case 505:
|
||||
showFailToast('http版本不支持该请求!')
|
||||
break
|
||||
default:
|
||||
showFailToast(msg)
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import axios from 'axios'
|
||||
import { showDialog, showFailToast } from 'vant'
|
||||
import { VAxios } from './Axios'
|
||||
import type { AxiosTransform } from './axiosTransform'
|
||||
import { checkStatus } from './checkStatus'
|
||||
import { formatRequestDate, joinTimestamp } from './helper'
|
||||
import type { CreateAxiosOptions, RequestOptions } from './types'
|
||||
import { ContentTypeEnum, RequestEnum, ResultEnum } from '@/enums/httpEnum'
|
||||
@@ -178,7 +177,7 @@ const transform: AxiosTransform = {
|
||||
// 请求是否被取消
|
||||
const isCancel = axios.isCancel(error)
|
||||
if (!isCancel) {
|
||||
checkStatus(error.response && error.response.status, msg)
|
||||
showFailToast(msg)
|
||||
}
|
||||
else {
|
||||
console.warn(error, '请求被取消!')
|
||||
|
||||
@@ -6,22 +6,22 @@ import type { GatewayOrder, GatewayPayConfig } from '@/views/daxpay/h5/cashier/C
|
||||
/**
|
||||
* 获取聚合支付相关订单和配置信息
|
||||
*/
|
||||
export function getAggregateConfig(orderNo, aggregateType) {
|
||||
export function getQrPayConfig(orderNo, scene) {
|
||||
return http.request<Result<AggregateOrderAndConfig>>({
|
||||
url: '/unipay/gateway/getAggregateConfig',
|
||||
url: '/unipay/gateway/getQrPayConfig',
|
||||
method: 'GET',
|
||||
params: { orderNo, aggregateType },
|
||||
params: { orderNo, scene },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收银台所需授权链接, 用于获取OpenId一类的信息
|
||||
*/
|
||||
export function generateAuthUrl(param: GatewayAuthUrlParam) {
|
||||
export function generateAuthUrl(orderNo, scene) {
|
||||
return http.request<Result<string>>({
|
||||
url: '/unipay/gateway/generateAuthUrl',
|
||||
method: 'POST',
|
||||
data: param,
|
||||
data: { orderNo, scene },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -36,17 +36,6 @@ export function auth(param: GatewayAuthCodeParam) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付成功获取状态
|
||||
*/
|
||||
export function getSuccessOrderStatus(orderNo) {
|
||||
return http.request<Result<paySuccess>>({
|
||||
url: '/unipay/gateway/findStatusByOrderNo',
|
||||
method: 'POST',
|
||||
params: { orderNo },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付成功获取信息
|
||||
*/
|
||||
@@ -63,7 +52,7 @@ export function getSuccessOrderMessage(orderNo) {
|
||||
*/
|
||||
export function aggregatePay(param: AggregatePayParam) {
|
||||
return http.request<Result<PayResult>>({
|
||||
url: '/unipay/gateway/aggregatePay',
|
||||
url: '/unipay/gateway/qrPay',
|
||||
method: 'POST',
|
||||
data: param,
|
||||
})
|
||||
@@ -86,7 +75,7 @@ export interface AggregateOrderAndConfig {
|
||||
*/
|
||||
export interface AggregateConfig {
|
||||
/** 支付类型 */
|
||||
aggregateType?: string
|
||||
scene?: string
|
||||
/** 通道 */
|
||||
channel?: string
|
||||
/** 支付方式 */
|
||||
@@ -108,7 +97,7 @@ export interface GatewayAuthUrlParam {
|
||||
// 订单号
|
||||
orderNo?: string
|
||||
// 聚合支付类型
|
||||
aggregateType?: string
|
||||
scene?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,7 +107,7 @@ export interface GatewayAuthCodeParam {
|
||||
// 订单号
|
||||
orderNo?: string
|
||||
// 聚合支付类型
|
||||
aggregateType?: string
|
||||
scene?: string
|
||||
// 授权码
|
||||
authCode?: string
|
||||
}
|
||||
@@ -130,7 +119,7 @@ export interface AggregatePayParam {
|
||||
// 订单
|
||||
orderNo?: string
|
||||
// 聚合支付类型
|
||||
aggregateType?: string
|
||||
scene?: string
|
||||
// 唯一标识
|
||||
openId?: string
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ import type {
|
||||
AggregateOrderAndConfig,
|
||||
AggregatePayParam,
|
||||
} from '@/views/daxpay/h5/aggregate/Aggregate.api'
|
||||
import { aggregatePay, getAggregateConfig } from '@/views/daxpay/h5/aggregate/Aggregate.api'
|
||||
import { aggregatePay, getQrPayConfig } from '@/views/daxpay/h5/aggregate/Aggregate.api'
|
||||
|
||||
import { AggregateEnum, GatewayCallTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
||||
|
||||
@@ -87,7 +87,7 @@ const router = useRouter()
|
||||
const { orderNo } = route.params
|
||||
const show = ref<boolean>(false)
|
||||
const isAutoLaunch = ref<boolean>(true)
|
||||
const orderAndConfig = ref<AggregateOrderAndConfig>()
|
||||
const orderAndConfig = ref<AggregateOrderAndConfig>({})
|
||||
const loading = ref<boolean>(false)
|
||||
|
||||
// 倒计时对象
|
||||
@@ -138,7 +138,7 @@ watch(
|
||||
function init() {
|
||||
loading.value = true
|
||||
// 获取订单和配置信息
|
||||
getAggregateConfig(orderNo, 'alipay').then(async ({ data, code, msg }) => {
|
||||
getQrPayConfig(orderNo, 'alipay').then(async ({ data, code, msg }) => {
|
||||
loading.value = false
|
||||
if (code) {
|
||||
router.replace({ name: 'payFail', query: { msg } })
|
||||
@@ -147,7 +147,7 @@ function init() {
|
||||
show.value = true
|
||||
orderAndConfig.value = data
|
||||
// 判断是否自动拉起支付
|
||||
if (orderAndConfig.value.aggregateConfig.autoLaunch) {
|
||||
if (orderAndConfig.value?.aggregateConfig?.autoLaunch) {
|
||||
isAutoLaunch.value = true
|
||||
pay()
|
||||
}
|
||||
@@ -166,10 +166,10 @@ function init() {
|
||||
*/
|
||||
function pay() {
|
||||
loading.value = true
|
||||
if (orderAndConfig.value?.aggregateConfig.callType === GatewayCallTypeEnum.link) {
|
||||
if (orderAndConfig.value?.aggregateConfig?.callType === GatewayCallTypeEnum.link) {
|
||||
const from = {
|
||||
orderNo: orderNo as string,
|
||||
aggregateType: AggregateEnum.ALI,
|
||||
scene: AggregateEnum.ALI,
|
||||
} as AggregatePayParam
|
||||
aggregatePay(from).then(({ data, code, msg }) => {
|
||||
loading.value = false
|
||||
|
||||
@@ -84,12 +84,12 @@ import {
|
||||
aggregatePay,
|
||||
auth,
|
||||
generateAuthUrl,
|
||||
getAggregateConfig,
|
||||
getQrPayConfig,
|
||||
} from '@/views/daxpay/h5/aggregate/Aggregate.api'
|
||||
|
||||
import { AggregateEnum, GatewayCallTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
||||
import router from '@/router'
|
||||
import {getChannelAuthResult} from "@/utils/channelAuthUtil";
|
||||
import { getChannelAuthResult } from '@/utils/channelAuthUtil'
|
||||
|
||||
const route = useRoute()
|
||||
const { channelAuth: isChannel, channel, orderNo } = route.params
|
||||
@@ -102,7 +102,7 @@ const loading = ref<boolean>(false)
|
||||
// 认证参数
|
||||
const authParam = reactive<GatewayAuthCodeParam>({
|
||||
orderNo: orderNo as string,
|
||||
aggregateType: AggregateEnum.WECHAT,
|
||||
scene: AggregateEnum.WECHAT,
|
||||
})
|
||||
|
||||
// 倒计时对象
|
||||
@@ -163,7 +163,7 @@ onUnmounted(() => {
|
||||
async function init() {
|
||||
loading.value = true
|
||||
// 获取订单和配置信息
|
||||
await getAggregateConfig(orderNo, 'wechat_pay').then(async ({ data, msg, code }) => {
|
||||
await getQrPayConfig(orderNo, 'wechat_pay').then(async ({ data, msg, code }) => {
|
||||
loading.value = false
|
||||
if (code !== 0) {
|
||||
// 如果异常,跳转异常页面
|
||||
@@ -191,10 +191,7 @@ async function init() {
|
||||
}
|
||||
}
|
||||
// 生成认证链接
|
||||
generateAuthUrl({
|
||||
orderNo: orderNo as string,
|
||||
aggregateType: AggregateEnum.WECHAT,
|
||||
})
|
||||
generateAuthUrl(orderNo as string, AggregateEnum.WECHAT)
|
||||
.then((res) => {
|
||||
if (res.code !== 0) {
|
||||
// 如果异常,跳转异常页面
|
||||
@@ -282,7 +279,7 @@ function payCallback() {
|
||||
loading.value = true
|
||||
const from = {
|
||||
orderNo: orderNo as string,
|
||||
aggregateType: AggregateEnum.WECHAT,
|
||||
scene: AggregateEnum.WECHAT,
|
||||
openId: openId.value,
|
||||
} as AggregatePayParam
|
||||
aggregatePay(from).then(({ data, code, msg }) => {
|
||||
|
||||
@@ -6,9 +6,9 @@ import type { Result } from '#/axios'
|
||||
*/
|
||||
export function getOrderAndConfig(orderNo) {
|
||||
return http.request<Result<OrderAndConfig>>({
|
||||
url: '/unipay/gateway/getOrderAndConfig',
|
||||
url: '/unipay/gateway/checkout/getOrderAndConfig',
|
||||
method: 'GET',
|
||||
params: { orderNo, cashierType: 'h5' },
|
||||
params: { orderNo, type: 'h5' },
|
||||
})
|
||||
}
|
||||
/**
|
||||
@@ -16,7 +16,7 @@ export function getOrderAndConfig(orderNo) {
|
||||
*/
|
||||
export function payOrder(data: payParam) {
|
||||
return http.request<Result<payConfig>>({
|
||||
url: '/unipay/gateway/cashier/pay',
|
||||
url: '/unipay/gateway/checkout/pay',
|
||||
method: 'POST',
|
||||
data,
|
||||
})
|
||||
|
||||
@@ -168,7 +168,7 @@ function payClick() {
|
||||
loading.value = true
|
||||
const form = {
|
||||
orderNo,
|
||||
itemId: selectId.value,
|
||||
configId: selectId.value,
|
||||
}
|
||||
payOrder(form as any)
|
||||
.then(({ data, code, msg }) => {
|
||||
|
||||
@@ -5,22 +5,22 @@ import type { AuthResult } from '@/views/daxpay/h5/auth/ChannelAuth.api'
|
||||
/**
|
||||
* 获取码牌配置
|
||||
*/
|
||||
export function getCashierCodeConfig(cashierCode, cashierScene) {
|
||||
export function getCashierCodeConfig(code, scene) {
|
||||
return http.request<Result<GatewayCashierCodeConfig>>({
|
||||
url: '/unipay/gateway/cashier/getCodeConfig',
|
||||
url: '/unipay/gateway/cashier/code/getCodeConfig',
|
||||
method: 'GET',
|
||||
params: { cashierCode, cashierScene },
|
||||
params: { code, scene },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取码牌收银台所需授权链接, 用于获取OpenId一类的信息
|
||||
*/
|
||||
export function generateAuthUrl(cashierCode, cashierScene) {
|
||||
export function generateAuthUrl(code, scene) {
|
||||
return http.request<Result<string>>({
|
||||
url: '/unipay/gateway/cashier/code/generateAuthUrl',
|
||||
method: 'POST',
|
||||
data: { cashierCode, cashierScene },
|
||||
data: { code, scene },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -51,9 +51,9 @@ export function cashierPay(param: GatewayCashierCodePayParam) {
|
||||
*/
|
||||
export interface GatewayCashierCodePayParam {
|
||||
// 收银码牌编码
|
||||
cashierCode?: string
|
||||
code?: string
|
||||
// 收银台类型
|
||||
cashierScene?: string
|
||||
scene?: string
|
||||
// 支付金额
|
||||
amount?: number
|
||||
// 唯一标识
|
||||
@@ -121,9 +121,9 @@ export interface GatewayCashierCodeConfig {
|
||||
*/
|
||||
export interface CashierCodeAuthParam {
|
||||
// 收银码牌编码
|
||||
cashierCode?: string
|
||||
code?: string
|
||||
// 支付场景
|
||||
cashierScene?: string
|
||||
scene?: string
|
||||
// 授权码
|
||||
authCode?: string
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ import {
|
||||
import { AggregateEnum, CashierSceneEnum, GatewayCallTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
||||
import router from '@/router'
|
||||
import { useKeyboard } from '@/hooks/daxpay/useKeyboard'
|
||||
import {getChannelAuthResult} from "@/utils/channelAuthUtil";
|
||||
import { getChannelAuthResult } from '@/utils/channelAuthUtil'
|
||||
|
||||
const route = useRoute()
|
||||
const { channelAuth: isChannel, channel, code: cashierCode } = route.params
|
||||
|
||||
75
src/views/daxpay/h5/onboarded/common/Base.d.ts
vendored
75
src/views/daxpay/h5/onboarded/common/Base.d.ts
vendored
@@ -1,4 +1,3 @@
|
||||
|
||||
/**
|
||||
* 商户进件申请单
|
||||
*/
|
||||
@@ -49,19 +48,23 @@ export interface OnbLegalApply {
|
||||
/** 身份证号 */
|
||||
certNo?: string
|
||||
/** 身份证有效期类型 */
|
||||
certPeriodLong?: boolean
|
||||
periodLong?: boolean
|
||||
/** 身份证开始时间 */
|
||||
certStartDate?: string
|
||||
startDate?: string
|
||||
/** 身份证结束时间 */
|
||||
certEndDate?: string
|
||||
endDate?: string
|
||||
/** 身份证正面照片 */
|
||||
certFrontPic?: string
|
||||
frontPic?: string
|
||||
/** 身份证正面照片路径 */
|
||||
certFrontPicUrl?: string
|
||||
frontPicUrl?: string
|
||||
/** 身份证反面照片 */
|
||||
certBackPic?: string
|
||||
backPic?: string
|
||||
/** 身份证反面照片路径 */
|
||||
certBackPicUrl?: string
|
||||
backPicUrl?: string
|
||||
/** 联系人手机号 */
|
||||
contactPhone?: string
|
||||
/** 证件居住地址 */
|
||||
address?: string
|
||||
}
|
||||
/**
|
||||
* 进件营业执照信息
|
||||
@@ -74,15 +77,15 @@ export interface OnbLicenseApply {
|
||||
/** 营业执照名称 */
|
||||
licenseName?: string
|
||||
/** 执照地址-省市区编码 */
|
||||
licenseRegionCode?: string[]
|
||||
regionCode?: string[]
|
||||
/** 营业执照详细地址 */
|
||||
licenseAddress?: string
|
||||
address?: string
|
||||
/** 营业执照有效期类型 */
|
||||
licensePeriodLong?: boolean
|
||||
periodLong?: boolean
|
||||
/** 营业执照开始日期 */
|
||||
licenseStartDate?: string
|
||||
startDate?: string
|
||||
/** 营业执照结束日期 */
|
||||
licenseEndDate?: string
|
||||
endDate?: string
|
||||
/** 营业执照照片 */
|
||||
licensePic?: string
|
||||
/** 营业执照照片路径 */
|
||||
@@ -95,23 +98,23 @@ export interface OnbLicenseApply {
|
||||
*/
|
||||
export interface OnbShopApply {
|
||||
/** 经营场所名称 */
|
||||
shopName?: string
|
||||
name?: string
|
||||
/** 省市区编码 */
|
||||
shopRegionCode?: string[]
|
||||
regionCode?: string[]
|
||||
/** 经营场所详细地址 */
|
||||
shopAddress?: string
|
||||
address?: string
|
||||
/** 门头照 */
|
||||
shopDoorPic?: string
|
||||
doorPic?: string
|
||||
/** 门头照路径 */
|
||||
shopDoorPicUrl?: string
|
||||
doorPicUrl?: string
|
||||
/** 室内照 */
|
||||
shopInsidePic?: string
|
||||
insidePic?: string
|
||||
/** 室内照路径 */
|
||||
shopInsidePicUrl?: string
|
||||
insidePicUrl?: string
|
||||
/** 收银台照片 */
|
||||
shopCashierPic?: string
|
||||
cashierPic?: string
|
||||
/** 收银台照片路径 */
|
||||
shopCashierPicUrl?: string
|
||||
cashierPicUrl?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,19 +124,19 @@ export interface OnbShopApply {
|
||||
*/
|
||||
export interface OnbBankAccountApply {
|
||||
/** 账户类型 */
|
||||
bankAccountType?: string
|
||||
accountType?: string
|
||||
/** 银行卡账户名 */
|
||||
bankAccountName?: string
|
||||
accountName?: string
|
||||
/** 银行卡号 */
|
||||
bankCardNo?: string
|
||||
cardNo?: string
|
||||
/** 银行卡开户行联行号 */
|
||||
bankBranchNo?: string
|
||||
branchNo?: string
|
||||
/** 银行预留手机号 */
|
||||
bankPhone?: string
|
||||
phone?: string
|
||||
/** 银行卡正面照片 */
|
||||
bankCardPic?: string
|
||||
cardFrontPic?: string
|
||||
/** 银行卡正面照片路径 */
|
||||
bankCardPicUrl?: string
|
||||
cardFrontPicUrl?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,19 +150,19 @@ export interface OnbCardHolderApply {
|
||||
/** 身份证号 */
|
||||
certNo?: string
|
||||
/** 身份证有效期类型 */
|
||||
certPeriodLong?: boolean
|
||||
periodLong?: boolean
|
||||
/** 身份证开始时间 */
|
||||
certStartDate?: string
|
||||
startDate?: string
|
||||
/** 身份证结束时间 */
|
||||
certEndDate?: string
|
||||
endDate?: string
|
||||
/** 身份证正面照片 */
|
||||
certFrontPic?: string
|
||||
frontPic?: string
|
||||
/** 身份证正面照片路径 */
|
||||
certFrontPicUrl?: string
|
||||
frontPicUrl?: string
|
||||
/** 身份证反面照片 */
|
||||
certBackPic?: string
|
||||
backPic?: string
|
||||
/** 身份证反面照片路径 */
|
||||
certBackPicUrl?: string
|
||||
backPicUrl?: string
|
||||
/** 非法人结算授权函图片 */
|
||||
letterOfAuthPic?: string
|
||||
/** 非法人结算授权函图片路径 */
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<van-cell-group inset>
|
||||
<!-- 身份证正面 -->
|
||||
<van-field
|
||||
name="certFrontPicUrl"
|
||||
name="frontPicUrl"
|
||||
label="身份证正面"
|
||||
label-align="top"
|
||||
:rules="[{ required: true, message: '请上传身份证正面图片' }]"
|
||||
@@ -64,12 +64,12 @@
|
||||
<template #input>
|
||||
<div class="readOcr">
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.legal.certFrontPicUrl"
|
||||
v-model:pic-id="form.mchApply.legal.certFrontPic"
|
||||
v-model:pic-url="form.mchApply.legal.frontPicUrl"
|
||||
v-model:pic-id="form.mchApply.legal.frontPic"
|
||||
:web-header="headers"
|
||||
/>
|
||||
<van-button
|
||||
v-if="form.mchApply.legal.certFrontPicUrl"
|
||||
v-if="form.mchApply.legal.frontPicUrl"
|
||||
class="readOcrBtn"
|
||||
hairline
|
||||
plain
|
||||
@@ -83,7 +83,7 @@
|
||||
</van-field>
|
||||
<!-- 身份证反面 -->
|
||||
<van-field
|
||||
name="certBackPic"
|
||||
name="backPic"
|
||||
label="身份证反面"
|
||||
label-align="top"
|
||||
:rules="[{ required: true, message: '请上传身份证反面图片' }]"
|
||||
@@ -91,11 +91,11 @@
|
||||
<template #input>
|
||||
<div class="readOcr">
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.legal.certBackPicUrl"
|
||||
v-model:pic-id="form.mchApply.legal.certBackPic"
|
||||
v-model:pic-url="form.mchApply.legal.backPicUrl"
|
||||
v-model:pic-id="form.mchApply.legal.backPic"
|
||||
:web-header="headers"
|
||||
/><van-button
|
||||
v-if="form.mchApply.legal.certBackPicUrl"
|
||||
v-if="form.mchApply.legal.backPicUrl"
|
||||
class="readOcrBtn"
|
||||
hairline
|
||||
plain
|
||||
@@ -130,38 +130,38 @@
|
||||
<!-- 身份证有效期 -->
|
||||
<van-field label="长期有效" label-align="top">
|
||||
<template #input>
|
||||
<van-switch v-model="form.mchApply.legal.certPeriodLong" />
|
||||
<van-switch v-model="form.mchApply.legal.periodLong" />
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 证件有效期开始日期 -->
|
||||
<BDatePicker
|
||||
v-model="form.mchApply.legal.certStartDate"
|
||||
name="certStartDate"
|
||||
v-model="form.mchApply.legal.startDate"
|
||||
name="startDate"
|
||||
label="证件开始日期"
|
||||
placeholder="请选择证件有效期开始日期"
|
||||
:rules="[{ required: true, message: '请选择证件开始时间' }]"
|
||||
/>
|
||||
<!-- 证件有效期结束日期 -->
|
||||
<BDatePicker
|
||||
v-if="!form.mchApply.legal.certPeriodLong"
|
||||
v-model="form.mchApply.legal.certEndDate"
|
||||
name="certEndDate"
|
||||
v-if="!form.mchApply.legal.periodLong"
|
||||
v-model="form.mchApply.legal.endDate"
|
||||
name="endDate"
|
||||
label="证件有效期结束日期"
|
||||
placeholder="请选择证件结束时间"
|
||||
:rules="[{ required: true, message: '请选择证件结束时间' }]"
|
||||
/>
|
||||
<van-field
|
||||
v-model="form.mchApply.other.legalIdAddress"
|
||||
v-model="form.mchApply.legal.address"
|
||||
autosize
|
||||
label-align="top"
|
||||
name="legalIdAddress"
|
||||
name="address"
|
||||
label="证件居住地址"
|
||||
placeholder="请输入证件居住地址"
|
||||
:rules="[{ required: true, message: '请输入证件居住地址' }]"
|
||||
/>
|
||||
<!-- 联系人手机号 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.other.contactPhone"
|
||||
v-model="form.mchApply.legal.contactPhone"
|
||||
label-align="top"
|
||||
name="contactPhone"
|
||||
placeholder="请输入联系人手机号"
|
||||
@@ -228,39 +228,38 @@
|
||||
:rules="[{ required: true, message: '请选择营业执照所在区县' }]"
|
||||
:options="pca"
|
||||
/>
|
||||
<!-- 营业执照详细地址 -->
|
||||
<!-- 营业执照注册地址 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.license.licenseAddress"
|
||||
v-model="form.mchApply.license.address"
|
||||
autosize
|
||||
label-align="top"
|
||||
name="licenseAddress"
|
||||
placeholder="请输入营业执照详细地址"
|
||||
label="营业执照详细地址"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入营业执照详细地址' }]"
|
||||
name="address"
|
||||
label="营业执照注册地址"
|
||||
placeholder="请输入营业执照注册地址"
|
||||
:rules="[{ required: true, message: '请输入营业执照注册地址' }]"
|
||||
/>
|
||||
<!-- 注册有效期 -->
|
||||
<!-- 营业执照有效期 -->
|
||||
<van-field label="长期有效" label-align="top">
|
||||
<template #input>
|
||||
<van-switch v-model="form.mchApply.license.licensePeriodLong" />
|
||||
<van-switch v-model="form.mchApply.license.periodLong" />
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 开始日期 -->
|
||||
<!-- 营业执照有效期开始日期 -->
|
||||
<BDatePicker
|
||||
v-model="form.mchApply.license.licenseStartDate"
|
||||
name="licenseStartDate"
|
||||
label="开始日期"
|
||||
placeholder="请选择注册开始日期"
|
||||
:rules="[{ required: true, message: '请选择注册开始日期' }]"
|
||||
v-model="form.mchApply.license.startDate"
|
||||
name="startDate"
|
||||
label="营业执照开始日期"
|
||||
placeholder="请选择营业执照有效期开始日期"
|
||||
:rules="[{ required: true, message: '请选择营业执照开始时间' }]"
|
||||
/>
|
||||
<!-- 结束日期 -->
|
||||
<!-- 营业执照有效期结束日期 -->
|
||||
<BDatePicker
|
||||
v-if="!form.mchApply.license.licensePeriodLong"
|
||||
v-model="form.mchApply.license.licenseEndDate"
|
||||
name="licenseEndDate"
|
||||
label="结束日期"
|
||||
placeholder="请选择注册结束日期"
|
||||
:rules="[{ required: true, message: '请选择注册结束日期' }]"
|
||||
v-if="!form.mchApply.license.periodLong"
|
||||
v-model="form.mchApply.license.endDate"
|
||||
name="endDate"
|
||||
label="营业执照有效期结束日期"
|
||||
placeholder="请选择营业执照结束时间"
|
||||
:rules="[{ required: true, message: '请选择营业执照结束时间' }]"
|
||||
/>
|
||||
</van-cell-group>
|
||||
</template>
|
||||
@@ -273,13 +272,13 @@
|
||||
<van-cell-group inset>
|
||||
<!-- 门店名称 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.shop.shopName"
|
||||
v-model="form.mchApply.shop.name"
|
||||
label-align="top"
|
||||
name="shopName"
|
||||
name="name"
|
||||
placeholder="请输入门店名称"
|
||||
label="门店名称"
|
||||
:rules="[{ required: true, message: '请输入门店名称' }]"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入门店名称' }]"
|
||||
/>
|
||||
<!-- 经营类目 -->
|
||||
<b-cascader
|
||||
@@ -301,53 +300,56 @@
|
||||
/>
|
||||
<!-- 经营场所详细地址 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.shop.shopAddress"
|
||||
v-model="form.mchApply.shop.address"
|
||||
autosize
|
||||
label-align="top"
|
||||
name="shopAddress"
|
||||
name="address"
|
||||
placeholder="请输入经营场所详细地址"
|
||||
label="经营场所详细地址"
|
||||
:rules="[{ required: true, message: '请输入经营场所详细地址' }]"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入经营场所详细地址' }]"
|
||||
/>
|
||||
<!-- 门头照 -->
|
||||
<van-field
|
||||
name="shopDoorPicUrl"
|
||||
label="商户门头图片"
|
||||
name="doorPic"
|
||||
label="门头照"
|
||||
label-align="top"
|
||||
:rules="[{ required: true, message: '请选择商户门头图片' }]"
|
||||
:rules="[{ required: true, message: '请上传门头照' }]"
|
||||
>
|
||||
<template #input>
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.shop.shopDoorPicUrl"
|
||||
v-model:pic-id="form.mchApply.shop.shopDoorPic"
|
||||
v-model:pic-url="form.mchApply.shop.doorPicUrl"
|
||||
v-model:pic-id="form.mchApply.shop.doorPic"
|
||||
:web-header="headers"
|
||||
/>
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 店内照 -->
|
||||
<van-field
|
||||
name="shopInsidePicUrl"
|
||||
label="营业场所室内照片"
|
||||
name="insidePic"
|
||||
label="店内照"
|
||||
label-align="top"
|
||||
:rules="[{ required: true, message: '请选择营业场所室内照片' }]"
|
||||
:rules="[{ required: true, message: '请上传店内照' }]"
|
||||
>
|
||||
<template #input>
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.shop.shopInsidePicUrl"
|
||||
v-model:pic-id="form.mchApply.shop.shopInsidePic"
|
||||
v-model:pic-url="form.mchApply.shop.insidePicUrl"
|
||||
v-model:pic-id="form.mchApply.shop.insidePic"
|
||||
:web-header="headers"
|
||||
/>
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 收银台照 -->
|
||||
<van-field
|
||||
name="shopCashierPicUrl"
|
||||
label="营业场所收银台照片"
|
||||
name="cashierPic"
|
||||
label="收银台照"
|
||||
label-align="top"
|
||||
:rules="[{ required: true, message: '请选择营业场所收银台照片' }]"
|
||||
:rules="[{ required: true, message: '请上传收银台照' }]"
|
||||
>
|
||||
<template #input>
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.shop.shopCashierPicUrl"
|
||||
v-model:pic-id="form.mchApply.shop.shopCashierPic"
|
||||
v-model:pic-url="form.mchApply.shop.cashierPicUrl"
|
||||
v-model:pic-id="form.mchApply.shop.cashierPic"
|
||||
:web-header="headers"
|
||||
/>
|
||||
</template>
|
||||
@@ -425,26 +427,78 @@
|
||||
</div>
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 银行卡账户名 -->
|
||||
<!-- 账户类型 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.bankAccount.bankAccountName"
|
||||
v-model="form.mchApply.bankAccount.accountType"
|
||||
is-link
|
||||
readonly
|
||||
name="accountType"
|
||||
label="账户类型"
|
||||
placeholder="请选择账户类型"
|
||||
@click="showAccountTypePicker = true"
|
||||
/>
|
||||
<van-popup v-model:show="showAccountTypePicker" position="bottom">
|
||||
<van-picker
|
||||
:columns="accountTypeColumns"
|
||||
@confirm="onAccountTypeConfirm"
|
||||
@cancel="showAccountTypePicker = false"
|
||||
/>
|
||||
</van-popup>
|
||||
<!-- 开户名 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.bankAccount.accountName"
|
||||
label-align="top"
|
||||
name="bankAccountName"
|
||||
placeholder="请输入银行卡账户名"
|
||||
label="银行卡账户名"
|
||||
:rules="[{ required: true, message: '请输入银行卡账户名' }]"
|
||||
name="accountName"
|
||||
placeholder="请输入开户名"
|
||||
label="开户名"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入开户名' }]"
|
||||
/>
|
||||
<!-- 银行卡号 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.bankAccount.bankCardNo"
|
||||
v-model="form.mchApply.bankAccount.cardNo"
|
||||
label-align="top"
|
||||
name="bankCardNo"
|
||||
name="cardNo"
|
||||
placeholder="请输入银行卡号"
|
||||
label="银行卡号"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入银行卡号' }]"
|
||||
/>
|
||||
<!-- 开户支行号 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.bankAccount.branchNo"
|
||||
label-align="top"
|
||||
name="branchNo"
|
||||
placeholder="请输入开户支行号"
|
||||
label="开户支行号"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入开户支行号' }]"
|
||||
/>
|
||||
<!-- 银行预留手机号 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.bankAccount.phone"
|
||||
label-align="top"
|
||||
name="phone"
|
||||
placeholder="请输入银行预留手机号"
|
||||
label="银行预留手机号"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入银行预留手机号' }]"
|
||||
/>
|
||||
<!-- 银行卡正面照 -->
|
||||
<van-field
|
||||
name="cardFrontPic"
|
||||
label="银行卡正面照"
|
||||
label-align="top"
|
||||
:rules="[{ required: true, message: '请上传银行卡正面照' }]"
|
||||
>
|
||||
<template #input>
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.bankAccount.cardFrontPicUrl"
|
||||
v-model:pic-id="form.mchApply.bankAccount.cardFrontPic"
|
||||
:web-header="headers"
|
||||
/>
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 开户银行省市 -->
|
||||
<b-cascader
|
||||
v-model="form.mchApply.other.bankRegionCode"
|
||||
@@ -502,58 +556,89 @@
|
||||
持卡人信息
|
||||
</div>
|
||||
<van-cell-group inset>
|
||||
<!-- 持卡人身份证正面图片 -->
|
||||
<!-- 持卡人身份证正面 -->
|
||||
<van-field
|
||||
name="certFrontPicUrl" label="持卡人身份证正面图片"
|
||||
name="frontPic"
|
||||
label="持卡人身份证正面"
|
||||
label-align="top"
|
||||
:rules="[{ required: true, message: '请上传持卡人身份证正面图片' }]"
|
||||
label-align="top"
|
||||
>
|
||||
<template #input>
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.cardHolder.certFrontPicUrl"
|
||||
v-model:pic-id="form.mchApply.cardHolder.certFrontPic"
|
||||
v-model:pic-url="form.mchApply.cardHolder.frontPicUrl"
|
||||
v-model:pic-id="form.mchApply.cardHolder.frontPic"
|
||||
:web-header="headers"
|
||||
/>
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 持卡人身份证反面图片 -->
|
||||
<!-- 持卡人身份证反面 -->
|
||||
<van-field
|
||||
name="certBackPicUrl" label="持卡人身份证反面图片"
|
||||
:rules="[{ required: true, message: '请上传持卡人身份证反面图片' }]"
|
||||
name="backPic"
|
||||
label="持卡人身份证反面"
|
||||
label-align="top"
|
||||
:rules="[{ required: true, message: '请上传持卡人身份证反面图片' }]"
|
||||
>
|
||||
<template #input>
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.cardHolder.certBackPicUrl"
|
||||
v-model:pic-id="form.mchApply.cardHolder.certBackPic"
|
||||
v-model:pic-url="form.mchApply.cardHolder.backPicUrl"
|
||||
v-model:pic-id="form.mchApply.cardHolder.backPic"
|
||||
:web-header="headers"
|
||||
/>
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 持卡人身份证有效期 -->
|
||||
<van-field label="长期有效" label-align="top">
|
||||
<template #input>
|
||||
<van-switch v-model="form.mchApply.cardHolder.periodLong" />
|
||||
</template>
|
||||
</van-field>
|
||||
<!-- 持卡人证件有效期开始日期 -->
|
||||
<BDatePicker
|
||||
v-model="form.mchApply.cardHolder.startDate"
|
||||
name="startDate"
|
||||
label="持卡人证件开始日期"
|
||||
placeholder="请选择持卡人证件有效期开始日期"
|
||||
:rules="[{ required: true, message: '请选择持卡人证件开始时间' }]"
|
||||
/>
|
||||
<!-- 持卡人证件有效期结束日期 -->
|
||||
<BDatePicker
|
||||
v-if="!form.mchApply.cardHolder.periodLong"
|
||||
v-model="form.mchApply.cardHolder.endDate"
|
||||
name="endDate"
|
||||
label="持卡人证件有效期结束日期"
|
||||
placeholder="请选择持卡人证件结束时间"
|
||||
:rules="[{ required: true, message: '请选择持卡人证件结束时间' }]"
|
||||
/>
|
||||
<!-- 身份证号码 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.cardHolder.certNo"
|
||||
v-model="form.mchApply.cardHolder.idCardNo"
|
||||
label-align="top"
|
||||
name="certNo"
|
||||
name="idCardNo"
|
||||
placeholder="请输入身份证号码"
|
||||
label="身份证号码"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入身份证号码' }]"
|
||||
/>
|
||||
<!-- 非法人结算授权函图片 -->
|
||||
<!-- 持卡人姓名 -->
|
||||
<van-field
|
||||
name="certFrontPicUrl" label="非法人结算授权函图片"
|
||||
:rules="[{ required: true, message: '请上传请上传非法人结算授权函图片' }]"
|
||||
v-model="form.mchApply.cardHolder.name"
|
||||
label-align="top"
|
||||
>
|
||||
<template #input>
|
||||
<BUpload
|
||||
v-model:pic-url="form.mchApply.cardHolder.letterOfAuthPicUrl"
|
||||
v-model:pic-id="form.mchApply.cardHolder.letterOfAuthPicUrl"
|
||||
:web-header="headers"
|
||||
/>
|
||||
</template>
|
||||
</van-field>
|
||||
name="name"
|
||||
placeholder="请输入持卡人姓名"
|
||||
label="持卡人姓名"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入持卡人姓名' }]"
|
||||
/>
|
||||
<!-- 持卡人手机号 -->
|
||||
<van-field
|
||||
v-model="form.mchApply.cardHolder.phone"
|
||||
label-align="top"
|
||||
name="phone"
|
||||
placeholder="请输入持卡人手机号"
|
||||
label="持卡人手机号"
|
||||
clearable
|
||||
:rules="[{ required: true, message: '请输入持卡人手机号' }]"
|
||||
/>
|
||||
</van-cell-group>
|
||||
</template>
|
||||
</template>
|
||||
@@ -821,6 +906,17 @@ function bankOcr() {
|
||||
form.value.mchApply.bankAccount.bankCardNo = data.cardNumber
|
||||
})
|
||||
}
|
||||
|
||||
const showAccountTypePicker = ref(false)
|
||||
const accountTypeColumns = [
|
||||
{ text: '对公账户', value: '1' },
|
||||
{ text: '对私账户', value: '2' }
|
||||
]
|
||||
|
||||
function onAccountTypeConfirm({ selectedOptions }) {
|
||||
form.mchApply.bankAccount.accountType = selectedOptions[0]?.value
|
||||
showAccountTypePicker.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
@@ -6,9 +6,9 @@ import type { Result } from '#/axios'
|
||||
*/
|
||||
export function getOrderAndConfig(orderNo) {
|
||||
return http.request<Result<OrderAndConfig>>({
|
||||
url: '/unipay/gateway/getOrderAndConfig',
|
||||
url: '/unipay/gateway/checkout/getOrderAndConfig',
|
||||
method: 'GET',
|
||||
params: { orderNo, cashierType: 'pc' },
|
||||
params: { orderNo, type: 'pc' },
|
||||
})
|
||||
}
|
||||
/**
|
||||
@@ -16,7 +16,7 @@ export function getOrderAndConfig(orderNo) {
|
||||
*/
|
||||
export function payOrder(data: payParam) {
|
||||
return http.request<Result<payConfig>>({
|
||||
url: '/unipay/gateway/cashier/pay',
|
||||
url: '/unipay/gateway/checkout/pay',
|
||||
method: 'POST',
|
||||
data,
|
||||
})
|
||||
|
||||
@@ -134,6 +134,7 @@
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import vueQr from 'vue-qr/src/packages/vue-qr.vue'
|
||||
import { useIntervalFn } from '@vueuse/core'
|
||||
import { getOrderAndConfig, orderStatus, payOrder } from '@/views/daxpay/pc/cashier/Cashier.api'
|
||||
import type { CashierConfig, OrderAndConfig } from '@/views/daxpay/pc/cashier/Cashier.api'
|
||||
import { GatewayCallTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
||||
@@ -227,7 +228,7 @@ const payMethObj = reactive({
|
||||
// 点击支付
|
||||
toPayTypeClick: () => {
|
||||
loading.value = true
|
||||
payOrder({ orderNo: orderNo as string, itemId: payMethObj.itemClickObj?.id as any }).then(
|
||||
payOrder({ orderNo: orderNo as string, configId: payMethObj.itemClickObj?.id as any }).then(
|
||||
({ code, data, msg }) => {
|
||||
if (code !== 0) {
|
||||
router.replace({ path: `/pc/payFail`, query: { msg } })
|
||||
|
||||
Reference in New Issue
Block a user