|
|
@@ -172,7 +172,7 @@
|
|
|
<text class="gift-progress-accumulated">已累 {{ giftAccumulatedYuan }} 元</text>
|
|
|
<text class="gift-progress-remaining">还差 {{ giftRemainingYuan }} 元送会员</text>
|
|
|
</view>
|
|
|
- <text class="gift-progress-note">仅原价实付订单计入累计,使用积分、优惠券或折扣的订单不计入</text>
|
|
|
+ <text class="gift-progress-note">单笔订单送会员商品原价达标即送,折扣订单也计入</text>
|
|
|
<view v-if="giftProgress.grantedLevel" class="gift-progress-level">
|
|
|
<text>达标将赠送 {{ giftProgress.grantedLevel === 'FAMILY' ? '家庭会员' : giftProgress.grantedLevel }} 权益</text>
|
|
|
</view>
|
|
|
@@ -212,6 +212,18 @@
|
|
|
<countdown-tag v-if="discountInfo.endTime" :end-time="discountInfo.endTime" />
|
|
|
</view>
|
|
|
|
|
|
+ <!-- Gift Promo Section -->
|
|
|
+ <view v-if="giftPromo && giftPromo.active" class="section gift-promo-section">
|
|
|
+ <view class="gift-promo-row">
|
|
|
+ <text class="gift-promo-icon">🎁</text>
|
|
|
+ <view class="gift-promo-content">
|
|
|
+ <text class="gift-promo-title">送会员一口价</text>
|
|
|
+ <text class="gift-promo-desc">送会员商品原价 {{ formatPriceWithSymbol(giftPromo.giftOriginalTotal) }} 元 → 实付 {{ formatPriceWithSymbol(giftPromo.payPrice) }} 元</text>
|
|
|
+ <text class="gift-promo-save">已优惠 {{ formatPriceWithSymbol(giftPromoDiscount) }} 元</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- Coupon Section -->
|
|
|
<view class="section coupon-section" @click="openCouponPicker">
|
|
|
<view class="info-row">
|
|
|
@@ -502,7 +514,8 @@ export default {
|
|
|
showOnlineSlotModal: false,
|
|
|
giftItemIds: [],
|
|
|
giftProgress: null, // 赠会员累计进度
|
|
|
- discountInfo: null
|
|
|
+ discountInfo: null,
|
|
|
+ giftPromo: null // 送会员一口价促销信息
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -526,6 +539,10 @@ export default {
|
|
|
giftIsGranted() {
|
|
|
return this.giftProgress && this.giftProgress.granted === 1
|
|
|
},
|
|
|
+ giftPromoDiscount() {
|
|
|
+ if (!this.giftPromo || this.giftPromo.active !== true) return 0
|
|
|
+ return this.giftPromo.discount || 0
|
|
|
+ },
|
|
|
giftLevelNames() {
|
|
|
var names = []
|
|
|
for (var i = 0; i < this.items.length; i++) {
|
|
|
@@ -541,6 +558,7 @@ export default {
|
|
|
total = total - this.selectedCoupon.value
|
|
|
}
|
|
|
total = total - (this.pointsUsed || 0)
|
|
|
+ total = total - this.giftPromoDiscount
|
|
|
if (total < 0) total = 0
|
|
|
return total
|
|
|
},
|
|
|
@@ -604,7 +622,9 @@ export default {
|
|
|
var that = this
|
|
|
var stored = uni.getStorageSync('checkoutItems')
|
|
|
var giftIds = uni.getStorageSync('checkoutGiftItemIds')
|
|
|
+ var giftPromo = uni.getStorageSync('checkoutGiftPromo')
|
|
|
this.giftItemIds = (giftIds && giftIds.length > 0) ? giftIds : []
|
|
|
+ this.giftPromo = giftPromo || null
|
|
|
if (stored && stored.length > 0) {
|
|
|
this.items = stored
|
|
|
this.calcAmount()
|
|
|
@@ -1005,7 +1025,7 @@ export default {
|
|
|
addressId: that.selectedAddress.id,
|
|
|
purchaseInfo: that.purchaseForm,
|
|
|
pointsUsed: that.pointsUsed,
|
|
|
- discountAmount: that.discountInfo ? that.discountInfo.discountAmount : 0,
|
|
|
+ discountAmount: (that.discountInfo ? that.discountInfo.discountAmount : 0) + that.giftPromoDiscount,
|
|
|
deliveryMethod: that.deliveryMethod,
|
|
|
pickupLocationId: that.selectedPickupLocation ? that.selectedPickupLocation.id : null,
|
|
|
timeSlotId: that.selectedTimeSlot ? that.selectedTimeSlot.id : null,
|
|
|
@@ -1022,6 +1042,7 @@ export default {
|
|
|
uni.showToast({ title: '下单成功', icon: 'success' })
|
|
|
uni.removeStorageSync('checkoutItems')
|
|
|
uni.removeStorageSync('checkoutGiftItemIds')
|
|
|
+ uni.removeStorageSync('checkoutGiftPromo')
|
|
|
var moneyAmount = order.moneyAmount != null ? order.moneyAmount : order.totalAmount
|
|
|
var pointsUsed = order.pointsUsed || 0
|
|
|
setTimeout(function() {
|
|
|
@@ -1816,4 +1837,38 @@ showOnlineSlotPicker: function() {
|
|
|
font-size: 26rpx;
|
|
|
color: #15803D;
|
|
|
}
|
|
|
+.gift-promo-section {
|
|
|
+ background: #FFF7ED;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ border: 2rpx solid #FED7AA;
|
|
|
+ margin: 20rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+}
|
|
|
+.gift-promo-row {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+.gift-promo-icon {
|
|
|
+ font-size: 32rpx;
|
|
|
+ margin-right: 12rpx;
|
|
|
+}
|
|
|
+.gift-promo-content {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.gift-promo-title {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #C2410C;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+.gift-promo-desc {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #9A3412;
|
|
|
+ margin-top: 4rpx;
|
|
|
+}
|
|
|
+.gift-promo-save {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #F97316;
|
|
|
+}
|
|
|
+/* 保持原有样式向下延伸 */
|
|
|
</style>
|