From aea858a6fcaa41843bc042c81996857a4c8bf20c Mon Sep 17 00:00:00 2001 From: bootx Date: Wed, 4 Dec 2024 22:42:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(daxpay):=20=E6=96=B0=E5=A2=9E=E6=94=B6?= =?UTF-8?q?=E9=93=B6=E5=8F=B0=E6=94=AF=E4=BB=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增收银台支付相关的枚举和接口定义 - 实现收银台支付页面组件和相关API- 更新路由配置,添加收银台支付页面路由 - 修改现有组件,使用新的枚举定义 --- .../daxpay/{daxpayEnum.ts => channelEnum.ts} | 46 ++++- src/router/routes/project.ts | 12 +- .../common/develop/auth/ChannelAuth.vue | 2 +- .../common/develop/trade/DevelopTrade.vue | 2 +- .../merchant/channel/ChannelConfigEdit.vue | 8 +- .../merchant/channel/ChannelConfigList.vue | 8 +- .../common/notice/notify/NotifyTaskList.vue | 2 +- .../discrepancy/ReconcileDiscrepancyList.vue | 2 +- .../callback/TradeCallbackRecordList.vue | 2 +- .../record/flow/TradeFlowRecordList.vue | 2 +- .../record/sync/TradeSyncRecordList.vue | 2 +- .../outside/checkout/CheckoutPay.api.ts | 146 +++++++++++++++ .../daxpay/outside/checkout/CheckoutPay.vue | 177 ++++++++++++++++++ src/views/daxpay/outside/checkout/style.less | 79 ++++++++ 14 files changed, 465 insertions(+), 25 deletions(-) rename src/enums/daxpay/{daxpayEnum.ts => channelEnum.ts} (53%) create mode 100644 src/views/daxpay/outside/checkout/CheckoutPay.api.ts create mode 100644 src/views/daxpay/outside/checkout/CheckoutPay.vue create mode 100644 src/views/daxpay/outside/checkout/style.less diff --git a/src/enums/daxpay/daxpayEnum.ts b/src/enums/daxpay/channelEnum.ts similarity index 53% rename from src/enums/daxpay/daxpayEnum.ts rename to src/enums/daxpay/channelEnum.ts index 5f71adb4e..945c4e5ab 100644 --- a/src/enums/daxpay/daxpayEnum.ts +++ b/src/enums/daxpay/channelEnum.ts @@ -1,12 +1,24 @@ /** * 支付通道 */ -export enum DaxpayEnum { +export enum ChannelEnum { ALI = 'ali_pay', WECHAT = 'wechat_pay', UNION_PAY = 'union_pay', } +/** + * 支付方式 + */ +export enum PayMethodEnum { + WAP = 'wap', + APP = 'app', + WEB = 'web', + QRCODE = 'qrcode', + BARCODE = 'barcode', + JSAPI = 'jsapi', +} + /** * 交易类型 */ @@ -51,10 +63,36 @@ export enum ChannelAuthStatusEnum { NOT_EXIST = 'not_exist', } + /** * 收银台类型 */ -export enum CashierTypeEnum { - WECHAT_PAY = 'wechat_pay', - ALIPAY = 'alipay', +export enum CheckoutTypeEnum { + H5 = 'h5', + PC = 'pc', + MINI_APP = 'mini_app', + AGGREGATE = 'aggregate', } + +/** + * 支付调起类型 + */ +export enum CheckoutCallTypeEnum { + + /** 扫码支付 */ + QR_CODE = 'qr_code', + /** 条码支付 */ + BAR_CODE = 'bar_code', + /** 跳转链接 */ + LINK = 'link', + /** 小程序 */ + MINI_APP = 'mini_app', + /** APP支付 */ + APP = 'app', + /** JSAPI */ + JSAPI = 'jsapi', + /** 表单方式 */ + FROM = 'from', + +} + diff --git a/src/router/routes/project.ts b/src/router/routes/project.ts index bbf9fb051..fec720d36 100644 --- a/src/router/routes/project.ts +++ b/src/router/routes/project.ts @@ -36,12 +36,12 @@ export const OUTSIDE: AppRouteModule = { name: 'PROJECT_OUTSIDE', meta: { title: '' }, children: [ - // { - // path: '/cashier', - // name: 'cashier', - // component: () => import('@/views/demo/cashier/Cashier.vue'), - // meta: { title: '收银台演示', ignoreAuth: true }, - // }, + { + path: '/checkout/:orderNo', + name: 'CheckoutPay', + component: () => import('@/views/daxpay/outside/checkout/CheckoutPay.vue'), + meta: { title: '收银台', ignoreAuth: true }, + }, ], } diff --git a/src/views/daxpay/common/develop/auth/ChannelAuth.vue b/src/views/daxpay/common/develop/auth/ChannelAuth.vue index 9c929a4c4..108044f07 100644 --- a/src/views/daxpay/common/develop/auth/ChannelAuth.vue +++ b/src/views/daxpay/common/develop/auth/ChannelAuth.vue @@ -83,7 +83,7 @@ import useFormEdit from '@/hooks/bootx/useFormEdit' import { mchAppDropdown } from '@/views/daxpay/common/merchant/app/MchApp.api' import { useDict } from '@/hooks/bootx/useDict' - import { ChannelAuthStatusEnum } from '@/enums/daxpay/daxpayEnum' + import { ChannelAuthStatusEnum } from '@/enums/daxpay/channelEnum' const { createMessage } = useMessage() const { dictDropDown } = useDict() diff --git a/src/views/daxpay/common/develop/trade/DevelopTrade.vue b/src/views/daxpay/common/develop/trade/DevelopTrade.vue index 01b9deff5..2cccb943d 100644 --- a/src/views/daxpay/common/develop/trade/DevelopTrade.vue +++ b/src/views/daxpay/common/develop/trade/DevelopTrade.vue @@ -19,7 +19,7 @@ + + + diff --git a/src/views/daxpay/outside/checkout/style.less b/src/views/daxpay/outside/checkout/style.less new file mode 100644 index 000000000..2f514e2da --- /dev/null +++ b/src/views/daxpay/outside/checkout/style.less @@ -0,0 +1,79 @@ +.page { + box-sizing: border-box; + min-height: 100%; + //padding-bottom: 80px; + //margin-top: 81px; +} +.paydemo { + .content { + max-width: 1120px; + margin: 0 auto; + } + .paydemo-type-content { + padding: 20px; + margin-bottom: 10px; + background-color: #FFFFFF; + border-radius: 6px; + p { + margin-bottom: 10px; + text-align: left; + } + } + .colorChange { + color: #1953ff; + border: solid 2px #1953ff; + padding: 12px; + margin-right: 10px; + cursor: pointer; + } + .paydemoType { + padding: 12px; + border: solid 2px #e2e2e2; + margin-right: 10px; + cursor: pointer; + } + .paydemo-type-img { + width: 40px; + height: 40px; + vertical-align: center; + } + .paydemo-type-name { + font-size: 16px; + margin-bottom: 12px; + display: flex; + align-items: center; + } + .paydemo-type-body { + display: flex; + flex-direction: row; + align-items: center; + margin-bottom: 10px; + } + .paydemo-type-h5 { + padding: 12px; + border: solid 2px #e2e2e2; + margin-right: 10px; + cursor: pointer; + font-size: 14px; + } + .codeImg_wx_h5 { + position: absolute; + z-index: 1001; + display: flex; + flex-direction: column; + align-items: center; + background-color: #ffffff; + width: 160px; + } + .paydemo-form-item { + height: 38px; + margin-bottom: 5px; + display: flex; + flex-direction: row; + align-items: center; + } +} +img { + border: 0; + vertical-align: middle; +}