From a2dec947a2e4421c238388be75f8446be6329468 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 7 Aug 2024 17:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=EF=BC=9A=E7=A7=AF=E5=88=86=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/confirm.vue | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/pages/order/confirm.vue b/pages/order/confirm.vue index 4b53af54..139eb333 100644 --- a/pages/order/confirm.vue +++ b/pages/order/confirm.vue @@ -41,17 +41,25 @@ + + - 扣除积分 + 积分抵扣 + {{ state.pointStatus ? '剩余积分' : '当前积分' }} - {{ state.orderInfo.score_amount }} + + {{ state.pointStatus ? state.orderInfo.totalPoint - state.orderInfo.usePoint : (state.orderInfo.totalPoint || 0) }} + + + + @@ -195,6 +203,8 @@ showCoupon: false, // 是否展示优惠劵 couponInfo: [], // 优惠劵列表 showDiscount: false, // 是否展示营销活动 + // ========== 积分 ========== + pointStatus: false, //是否使用积分 }); const addressState = ref({ @@ -206,6 +216,15 @@ receiverMobile: '', // 收件人手机 }); + // ========== 积分 ========== + /** + * 使用积分抵扣 + */ + const changeIntegral = async () => { + state.pointStatus = !state.pointStatus; + await getOrderInfo(); + }; + // 选择优惠券 async function onSelectCoupon(couponId) { state.orderPayload.couponId = couponId || 0; @@ -251,7 +270,7 @@ pickUpStoreId: addressState.value.pickUpInfo.id,//自提门店编号 receiverName: addressState.value.receiverName,// 选择门店自提时,该字段为联系人名 receiverMobile: addressState.value.receiverMobile,// 选择门店自提时,该字段为联系人手机 - pointStatus: false, // TODO 芋艿:需要支持【积分选择】 + pointStatus: state.pointStatus, combinationActivityId: state.orderPayload.combinationActivityId, combinationHeadId: state.orderPayload.combinationHeadId, seckillActivityId: state.orderPayload.seckillActivityId, @@ -281,10 +300,10 @@ pickUpStoreId: addressState.value.pickUpInfo.id,//自提门店编号 receiverName: addressState.value.receiverName,// 选择门店自提时,该字段为联系人名 receiverMobile: addressState.value.receiverMobile,// 选择门店自提时,该字段为联系人手机 - pointStatus: false, // TODO 芋艿:需要支持【积分选择】 + pointStatus: state.pointStatus, combinationActivityId: state.orderPayload.combinationActivityId, combinationHeadId: state.orderPayload.combinationHeadId, - seckillActivityId: state.orderPayload.seckillActivityId + seckillActivityId: state.orderPayload.seckillActivityId, }); if (code !== 0) { return;