File tree Expand file tree Collapse file tree 4 files changed +25
-17
lines changed
api/mall/promotion/coupon
views/mall/promotion/coupon Expand file tree Collapse file tree 4 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,6 @@ export function getCouponTemplatePage(params: PageParam) {
7373 } )
7474}
7575
76- // 获得可用于领取的优惠劵模板分页
77- export function getCanTakeCouponTemplatePage ( params : PageParam ) {
78- return request . get ( {
79- url : '/promotion/coupon-template/can-take-page' ,
80- params : params
81- } )
82- }
83-
8476// 导出优惠劵模板 Excel
8577export function exportCouponTemplateExcel ( params : PageParam ) {
8678 return request . get ( {
Original file line number Diff line number Diff line change @@ -209,6 +209,24 @@ export const CouponTemplateValidityTypeEnum = {
209209 }
210210}
211211
212+ /**
213+ * 优惠劵模板的领取方式的枚举
214+ */
215+ export const CouponTemplateTakeTypeEnum = {
216+ BY_USER : {
217+ type : 1 ,
218+ name : '直接领取'
219+ } ,
220+ BY_ADMIN : {
221+ type : 2 ,
222+ name : '指定发放'
223+ } ,
224+ BY_REGISTER : {
225+ type : 3 ,
226+ name : '新人券'
227+ }
228+ }
229+
212230/**
213231 * 营销的商品范围枚举
214232 */
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ import {
9393 usePriceFormat ,
9494 validityTypeFormat
9595} from ' @/views/mall/promotion/coupon/formatter'
96+ import { CouponTemplateTakeTypeEnum } from ' @/utils/constants'
9697
9798defineOptions ({ name: ' PromotionCouponSendForm' })
9899
@@ -105,7 +106,8 @@ const dialogVisible = ref(false) // 弹窗的是否展示
105106const queryParams = ref ({
106107 pageNo: 1 ,
107108 pageSize: 10 ,
108- name: null
109+ name: null ,
110+ canTakeTypes: [CouponTemplateTakeTypeEnum .BY_ADMIN .type ]
109111}) // 查询参数
110112const queryFormRef = ref () // 搜索的表单
111113// 领取人的编号列表
@@ -125,7 +127,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
125127const getList = async () => {
126128 loading .value = true
127129 try {
128- const data = await CouponTemplateApi .getCanTakeCouponTemplatePage (queryParams .value )
130+ const data = await CouponTemplateApi .getCouponTemplatePage (queryParams .value )
129131 list .value = data .list
130132 total .value = data .total
131133 } finally {
@@ -135,7 +137,7 @@ const getList = async () => {
135137
136138/** 搜索按钮操作 */
137139const handleQuery = () => {
138- queryParams .pageNo = 1
140+ queryParams .value . pageNo = 1
139141 getList ()
140142}
141143
@@ -157,9 +159,4 @@ const handleSendCoupon = async (templateId: number) => {
157159 sendLoading .value = false
158160 }
159161}
160-
161- /** 初始化 **/
162- // onMounted(async () => {
163- // await getList()
164- // })
165162 </script >
Original file line number Diff line number Diff line change @@ -122,7 +122,8 @@ const queryParams = reactive({
122122 pageNo: 1 ,
123123 pageSize: 10 ,
124124 createTime: [],
125- status: undefined
125+ status: undefined ,
126+ nickname: undefined
126127})
127128const queryFormRef = ref () // 搜索的表单
128129
You can’t perform that action at this time.
0 commit comments