From 4809b7847aed180dd50175a3c4954a870058b9eb Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 7 Oct 2025 16:17:21 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd=E3=80=91=E3=80=90mem?= =?UTF-8?q?ber=20=E4=BC=9A=E5=91=98=E3=80=91=E8=BF=81=E7=A7=BB=20CouponSen?= =?UTF-8?q?dForm=20=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/mall/promotion/coupon/coupon.ts | 6 +- .../coupon/components/CouponSendForm.vue | 134 ++++++++++++++++++ apps/web-antd/src/views/member/user/index.vue | 18 ++- 3 files changed, 152 insertions(+), 6 deletions(-) create mode 100644 apps/web-antd/src/views/mall/promotion/coupon/components/CouponSendForm.vue diff --git a/apps/web-antd/src/api/mall/promotion/coupon/coupon.ts b/apps/web-antd/src/api/mall/promotion/coupon/coupon.ts index 6cba23c16..52bc96290 100644 --- a/apps/web-antd/src/api/mall/promotion/coupon/coupon.ts +++ b/apps/web-antd/src/api/mall/promotion/coupon/coupon.ts @@ -40,9 +40,9 @@ export namespace MallCouponApi { } /** 发送优惠券 */ - export interface SendCoupon { + export interface CouponSendReqVO { /** 优惠券编号 */ - couponId: number; + templateId: number; /** 用户编号数组 */ userIds: number[]; } @@ -62,6 +62,6 @@ export function getCouponPage(params: PageParam) { } /** 发送优惠券 */ -export function sendCoupon(data: MallCouponApi.SendCoupon) { +export function sendCoupon(data: MallCouponApi.CouponSendReqVO) { return requestClient.post('/promotion/coupon/send', data); } diff --git a/apps/web-antd/src/views/mall/promotion/coupon/components/CouponSendForm.vue b/apps/web-antd/src/views/mall/promotion/coupon/components/CouponSendForm.vue new file mode 100644 index 000000000..7a6247606 --- /dev/null +++ b/apps/web-antd/src/views/mall/promotion/coupon/components/CouponSendForm.vue @@ -0,0 +1,134 @@ + + + diff --git a/apps/web-antd/src/views/member/user/index.vue b/apps/web-antd/src/views/member/user/index.vue index b69faae13..23c7a97e7 100644 --- a/apps/web-antd/src/views/member/user/index.vue +++ b/apps/web-antd/src/views/member/user/index.vue @@ -6,11 +6,13 @@ import { ref } from 'vue'; import { useRouter } from 'vue-router'; import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; +import { isEmpty } from '@vben/utils'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { getUserPage } from '#/api/member/user'; import { $t } from '#/locales'; +import CouponSendForm from '../../mall/promotion/coupon/components/CouponSendForm.vue'; import { useGridColumns, useGridFormSchema } from './data'; import BalanceForm from './modules/balance-form.vue'; import Form from './modules/form.vue'; @@ -39,6 +41,11 @@ const [LevelFormModal, levelFormModalApi] = useVbenModal({ destroyOnClose: true, }); +const [CouponSendFormModal, couponSendFormModalApi] = useVbenModal({ + connectedComponent: CouponSendForm, + destroyOnClose: true, +}); + /** 刷新表格 */ function handleRefresh() { gridApi.query(); @@ -65,9 +72,12 @@ function handleUpdateBalance(row: MemberUserApi.User) { } /** 发送优惠券 */ -// TODO @xingyu:这个功能没开发对,是发送优惠劵哈; -function handleSendCoupon() { - formModalApi.setData(null).open(); +async function handleSendCoupon() { + couponSendFormModalApi + .setData({ + userIds: checkedIds.value, + }) + .open(); } const checkedIds = ref([]); @@ -137,6 +147,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ +