From 8b3033aa10cfc8c0a468fe596036eef7c9060fe0 Mon Sep 17 00:00:00 2001 From: bootx Date: Sun, 16 Jun 2024 01:28:35 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=BE=AE=E4=BF=A1=E5=88=86=E8=B4=A6?= =?UTF-8?q?=E8=80=85=E7=BB=91=E5=AE=9A=E6=94=AF=E6=8C=81=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E8=8E=B7=E5=8F=96OpenId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/payment/WechatOpenId.api.ts | 46 ++++++++++++++++ src/views/demo/cashier/CashierQrCode.vue | 1 - .../receiver/AllocationReceiver.api.ts | 1 + .../receiver/AllocationReceiverEdit.vue | 53 ++++++++++++++++--- .../allocation/receiver/OpenIdQrCode.vue | 33 ++++++++++++ 5 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 src/api/payment/WechatOpenId.api.ts create mode 100644 src/views/payment/allocation/receiver/OpenIdQrCode.vue diff --git a/src/api/payment/WechatOpenId.api.ts b/src/api/payment/WechatOpenId.api.ts new file mode 100644 index 000000000..414c190c2 --- /dev/null +++ b/src/api/payment/WechatOpenId.api.ts @@ -0,0 +1,46 @@ +import { defHttp } from '/@/utils/http/axios' +import { Result } from '/#/axios' + +/** + * 微信OpenId服务类 + */ +export function generateAuthUrl() { + return defHttp.post>({ + url: '/wechat/openId/generateAuthUrl', + }) +} + +/** + * 微信OpenId服务类 + */ +export function queryOpenId(code: string) { + return defHttp.get>({ + url: '/wechat/openId/queryOpenId', + params: { code }, + }) +} + +/** + * 微信获取OpenId授权链接和查询标识返回类 + */ +export interface WeChatAuthUrlResult { + /** 授权访问链接 */ + authUrl: string + /** 标识码, 用于查询是否获取到了OpenId */ + code: string +} + +/** + * 微信OpenId查询结果 + */ +export interface WeChatOpenIdResult { + /** OpenId */ + openId: string + /** + * 状态 + * pending:查询中 + * success:查询成功 + * fail:查询失败 + */ + status: string +} diff --git a/src/views/demo/cashier/CashierQrCode.vue b/src/views/demo/cashier/CashierQrCode.vue index 28964da2a..309f5b4f4 100644 --- a/src/views/demo/cashier/CashierQrCode.vue +++ b/src/views/demo/cashier/CashierQrCode.vue @@ -14,7 +14,6 @@ import { $ref } from 'vue/macros' let visible = $ref(false) - let icon = $ref('') let bottomTitle = $ref('') let qrUrl = $ref('') diff --git a/src/views/payment/allocation/receiver/AllocationReceiver.api.ts b/src/views/payment/allocation/receiver/AllocationReceiver.api.ts index 3cdf5fd6b..183fff13a 100644 --- a/src/views/payment/allocation/receiver/AllocationReceiver.api.ts +++ b/src/views/payment/allocation/receiver/AllocationReceiver.api.ts @@ -82,6 +82,7 @@ export function del(id) { }) } + /** * 分账接收方 */ diff --git a/src/views/payment/allocation/receiver/AllocationReceiverEdit.vue b/src/views/payment/allocation/receiver/AllocationReceiverEdit.vue index 9c199e0fa..45dcc62e1 100644 --- a/src/views/payment/allocation/receiver/AllocationReceiverEdit.vue +++ b/src/views/payment/allocation/receiver/AllocationReceiverEdit.vue @@ -45,7 +45,7 @@ - + + +