Explorar o código

【功能完善】积分商城:完善订单相关信息展示

puhui999 hai 10 meses
pai
achega
732aa7686c
Modificáronse 2 ficheiros con 25 adicións e 9 borrados
  1. 21 2
      pages/goods/point.vue
  2. 4 7
      pages/order/confirm.vue

+ 21 - 2
pages/goods/point.vue

@@ -94,8 +94,15 @@
             "
             :disabled="state.goodsInfo.stock === 0"
           >
-            <view class="price-text">
-              {{ getShowPriceText }}
+            <view class="price-box ss-flex">
+              <image
+                :src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
+                style="width: 36rpx;height: 36rpx;margin: 0 4rpx;"
+              ></image>
+              <text class="point-text ss-m-r-16">
+                {{ getShowPrice.point }}
+                {{ !getShowPrice.price || getShowPrice.price === 0 ? '' : `+¥${getShowPrice.price}` }}
+              </text>
             </view>
             <view v-if="state.goodsInfo.stock === 0">已售罄</view>
             <view v-else>立即兑换</view>
@@ -202,6 +209,15 @@
     };
   });
 
+  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 getActivity = async (id) => {
     const { data } = await PointApi.getPointActivity(id);
@@ -276,6 +292,7 @@
         height: 36rpx;
         margin: 0 4rpx;
       }
+
       .point-text {
         font-size: 42rpx;
         font-weight: 500;
@@ -283,6 +300,7 @@
         line-height: 36rpx;
         font-family: OPPOSANS;
       }
+
       .price-text {
         font-size: 42rpx;
         font-weight: 500;
@@ -291,6 +309,7 @@
         font-family: OPPOSANS;
       }
     }
+
     .origin-price-text {
       font-size: 26rpx;
       font-weight: 400;

+ 4 - 7
pages/order/confirm.vue

@@ -58,17 +58,14 @@
         >
           <view class="item-title">积分抵扣</view>
           <view class="ss-flex ss-col-center">
-            {{ state.pointStatus ? '剩余积分' : '当前积分' }}
+            {{ state.pointStatus || state.orderPayload.pointActivityId ? '剩余积分' : '当前积分' }}
             <image
               :src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
               class="score-img"
             />
-            <text class="item-value ss-m-r-24" v-if="state.orderPayload.pointActivityId">
-              {{ state.orderInfo.totalPoint || 0 }}
-            </text>
-            <text class="item-value ss-m-r-24" v-if="!state.orderPayload.pointActivityId">
+            <text class="item-value ss-m-r-24">
               {{
-                state.pointStatus
+                state.pointStatus || state.orderPayload.pointActivityId
                   ? state.orderInfo.totalPoint - state.orderInfo.usePoint
                   : state.orderInfo.totalPoint || 0
               }}
@@ -346,7 +343,7 @@
       return;
     }
     state.orderInfo = data;
-    state.couponInfo = data.coupons;
+    state.couponInfo = data.coupons || [];
     // 设置收货地址
     if (state.orderInfo.address) {
       addressState.value.addressInfo = state.orderInfo.address;