|
|
@@ -238,6 +238,24 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <!-- 订单套餐自动定价优惠(后端权威下发,命中才显示) -->
|
|
|
+ <view v-if="bundlePromo && bundlePromo.active" class="section bundle-promo-section">
|
|
|
+ <view class="bundle-promo-row">
|
|
|
+ <text class="bundle-promo-icon">📦</text>
|
|
|
+ <view class="bundle-promo-content">
|
|
|
+ <text class="bundle-promo-title">订单套餐自动匹配,已享套餐价</text>
|
|
|
+ <view v-for="(b, idx) in (bundlePromo.bundleList || [])" :key="idx" class="bundle-promo-line">
|
|
|
+ <text class="bundle-promo-name">{{ b.bundleName }} × {{ b.times }}</text>
|
|
|
+ <text class="bundle-promo-save">省 {{ formatPriceWithSymbol(b.saving) }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="bundle-promo-total">
|
|
|
+ <text class="bundle-promo-total-label">套餐优惠合计</text>
|
|
|
+ <text class="bundle-promo-discount">-{{ formatPriceWithSymbol(bundlePromoDiscount) }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- Coupon Section -->
|
|
|
<view v-if="!isSpecialCouponDisabled" class="section coupon-section" @click="openCouponPicker">
|
|
|
<view class="info-row">
|
|
|
@@ -486,6 +504,7 @@ import { BrandColors } from '@/utils/brand-colors.js'
|
|
|
import config from '@/config.js'
|
|
|
import { getCouponList, getCouponCheckoutList, addressList, getProductRequiredFields, getMyMembership, getGiftMembershipProgress, productDetail, getFamilyPlatformBalance, exchangeCouponByCf, shopDiscountCalculate, getSpecialPriceInfo, applyCoupon } from '../../../utils/api.js'
|
|
|
import { parseDate } from '@/utils/format.js'
|
|
|
+import { bundleDiscountOf } from '@/utils/bundle-pricing.js'
|
|
|
import CountdownTag from '@/pages/shop/components/countdown-tag.vue'
|
|
|
import HandSignature from '@/components/hand-signature/hand-signature.vue'
|
|
|
import fontScaleMixin from '@/mixins/font-scale.js'
|
|
|
@@ -537,7 +556,8 @@ export default {
|
|
|
giftItemIds: [],
|
|
|
giftProgress: null, // 赠会员累计进度
|
|
|
discountInfo: null,
|
|
|
- giftPromo: null, // 送会员一口价促销信息
|
|
|
+ giftPromo: null, // 送会员一口价促销信息(已废弃,后端恒返回非激活)
|
|
|
+ bundlePromo: null, // 订单套餐自动定价优惠(后端权威下发)
|
|
|
taskId: null, // 购买任务打卡:透传至支付页
|
|
|
// 限时特价(扫码闪购):由 product-detail 经 storage 一次性带入,onLoad 消费后即清除
|
|
|
checkoutSpecialDealId: null,
|
|
|
@@ -577,6 +597,10 @@ export default {
|
|
|
if (!this.giftPromo || this.giftPromo.active !== true) return 0
|
|
|
return this.giftPromo.discount || 0
|
|
|
},
|
|
|
+ // 订单套餐自动定价优惠(后端权威),命中则展示与扣减
|
|
|
+ bundlePromoDiscount() {
|
|
|
+ return bundleDiscountOf(this.bundlePromo)
|
|
|
+ },
|
|
|
// 限时特价(扫码闪购):特价单且活动禁止优惠券时隐藏优惠券选择区。
|
|
|
// 活动信息未返回(加载中/失败)时默认视为不可用券(特价单保守处理)。
|
|
|
isSpecialCouponDisabled() {
|
|
|
@@ -597,6 +621,7 @@ export default {
|
|
|
total = total - (this.couponDiscount || 0)
|
|
|
total = total - (this.pointsUsed || 0)
|
|
|
total = total - this.giftPromoDiscount
|
|
|
+ total = total - this.bundlePromoDiscount
|
|
|
if (total < 0) total = 0
|
|
|
return total
|
|
|
},
|
|
|
@@ -646,8 +671,10 @@ export default {
|
|
|
var stored = uni.getStorageSync('checkoutItems')
|
|
|
var giftIds = uni.getStorageSync('checkoutGiftItemIds')
|
|
|
var giftPromo = uni.getStorageSync('checkoutGiftPromo')
|
|
|
+ var bundlePromo = uni.getStorageSync('checkoutBundlePromo')
|
|
|
this.giftItemIds = (giftIds && giftIds.length > 0) ? giftIds : []
|
|
|
this.giftPromo = giftPromo || null
|
|
|
+ this.bundlePromo = bundlePromo || null
|
|
|
if (stored && stored.length > 0) {
|
|
|
this.items = stored
|
|
|
this.calcAmount()
|
|
|
@@ -1149,7 +1176,8 @@ export default {
|
|
|
addressId: that.selectedAddress.id,
|
|
|
purchaseInfo: that.purchaseForm,
|
|
|
pointsUsed: that.pointsUsed,
|
|
|
- discountAmount: (that.discountInfo ? that.discountInfo.discountAmount : 0) + that.giftPromoDiscount,
|
|
|
+ // discountAmount 仅含规则优惠(不含套餐/一口价):套餐优惠由服务端权威重算计入
|
|
|
+ discountAmount: (that.discountInfo ? that.discountInfo.discountAmount : 0),
|
|
|
couponId: that.selectedCoupon ? that.selectedCoupon.id : null,
|
|
|
// 特价单透传(无则传 null):后端 createSpecialDealOrder 校验活动后按特价结算
|
|
|
specialDealId: that.checkoutSpecialDealId || null,
|