瀏覽代碼

【功能完善】积分商城:完善活动详情页面

Xiao_123 9 月之前
父節點
當前提交
f21c1c2bd6

+ 1 - 1
sheep/components/s-block-item/s-block-item.vue

@@ -39,7 +39,7 @@
     <s-groupon-block v-if="type === 'PromotionCombination'" :data="data" :styles="styles" />
     <!-- 营销组件:秒杀 -->
     <s-seckill-block v-if="type === 'PromotionSeckill'" :data="data" :styles="styles" />
-    <!-- 营销组件:积分商城(模式不一样,无法适配) -->
+    <!-- 营销组件:积分商城 -->
     <s-point-block v-if="type === 'PromotionPoint'" :data="data" :styles="styles" />
     <!-- 营销组件:小程序直播(暂时没有这个功能) -->
     <s-live-block v-if="type === 'MpLive'" :data="data" :styles="styles" />

+ 32 - 14
sheep/components/s-select-seckill-sku/s-select-seckill-sku.vue

@@ -19,8 +19,19 @@
           <view class="goods-title ss-line-2">{{ state.goodsInfo.name }}</view>
           <view class="header-right-bottom ss-flex ss-col-center ss-row-between">
             <!-- 价格 -->
-            <view class="price-text">
-              {{ fen2yuan(state.selectedSku.price || state.goodsInfo.price) }}
+            <view v-if="state.goodsInfo.activity_type === PromotionActivityTypeEnum.POINT.type"
+                  class="price-text ss-flex">
+              <image
+                v-if="!isEmpty(state.selectedSku)"
+                :src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
+                class="point-img"
+              ></image>
+              <text class="point-text ss-m-r-16">
+                {{ getShowPriceText }}
+              </text>
+            </view>
+            <view v-else class="price-text">
+              ¥{{ fen2yuan(state.selectedSku.price || state.goodsInfo.price) }}
             </view>
             <!-- 秒杀价格标签 -->
             <view class="tig ss-flex ss-col-center">
@@ -92,12 +103,15 @@
   import { computed, reactive, watch } from 'vue';
   import sheep from '@/sheep';
   import { convertProductPropertyList, fen2yuan } from '@/sheep/hooks/useGoods';
-  import { min } from 'lodash-es';
+  import { isEmpty, min } from 'lodash-es';
+  import { PromotionActivityTypeEnum } from '@/sheep/util/const';
+
   const emits = defineEmits(['change', 'addCart', 'buy', 'close']);
   const props = defineProps({
     modelValue: {
       type: Object,
-      default() {},
+      default() {
+      },
     },
     show: {
       type: Boolean,
@@ -114,7 +128,14 @@
     selectedSku: {},
     currentPropertyArray: [],
   });
-
+  const getShowPriceText = computed(() => {
+    let priceText = `¥${fen2yuan(state.goodsInfo.price)}`;
+    if (!isEmpty(state.selectedSku)) {
+      const sku = state.selectedSku;
+      priceText = `${sku.point}${!sku.pointPrice ? '' : `+¥${fen2yuan(sku.pointPrice)}`}`;
+    }
+    return priceText;
+  });
   const propertyList = convertProductPropertyList(state.goodsInfo.skus);
   // SKU 列表
   const skuList = computed(() => {
@@ -125,10 +146,6 @@
     return skuPrices;
   });
 
-  // if (!state.goodsInfo.is_sku) {
-  //   state.selectedSku = state.goodsInfo.skus[0];
-  // }
-
   watch(
     () => state.selectedSku,
     (newVal) => {
@@ -311,6 +328,12 @@
     }
   }
 
+  .point-img {
+    width: 36rpx;
+    height: 36rpx;
+    margin: 0 4rpx;
+  }
+
   .ss-modal-box {
     border-radius: 30rpx 30rpx 0 0;
     max-height: 1000rpx;
@@ -348,11 +371,6 @@
         font-weight: 500;
         color: $red;
         font-family: OPPOSANS;
-
-        &::before {
-          content: '¥';
-          font-size: 24rpx;
-        }
       }
 
       .stock-text {