From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目

---
 src/api/mall/promotion/point/index.ts |   91 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/src/api/mall/promotion/point/index.ts b/src/api/mall/promotion/point/index.ts
new file mode 100644
index 0000000..38254c2
--- /dev/null
+++ b/src/api/mall/promotion/point/index.ts
@@ -0,0 +1,91 @@
+import request from '@/config/axios'
+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 // 鍒涘缓鏃堕棿
+  products: PointProductVO[] // 绉垎鍟嗗煄鍟嗗搧
+
+  // ========== 鍟嗗搧瀛楁 ==========
+  spuName: string // 鍟嗗搧鍚嶇О
+  picUrl: string // 鍟嗗搧涓诲浘
+  marketPrice: number // 鍟嗗搧甯傚満浠凤紝鍗曚綅锛氬垎
+
+  //======================= 鏄剧ず鎵�闇�鍏戞崲绉垎鏈�灏戠殑 sku 淇℃伅 =======================
+  point: number // 鍏戞崲绉垎
+  price: number // 鍏戞崲閲戦锛屽崟浣嶏細鍒�
+}
+
+// 绉掓潃娲诲姩鎵�闇�灞炴��
+export interface PointProductVO {
+  id?: number // 绉垎鍟嗗煄鍟嗗搧缂栧彿
+  activityId?: number // 绉垎鍟嗗煄娲诲姩 id
+  spuId?: number // 鍟嗗搧 SPU 缂栧彿
+  skuId: number // 鍟嗗搧 SKU 缂栧彿
+  count: number // 鍙厬鎹㈡暟閲�
+  point: number // 鍏戞崲绉垎
+  price: number // 鍏戞崲閲戦锛屽崟浣嶏細鍒�
+  stock: number // 绉垎鍟嗗煄鍟嗗搧搴撳瓨
+  activityStatus?: number // 绉垎鍟嗗煄鍟嗗搧鐘舵��
+}
+
+// 鎵╁睍 Sku 閰嶇疆
+export type SkuExtension = Sku & {
+  productConfig: PointProductVO
+}
+
+export interface SpuExtension extends Spu {
+  skus: SkuExtension[] // 閲嶅啓绫诲瀷
+}
+
+export interface SpuExtension0 extends Spu {
+  pointStock: number // 绉垎鍟嗗煄娲诲姩搴撳瓨
+  pointTotalStock: number // 绉垎鍟嗗煄娲诲姩鎬诲簱瀛�
+  point: number // 鍏戞崲绉垎
+  pointPrice: number // 鍏戞崲閲戦锛屽崟浣嶏細鍒�
+}
+
+// 绉垎鍟嗗煄娲诲姩 API
+export const PointActivityApi = {
+  // 鏌ヨ绉垎鍟嗗煄娲诲姩鍒嗛〉
+  getPointActivityPage: async (params: any) => {
+    return await request.get({ url: `/promotion/point-activity/page`, params })
+  },
+
+  // 鏌ヨ绉垎鍟嗗煄娲诲姩璇︽儏
+  getPointActivity: async (id: number) => {
+    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 })
+  },
+
+  // 淇敼绉垎鍟嗗煄娲诲姩
+  updatePointActivity: async (data: PointActivityVO) => {
+    return await request.put({ url: `/promotion/point-activity/update`, data })
+  },
+
+  // 鍒犻櫎绉垎鍟嗗煄娲诲姩
+  deletePointActivity: async (id: number) => {
+    return await request.delete({ url: `/promotion/point-activity/delete?id=` + id })
+  },
+
+  // 鍏抽棴绉掓潃娲诲姩
+  closePointActivity: async (id: number) => {
+    return await request.put({ url: '/promotion/point-activity/close?id=' + id })
+  }
+}

--
Gitblit v1.8.0