Sfoglia il codice sorgente

chore: auto bump version and changelog [skip ci]

iwt 4 giorni fa
parent
commit
306810fb8e

+ 1 - 0
cfc-backend/src/main/java/com/etotem/cfc/controller/cart/CartController.java

@@ -1,6 +1,7 @@
 package com.etotem.cfc.controller.cart;
 
 import com.etotem.cfc.common.Result;
+import com.etotem.cfc.dto.CartItemDTO;
 import com.etotem.cfc.dto.CartListResultDTO;
 import com.etotem.cfc.service.CartService;
 import org.springframework.web.bind.annotation.PostMapping;

+ 43 - 0
cfc-frontend/pages/shop/cart/cart.vue

@@ -416,6 +416,7 @@ export default {
         }
       }
       uni.setStorageSync('checkoutItems', selected)
+      uni.setStorageSync('checkoutGiftPromo', this.giftPromo)
       uni.navigateTo({ url: '/pages/shop/checkout/checkout' })
     },
     formatPriceWithSymbol(price) {
@@ -752,6 +753,48 @@ export default {
   font-size: 22rpx;
   color: #F97316;
 }
+/* Gift promo section */
+.gift-promo-section {
+  padding: 20rpx 30rpx;
+  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
+  border-top: 2rpx solid #F59E0B;
+}
+.gift-promo-header {
+  display: flex;
+  align-items: center;
+  margin-bottom: 12rpx;
+}
+.gift-promo-icon {
+  font-size: 32rpx;
+  margin-right: 12rpx;
+}
+.gift-promo-title {
+  flex: 1;
+  font-size: 26rpx;
+  color: #92400E;
+  font-weight: 500;
+}
+.gift-promo-bar {
+  height: 16rpx;
+  background: #FCD34D;
+  border-radius: 8rpx;
+  overflow: hidden;
+  margin-bottom: 8rpx;
+}
+.gift-promo-bar-fill {
+  height: 100%;
+  background: linear-gradient(90deg, #F59E0B, #D97706);
+  border-radius: 8rpx;
+}
+.gift-promo-remaining {
+  font-size: 22rpx;
+  color: #92400E;
+}
+.gift-promo-reached {
+  font-size: 22rpx;
+  color: #D97706;
+  font-weight: bold;
+}
 .gift-granted-hint {
   display: flex;
   align-items: center;

+ 58 - 3
cfc-frontend/pages/shop/checkout/checkout.vue

@@ -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>

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-08d52ac04cbd362171a9c7aac0d806fe04fab04b
+b27ceb1941d08daca4899cfb29192ab218fcc7df

+ 2 - 2
cfc-web/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "cfc-web",
-  "version": "1.0.1506",
+  "version": "1.0.1507",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "cfc-web",
-      "version": "1.0.1506",
+      "version": "1.0.1507",
       "dependencies": {
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^1.0.2",