Skip to content

Commit 9aa7ba3

Browse files
YunaiVgitee-org
authored andcommitted
!230 mall:优惠券发送优化
Merge pull request !230 from 疯狂的世界/mall_coupon_send
2 parents 4f7d679 + 76c4644 commit 9aa7ba3

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

src/api/mall/promotion/coupon/couponTemplate.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff 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
8577
export function exportCouponTemplateExcel(params: PageParam) {
8678
return request.get({

src/utils/constants.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*/

src/views/mall/promotion/coupon/components/CouponSendForm.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff 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
9798
defineOptions({ name: 'PromotionCouponSendForm' })
9899
@@ -105,7 +106,8 @@ const dialogVisible = ref(false) // 弹窗的是否展示
105106
const queryParams = ref({
106107
pageNo: 1,
107108
pageSize: 10,
108-
name: null
109+
name: null,
110+
canTakeTypes: [CouponTemplateTakeTypeEnum.BY_ADMIN.type]
109111
}) // 查询参数
110112
const queryFormRef = ref() // 搜索的表单
111113
// 领取人的编号列表
@@ -125,7 +127,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
125127
const 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
/** 搜索按钮操作 */
137139
const 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>

src/views/mall/promotion/coupon/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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
})
127128
const queryFormRef = ref() // 搜索的表单
128129

0 commit comments

Comments
 (0)