diff --git a/api/pickupCard.js b/api/pickupCard.js new file mode 100644 index 0000000..6d79477 --- /dev/null +++ b/api/pickupCard.js @@ -0,0 +1,13 @@ +/** + * 提货卡选品、试算及一次兑换接口。 + * @author Bulbasaur + * @since 2026-11-05 + */ +import { http, Method } from '@/utils/request.js' + +/** 获取当前会员的卡规则及候选商品。 */ +export const getPickupCard = id => http.request({ url: `/promotion/pickupCard/${encodeURIComponent(id)}`, method: Method.GET, needToken: true }) +/** 服务端试算,校验商品与地址且不消耗权益。 */ +export const previewPickupCard = data => http.request({ url: '/promotion/pickupCard/preview', method: Method.POST, needToken: true, header: { 'content-type': 'application/json' }, data }) +/** 原子核销创单,网络重试返回原交易。 */ +export const redeemPickupCard = data => http.request({ url: '/promotion/pickupCard/redeem', method: Method.POST, needToken: true, header: { 'content-type': 'application/json' }, data }) diff --git a/manifest.json b/manifest.json index 79aabf4..a971817 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name" : "lilishop", "appid" : "__UNI__ED807EA", "description" : "", - "versionName" : "5.03", + "versionName" : "5.0.4", "versionCode" : 503, "transformPx" : false, "app-plus" : { diff --git a/pages.json b/pages.json index c7f3197..b83795a 100644 --- a/pages.json +++ b/pages.json @@ -848,7 +848,11 @@ } }, { - "path": "gift-card/myGiftCards", + "path": "gift-card/pickupCard", + "style": { "navigationBarTitleText": "提货卡兑换" } + }, + { + "path": "gift-card/myGiftCards", "style": { "navigationBarTitleText": "我的礼品卡" } diff --git a/pages/cart/gift-card/myGiftCards.vue b/pages/cart/gift-card/myGiftCards.vue index 047dadd..55f3ee1 100644 --- a/pages/cart/gift-card/myGiftCards.vue +++ b/pages/cart/gift-card/myGiftCards.vue @@ -52,17 +52,18 @@ {{ item.giftCardName || '礼品卡' }} - 面值{{ item.faceText }}元 + {{ item.cardType === 'PICKUP' ? '兑换 ' + item.pickupCount + ' 种商品' : '面值' + item.faceText + '元' }} {{ item.cardNo }} - 现金卡 + {{ item.cardType === 'PICKUP' ? '提货卡' : '现金卡' }} {{ item.expireText }} - + 每种一件 · 一次兑完 · 免邮 + 当前余额: ¥{{ unitPrice(item.balance) }} — @@ -236,7 +237,8 @@ function onCardPrimaryAction(item: any) { return } if (statusTab.value === GIFT_CARD_STATUS.AVAILABLE) { - uni.switchTab({ url: '/pages/tabbar/home/index' }) + if (item.cardType === 'PICKUP') uni.navigateTo({ url: '/pages/cart/gift-card/pickupCard?id=' + encodeURIComponent(resolveMemberCardId(item)) }) + else uni.switchTab({ url: '/pages/tabbar/home/index' }) } } diff --git a/pages/cart/gift-card/pickupCard.vue b/pages/cart/gift-card/pickupCard.vue new file mode 100644 index 0000000..8e76883 --- /dev/null +++ b/pages/cart/gift-card/pickupCard.vue @@ -0,0 +1,118 @@ + + + + + + diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue index e245423..ce77b31 100644 --- a/pages/order/myOrder.vue +++ b/pages/order/myOrder.vue @@ -1,803 +1,806 @@ - - - - - \ No newline at end of file diff --git a/pages/order/orderDetail.vue b/pages/order/orderDetail.vue index 2890236..131bac4 100644 --- a/pages/order/orderDetail.vue +++ b/pages/order/orderDetail.vue @@ -257,7 +257,7 @@ 取消订单 - 取消订单后,本单享有的优惠可能会一并取消,是否继续? + {{ order.pickupCardId ? '此订单使用提货卡兑换,取消不退还提货权益,无法再次兑换。是否继续?' : '取消订单后,本单享有的优惠可能会一并取消,是否继续?' }}