refactor: 清理停用促销的移动端展示

This commit is contained in:
pikachu1995@126.com
2026-11-05 15:20:38 +08:00
parent 0637f1da1f
commit 8188a8af7b
5 changed files with 4 additions and 66 deletions

View File

@@ -70,7 +70,7 @@
<GoodsSwiper id="main1" :res="imgList" :video="goodsDetail.goodsVideo" />
<!-- 促销活动条(秒杀/限时直降/拼团等,M-02 含 E_COUPON) -->
<!-- 促销活动条(秒杀/拼团等,M-02 含 E_COUPON) -->
<PromotionAssembleLayout v-if="PromotionList" :detail="goodsDetail" :res="PromotionList" />
<view class="card-box top-radius-0" id="main2">

View File

@@ -5,7 +5,6 @@
class="showBox"
v-if="
promotion.__key == 'SECKILL' ||
promotion.__key == 'FLASH_DISCOUNT' ||
promotion.__key == 'GROUPBUY' ||
promotion.__key == 'PINTUAN'
"
@@ -37,29 +36,6 @@
</view>
</view>
<!-- 限时直降 -->
<view class="u-group-flex-left" v-if="promotion.__key == 'FLASH_DISCOUNT'">
<span
class="u-group-flex-left-span"
v-if="detail.promotionPrice != undefined"
>
¥
<span class="flex-price">
{{ goodsFormatPrice(detail.promotionPrice)[0] }}.{{
goodsFormatPrice(detail.promotionPrice)[1]
}}</span
>
</span>
<view class="u-group-flex" v-if="detail.price != undefined">
<span class="old-price"
>¥{{ goodsFormatPrice(detail.price)[0] }}.{{
goodsFormatPrice(detail.price)[1]
}}</span
>
<view class="promotion">限时直降</view>
</view>
</view>
<!-- 团购 -->
<view class="u-group-flex-left" v-if="promotion.__key == 'GROUPBUY'">
<span class="u-group-flex-left-span">

View File

@@ -40,26 +40,6 @@
</view>
</view>
<view v-if="getPromType(prom) == 'FLASH_DISCOUNT'">
<view class="res_prom_item">
<view class="deg_tag">限时直降</view>
<text class="pro-text">{{ props.res[prom].promotionName || props.res[prom].title || '限时直降活动' }}</text>
</view>
</view>
<view v-if="getPromType(prom) == 'NTH_ITEM_DISCOUNT'">
<view class="res_prom_item">
<view class="deg_tag">第N件优惠</view>
<text class="pro-text">
第{{ props.res[prom].nthNum || 'N' }}件
<text v-if="props.res[prom].discountType === 'FREE'">免费</text>
<text v-else-if="props.res[prom].discountType === 'HALF'">半价</text>
<text v-else-if="props.res[prom].discountValue">享{{ props.res[prom].discountValue }}折</text>
<text v-else>优惠</text>
</text>
</view>
</view>
<view v-if="getPromType(prom) == 'POINTS_GOODS'">
<view class="res_prom_item">
<view class="deg_tag">积分活动</view>
@@ -93,7 +73,9 @@ const props = defineProps<{
const promotionKeys = computed(() => {
if (!props.res || typeof props.res !== 'object') return []
return Object.keys(props.res).filter((key) => getPromType(key) !== 'COUPON')
return Object.keys(props.res).filter((key) =>
['FULL_DISCOUNT', 'PINTUAN', 'SECKILL', 'POINTS_GOODS', 'KANJIA'].includes(getPromType(key))
)
})
function getPromType(key: string) {

View File

@@ -2,18 +2,6 @@
<view>
<view v-for="(promotionItem, promotionIndex) in promotion" :key="promotionIndex" class="promotion_row" @click="shutMask(1)">
<view v-if="res != null" v-for="(item, index) in Object.keys(res)" :key="index">
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'FLASH_DISCOUNT'">
<div class="flex">
<view class="deg_tag">{{ promotionItem.title }}</view>
<div class="text proText">{{ res[item].promotionName || res[item].title || '限时直降' }}</div>
</div>
</div>
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'NTH_ITEM_DISCOUNT'">
<div class="flex">
<view class="deg_tag">{{ promotionItem.title }}</view>
<div class="text proText">{{ res[item].promotionName || res[item].title || '第N件优惠' }}</div>
</div>
</div>
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'FULL_DISCOUNT'">
<!-- 满减,折扣 -->
<div class="flex">

View File

@@ -7,14 +7,6 @@ const promotion = [
title: "砍价活动",
value: "KANJIA",
},
{
title: "限时直降",
value: "FLASH_DISCOUNT",
},
{
title: "第N件优惠",
value: "NTH_ITEM_DISCOUNT",
},
{
title: "团购",
value: "GROUPBUY",