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;