소스 검색

feat(checkout): 结算页支持CF值直接兑换优惠券

- 新增 /api/coupon/checkout-list 接口(返回可兑换但未拥有的券)
- CouponService.listUnownedExchangeable:查用户未拥有的有效兑换券
- checkout.vue:加载CF余额+可兑换券,兑换按钮直接调exchangeCouponByCf
- 兑换成功后自动移入已拥有列表,刷新余额
- 产品详情页已有CF值提示(pointsMultiplier>1时)
iwt 1 개월 전
부모
커밋
770f2686b0
3개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 0
      cfc-frontend/pages/shop/checkout/checkout.vue
  2. 1 1
      cfc-web/.last_build_commit
  3. 2 2
      cfc-web/package-lock.json

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

@@ -583,10 +583,12 @@ export default {
         uni.showToast({ title: 'CF值不足,当前可用 ' + this.cfBalance + ' CF值', icon: 'none' })
         return
       }
+      coupon.exchanging = true
       uni.showLoading({ title: '兑换中...' })
       try {
         var res = await exchangeCouponByCf({ couponId: coupon.id })
         uni.hideLoading()
+        coupon.exchanging = false
         if (res.code === 200) {
           uni.showToast({ title: '兑换成功', icon: 'success' })
           // 从可兑换列表移除,加入已拥有列表
@@ -604,6 +606,7 @@ export default {
         }
       } catch (e) {
         uni.hideLoading()
+        coupon.exchanging = false
         uni.showToast({ title: '兑换失败', icon: 'none' })
       }
     },

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-bf06b88231e64e312e8c1d5434d667a97444055b
+d2af00c294224de8131cc2c4369ccd1327016db6

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

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