Преглед изворни кода

fix(order): 修正确认订单页运费与优惠券计算逻辑

- 禁用开发环境配置中某条代理地址注释,启用另一条测试代理地址
- 订单总价计算中,新增根据配送方式判断是否计入运费
- 优惠券折扣逻辑改为根据是否手动选择优惠券动态加载折扣金额
- 计算订单总价时,修正优惠券折扣为当前选中或默认优惠金额的正确值
- 订单支付接口调用时,依据配送方式正确传递运费费用参数
- 确认订单页自提方式下显示运费金额调整为固定0.00元显示
- 代码格式微调,修复manifest.json尾部多余空行问题
zouzexu пре 1 дан
родитељ
комит
30c03968ba
2 измењених фајлова са 9 додато и 9 уклоњено
  1. 2 2
      src/config/index.ts
  2. 7 7
      src/subPack-xsb/confirmOrder/index.vue

+ 2 - 2
src/config/index.ts

@@ -8,10 +8,10 @@ const mapEnvVersion = {
   // develop: 'http://192.168.1.253:8080',
   // develop: 'http://192.168.0.19:8080', // 邓
   // develop: 'http://192.168.1.20:8080', // 黄
-  develop: 'http://192.168.0.11:8081', // 王
+  // develop: 'http://192.168.0.11:8081', // 王
   // develop: 'http://192.168.1.21:8080', // 田
   // develop: 'http://74949mkfh190.vicp.fun', // 付
-  // develop: 'http://47.109.84.152:8081', // 测试代理
+  develop: 'http://47.109.84.152:8081', // 测试代理
   // develop: 'https://5ed0f7cc.r9.vip.cpolar.cn',
   // develop: 'https://25740642.r3.cpolar.top',
   // develop: 'https://smqjh.api.zswlgz.com',

+ 7 - 7
src/subPack-xsb/confirmOrder/index.vue

@@ -87,14 +87,14 @@ const displayTotalPrice = computed(() => {
   if (!orderInfo.value) {
     return 0
   }
-  if (!hasManualCouponSelection.value) {
-    return Number(orderInfo.value.totalPrice || 0)
-  }
   const goodsPrice = Number(orderInfo.value.price || 0)
-  const freight = Number(orderInfo.value.transfee || 0)
+  const freight = Number(deliveryType.value !== 2 ? orderInfo.value.transfee : 0)
+  const couponDiscount = hasManualCouponSelection.value
+    ? Number(confirmedCoupon.value?.discountMoney || 0)
+    : Number(orderInfo.value?.coupon || 0)
   const pointsDiscount = offsetPoints.value / 100
   const memberDiscount = memberDiscountCents.value / 100
-  return Math.max(0, Number((goodsPrice + freight - currentCouponDiscount.value - pointsDiscount - memberDiscount).toFixed(2)))
+  return Math.max(0, Number((goodsPrice + freight - couponDiscount - pointsDiscount - memberDiscount).toFixed(2)))
 })
 const displayDiscountTotal = computed(() => Number((currentCouponDiscount.value + offsetPoints.value / 100 + memberDiscountCents.value / 100).toFixed(2)))
 const giftOriginalTotal = computed(() => {
@@ -273,7 +273,7 @@ async function handlePay() {
     })
 
     const orderNumber = await useUserStore().getOrderPayMent(
-      orderInfo.value.transfee,
+      deliveryType.value !== 2 ? orderInfo.value.transfee : 0,
       'XSB',
       deliveryType.value,
       Number(orderInfo.value?.skuList[0].shopId || SelectShopInfo.value?.shopId),
@@ -451,7 +451,7 @@ async function handlePay() {
           自提
         </view>
         <view class="text-#FF4D3A font-semibold">
-          ¥{{ orderInfo?.transfee }}
+          ¥{{ deliveryType == 2 ? '0.00' : orderInfo?.transfee }}
         </view>
       </view>
       <view v-if="!isMemberGiftOrder && userMemberInfo.active && orderInfo?.memberBenefitDesc && orderInfo?.memberDiscountAmount" class="mb28rpx flex items-center justify-between text-28rpx">