diff --git a/src/api/mall/promotion/point/index.ts b/src/api/mall/promotion/point/index.ts index f74d104e..38254c2d 100644 --- a/src/api/mall/promotion/point/index.ts +++ b/src/api/mall/promotion/point/index.ts @@ -1,11 +1,13 @@ import request from '@/config/axios' -import { Sku, Spu } from '@/api/mall/product/spu' +import { Sku, Spu } from '@/api/mall/product/spu' // 积分商城活动 VO // 积分商城活动 VO export interface PointActivityVO { id: number // 积分商城活动编号 spuId: number // 积分商城活动商品 status: number // 活动状态 + stock: number // 积分商城活动库存 + totalStock: number // 积分商城活动总库存 remark?: string // 备注 sort: number // 排序 createTime: string // 创建时间 @@ -17,7 +19,6 @@ export interface PointActivityVO { marketPrice: number // 商品市场价,单位:分 //======================= 显示所需兑换积分最少的 sku 信息 ======================= - maxCount: number // 可兑换数量 point: number // 兑换积分 price: number // 兑换金额,单位:分 } @@ -44,6 +45,13 @@ export interface SpuExtension extends Spu { skus: SkuExtension[] // 重写类型 } +export interface SpuExtension0 extends Spu { + pointStock: number // 积分商城活动库存 + pointTotalStock: number // 积分商城活动总库存 + point: number // 兑换积分 + pointPrice: number // 兑换金额,单位:分 +} + // 积分商城活动 API export const PointActivityApi = { // 查询积分商城活动分页 @@ -56,6 +64,11 @@ export const PointActivityApi = { return await request.get({ url: `/promotion/point-activity/get?id=` + id }) }, + // 查询积分商城活动列表,基于活动编号数组 + getPointActivityListByIds: async (ids: number[]) => { + return request.get({ url: `/promotion/point-activity/list-by-ids?ids=${ids}` }) + }, + // 新增积分商城活动 createPointActivity: async (data: PointActivityVO) => { return await request.post({ url: `/promotion/point-activity/create`, data }) diff --git a/src/components/AppLinkInput/data.ts b/src/components/AppLinkInput/data.ts index 1916e083..c9e3678a 100644 --- a/src/components/AppLinkInput/data.ts +++ b/src/components/AppLinkInput/data.ts @@ -5,6 +5,7 @@ export interface AppLinkGroup { // 链接列表 links: AppLink[] } + // APP 链接 export interface AppLink { // 链接名称 @@ -21,6 +22,8 @@ export const enum APP_LINK_TYPE_ENUM { ACTIVITY_COMBINATION, // 秒杀活动 ACTIVITY_SECKILL, + // 积分商城活动 + ACTIVITY_POINT, // 文章详情 ARTICLE_DETAIL, // 优惠券详情 @@ -130,6 +133,11 @@ export const APP_LINK_GROUP_LIST = [ path: '/pages/activity/seckill/list', type: APP_LINK_TYPE_ENUM.ACTIVITY_SECKILL }, + { + name: '积分商城活动', + path: '/pages/activity/point/list', + type: APP_LINK_TYPE_ENUM.ACTIVITY_POINT + }, { name: '签到中心', path: '/pages/app/sign' diff --git a/src/components/DiyEditor/components/mobile/PromotionPoint/config.ts b/src/components/DiyEditor/components/mobile/PromotionPoint/config.ts new file mode 100644 index 00000000..75aa0ffb --- /dev/null +++ b/src/components/DiyEditor/components/mobile/PromotionPoint/config.ts @@ -0,0 +1,96 @@ +import {ComponentStyle, DiyComponent} from '@/components/DiyEditor/util' + +/** 积分商城属性 */ +export interface PromotionPointProperty { + // 布局类型:单列 | 三列 + layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol' + // 商品字段 + fields: { + // 商品名称 + name: PromotionPointFieldProperty + // 商品简介 + introduction: PromotionPointFieldProperty + // 商品价格 + price: PromotionPointFieldProperty + // 市场价 + marketPrice: PromotionPointFieldProperty + // 商品销量 + salesCount: PromotionPointFieldProperty + // 商品库存 + stock: PromotionPointFieldProperty + } + // 角标 + badge: { + // 是否显示 + show: boolean + // 角标图片 + imgUrl: string + } + // 按钮 + btnBuy: { + // 类型:文字 | 图片 + type: 'text' | 'img' + // 文字 + text: string + // 文字按钮:背景渐变起始颜色 + bgBeginColor: string + // 文字按钮:背景渐变结束颜色 + bgEndColor: string + // 图片按钮:图片地址 + imgUrl: string + } + // 上圆角 + borderRadiusTop: number + // 下圆角 + borderRadiusBottom: number + // 间距 + space: number + // 秒杀活动编号 + activityIds: number[] + // 组件样式 + style: ComponentStyle +} + +// 商品字段 +export interface PromotionPointFieldProperty { + // 是否显示 + show: boolean + // 颜色 + color: string +} + +// 定义组件 +export const component = { + id: 'PromotionPoint', + name: '积分商城', + icon: 'ep:present', + property: { + layoutType: 'oneColBigImg', + fields: { + name: { show: true, color: '#000' }, + introduction: { show: true, color: '#999' }, + price: { show: true, color: '#ff3000' }, + marketPrice: { show: true, color: '#c4c4c4' }, + salesCount: { show: true, color: '#c4c4c4' }, + stock: { show: false, color: '#c4c4c4' } + }, + badge: { show: false, imgUrl: '' }, + btnBuy: { + type: 'text', + text: '立即兑换', + bgBeginColor: '#FF6000', + bgEndColor: '#FE832A', + imgUrl: '' + }, + borderRadiusTop: 8, + borderRadiusBottom: 8, + space: 8, + style: { + bgType: 'color', + bgColor: '', + marginLeft: 8, + marginRight: 8, + marginBottom: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue b/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue new file mode 100644 index 00000000..614980df --- /dev/null +++ b/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue @@ -0,0 +1,203 @@ + + + + diff --git a/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue b/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue new file mode 100644 index 00000000..84a429b6 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/src/views/mall/promotion/point/activity/index.vue b/src/views/mall/promotion/point/activity/index.vue index fa826940..ceceb7b5 100644 --- a/src/views/mall/promotion/point/activity/index.vue +++ b/src/views/mall/promotion/point/activity/index.vue @@ -10,15 +10,6 @@ class="-mb-15px" label-width="68px" > - - - +
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ + + + + + diff --git a/src/views/mall/promotion/point/components/PointTableSelect.vue b/src/views/mall/promotion/point/components/PointTableSelect.vue new file mode 100644 index 00000000..d68b5f15 --- /dev/null +++ b/src/views/mall/promotion/point/components/PointTableSelect.vue @@ -0,0 +1,300 @@ + + +