From 24fc36e23a42fe83c6ecb28f40cefdc68a340660 Mon Sep 17 00:00:00 2001
From: YunaiV <zhijiantianya@gmail.com>
Date: Fri, 6 Oct 2023 21:03:17 +0800
Subject: [PATCH] =?UTF-8?q?promotion=EF=BC=9A=E8=B0=83=E6=95=B4=E6=8B=BC?=
 =?UTF-8?q?=E5=9B=A2=E6=B4=BB=E5=8A=A8=E7=9A=84=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../promotion/combination/activity/index.vue  | 27 ++++++++++---------
 .../mall/promotion/seckill/activity/index.vue |  3 ++-
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/src/views/mall/promotion/combination/activity/index.vue b/src/views/mall/promotion/combination/activity/index.vue
index a6839a74..2d2d0373 100644
--- a/src/views/mall/promotion/combination/activity/index.vue
+++ b/src/views/mall/promotion/combination/activity/index.vue
@@ -71,26 +71,23 @@
       <el-table-column label="商品标题" prop="spuName" min-width="300" />
       <el-table-column
         label="原价"
-        prop="combinationFirstPrice"
+        prop="marketPrice"
         min-width="100"
         :formatter="fenToYuanFormat"
       />
-      <el-table-column
-        label="拼团价"
-        prop="combinationMinPrice"
-        min-width="100"
-        :formatter="fenToYuanFormat"
-      />
-      <el-table-column label="拼团人数" prop="recordUserCount" min-width="100" />
-      <el-table-column label="参与人数" prop="recordSuccessUserCount" min-width="110" />
-      <el-table-column label="成团人数" prop="helpUserCount" min-width="100" />
+      <el-table-column label="拼团价" prop="seckillPrice" min-width="100">
+        <template #default="scope">
+          {{ formatCombinationPrice(scope.row.products) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="开团组数" prop="groupCount" min-width="100" />
+      <el-table-column label="成团组数" prop="groupSuccessCount" min-width="100" />
+      <el-table-column label="购买次数" prop="recordCount" min-width="100" />
       <el-table-column label="活动状态" align="center" prop="status" min-width="100">
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column label="库存" align="center" prop="stock" min-width="80" />
-      <el-table-column label="总库存" align="center" prop="totalStock" min-width="80" />
       <el-table-column
         label="创建时间"
         align="center"
@@ -149,6 +146,7 @@ import * as CombinationActivityApi from '@/api/mall/promotion/combination/combin
 import CombinationActivityForm from './CombinationActivityForm.vue'
 import { formatDate } from '@/utils/formatTime'
 import { fenToYuanFormat } from '@/utils/formatter'
+import { fenToYuan } from '@/utils'
 
 defineOptions({ name: 'PromotionBargainActivity' })
 
@@ -224,6 +222,11 @@ const handleDelete = async (id: number) => {
   } catch {}
 }
 
+const formatCombinationPrice = (products) => {
+  const combinationPrice = Math.min(...products.map((item) => item.combinationPrice))
+  return `¥${fenToYuan(combinationPrice)}`
+}
+
 /** 初始化 **/
 onMounted(async () => {
   await getList()
diff --git a/src/views/mall/promotion/seckill/activity/index.vue b/src/views/mall/promotion/seckill/activity/index.vue
index 8e26840d..c102751f 100644
--- a/src/views/mall/promotion/seckill/activity/index.vue
+++ b/src/views/mall/promotion/seckill/activity/index.vue
@@ -87,7 +87,8 @@
         min-width="100"
         :formatter="fenToYuanFormat"
       />
-      <el-table-column label="秒杀价" prop="marketPrice" min-width="100">
+      <el-table-column label="原价" prop="marketPrice" min-width="100" />
+      <el-table-column label="秒杀价" prop="seckillPrice" min-width="100">
         <template #default="scope">
           {{ formatSeckillPrice(scope.row.products) }}
         </template>