diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts
index e0d4ec83..b6bec97e 100644
--- a/src/api/mall/product/spu.ts
+++ b/src/api/mall/product/spu.ts
@@ -88,3 +88,8 @@ export const deleteSpu = (id: number) => {
export const exportSpu = async (params) => {
return await request.download({ url: '/product/spu/export', params })
}
+
+// 获得商品 SPU 精简列表
+export const getSpuSimpleList = async () => {
+ return request.get({ url: '/product/spu/get-simple-list' })
+}
diff --git a/src/api/mall/promotion/coupon.ts b/src/api/mall/promotion/coupon.ts
new file mode 100755
index 00000000..ab50c3cc
--- /dev/null
+++ b/src/api/mall/promotion/coupon.ts
@@ -0,0 +1,16 @@
+import request from '@/config/axios'
+
+// 删除优惠劵
+export const deleteCoupon = async (id: number) => {
+ return request.delete({
+ url: `/promotion/coupon/delete?id=${id}`
+ })
+}
+
+// 获得优惠劵分页
+export const getCouponPage = async (params: PageParam) => {
+ return request.get({
+ url: '/promotion/coupon/page',
+ params: params
+ })
+}
diff --git a/src/api/mall/promotion/couponTemplate.ts b/src/api/mall/promotion/couponTemplate.ts
new file mode 100755
index 00000000..6a58876e
--- /dev/null
+++ b/src/api/mall/promotion/couponTemplate.ts
@@ -0,0 +1,83 @@
+import request from '@/config/axios'
+
+export interface CouponTemplateVO {
+ id: number
+ name: string
+ status: number
+ totalCount: number
+ takeLimitCount: number
+ takeType: number
+ usePrice: number
+ productScope: number
+ productSpuIds: string
+ validityType: number
+ validStartTime: Date
+ validEndTime: Date
+ fixedStartTerm: number
+ fixedEndTerm: number
+ discountType: number
+ discountPercent: number
+ discountPrice: number
+ discountLimitPrice: number
+ takeCount: number
+ useCount: number
+}
+
+// 创建优惠劵模板
+export function createCouponTemplate(data: CouponTemplateVO) {
+ return request.post({
+ url: '/promotion/coupon-template/create',
+ data: data
+ })
+}
+
+// 更新优惠劵模板
+export function updateCouponTemplate(data: CouponTemplateVO) {
+ return request.put({
+ url: '/promotion/coupon-template/update',
+ data: data
+ })
+}
+
+// 更新优惠劵模板的状态
+export function updateCouponTemplateStatus(id: number, status: [0, 1]) {
+ const data = {
+ id,
+ status
+ }
+ return request.put({
+ url: '/promotion/coupon-template/update-status',
+ data: data
+ })
+}
+
+// 删除优惠劵模板
+export function deleteCouponTemplate(id: number) {
+ return request.delete({
+ url: '/promotion/coupon-template/delete?id=' + id
+ })
+}
+
+// 获得优惠劵模板
+export function getCouponTemplate(id: number) {
+ return request.get({
+ url: '/promotion/coupon-template/get?id=' + id
+ })
+}
+
+// 获得优惠劵模板分页
+export function getCouponTemplatePage(params: PageParam) {
+ return request.get({
+ url: '/promotion/coupon-template/page',
+ params: params
+ })
+}
+
+// 导出优惠劵模板 Excel
+export function exportCouponTemplateExcel(params: PageParam) {
+ return request.get({
+ url: '/promotion/coupon-template/export-excel',
+ params: params,
+ responseType: 'blob'
+ })
+}
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index e37b6abc..58b4a931 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -222,7 +222,7 @@ export const PayRefundStatusEnum = {
}
/**
- * 商品SPU枚举类
+ * 商品 SPU 状态
*/
export const ProductSpuStatusEnum = {
RECYCLE: {
@@ -238,3 +238,81 @@ export const ProductSpuStatusEnum = {
name: '上架'
}
}
+
+/**
+ * 优惠劵模板的有限期类型的枚举
+ */
+export const CouponTemplateValidityTypeEnum = {
+ DATE: {
+ type: 1,
+ name: '固定日期可用'
+ },
+ TERM: {
+ type: 2,
+ name: '领取之后可用'
+ }
+}
+
+/**
+ * 营销的商品范围枚举
+ */
+export const PromotionProductScopeEnum = {
+ ALL: {
+ scope: 1,
+ name: '全部商品参与'
+ },
+ SPU: {
+ scope: 2,
+ name: '指定商品参与'
+ }
+}
+
+/**
+ * 营销的条件类型枚举
+ */
+export const PromotionConditionTypeEnum = {
+ PRICE: {
+ type: 10,
+ name: '满 N 元'
+ },
+ COUNT: {
+ type: 20,
+ name: '满 N 件'
+ }
+}
+
+/**
+ * 促销活动的状态枚举
+ */
+export const PromotionActivityStatusEnum = {
+ WAIT: {
+ type: 10,
+ name: '未开始'
+ },
+ RUN: {
+ type: 20,
+ name: '进行中'
+ },
+ END: {
+ type: 30,
+ name: '已结束'
+ },
+ CLOSE: {
+ type: 40,
+ name: '已关闭'
+ }
+}
+
+/**
+ * 优惠类型枚举
+ */
+export const PromotionDiscountTypeEnum = {
+ PRICE: {
+ type: 1,
+ name: '满减'
+ },
+ PERCENT: {
+ type: 2,
+ name: '折扣'
+ }
+}
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index c742274f..73913b91 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -146,9 +146,12 @@ export enum DICT_TYPE {
MP_AUTO_REPLY_REQUEST_MATCH = 'mp_auto_reply_request_match', // 自动回复请求匹配类型
MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型
- // ========== MALL 模块 ==========
- PRODUCT_UNIT = 'product_unit', // 商品单位
- PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态
- // ========== MALL 交易模块 ==========
- EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode' //快递的计费方式
+ // ========== MALL - PROMOTION 模块 ==========
+ PROMOTION_DISCOUNT_TYPE = 'promotion_discount_type', // 优惠类型
+ PROMOTION_PRODUCT_SCOPE = 'promotion_product_scope', // 营销的商品范围
+ PROMOTION_COUPON_TEMPLATE_VALIDITY_TYPE = 'promotion_coupon_template_validity_type', // 优惠劵模板的有限期类型
+ PROMOTION_COUPON_STATUS = 'promotion_coupon_status', // 优惠劵的状态
+ PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式
+ PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态
+ PROMOTION_CONDITION_TYPE = 'promotion_condition_type' // 营销的条件类型枚举
}
diff --git a/src/views/mall/promotion/coupon/index.vue b/src/views/mall/promotion/coupon/index.vue
new file mode 100755
index 00000000..9fe8f0d4
--- /dev/null
+++ b/src/views/mall/promotion/coupon/index.vue
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 回收
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mall/promotion/couponTemplate/index.vue b/src/views/mall/promotion/couponTemplate/index.vue
new file mode 100755
index 00000000..b63e93e1
--- /dev/null
+++ b/src/views/mall/promotion/couponTemplate/index.vue
@@ -0,0 +1,614 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+ 重置
+
+
+
+
+
+
+
+ 新增
+
+
+ 会员优惠劵
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dict.label }}
+
+
+
+
+ 元
+
+
+
+ 折
+
+
+
+ 元
+
+
+
+ 元
+
+
+
+ 直接领取
+ 指定发放
+
+
+
+
+ 张
+
+
+
+ 张
+
+
+
+ {{ dict.label }}
+
+
+
+
+
+
+ 第
+
+ 至
+
+ 天有效
+
+
+
+ {{ dict.label }}
+
+
+
+
+
+ {{ item.name }}
+ ¥{{ (item.minPrice / 100.0).toFixed(2) }}
+
+
+
+
+
+
+
+
+
+
+