|
@@ -2,8 +2,8 @@ import { checkOut, calculateDiscount, ordersAndPrepay, currentUnlicensedPlate, u
|
|
|
|
|
|
// import checkOutQHResponse from '@/api/mockData/checkout.qh3.response.json'
|
|
|
// import checkOutQHResponse from '@/api/mockData/checkout.hz.response.json';
|
|
|
-// import checkOutQHResponse from '@/api/mockData/checkout.qh4.response.json'
|
|
|
-import unlicensedCarCheckInResponse from '@/api/mockData/unlicensedCarCheckIn.qh.response.json';
|
|
|
+// import checkOutQHResponse from '@/api/mockData/checkout.qh5 .response.json'
|
|
|
+// import unlicensedCarCheckInResponse from '@/api/mockData/unlicensedCarCheckIn.qh.response.json';
|
|
|
|
|
|
// 大于等于停车费
|
|
|
// 微服务接口字段
|
|
@@ -148,7 +148,7 @@ const actions = {
|
|
|
// const res = await checkOut('闽AAQ5519', unlicensed);
|
|
|
// const res = await checkOut('粤A51113');
|
|
|
// const res = await checkOut('沪DCJ986');
|
|
|
- console.log('无牌车扫码出场', endlessLoop);
|
|
|
+ // console.log('无牌车扫码出场', endlessLoop);
|
|
|
// 场内缴费,调 check-out 接口,
|
|
|
const method = unlicensed && endlessLoop ? unlicensedCarCheckout : checkOut
|
|
|
const res = await method(vehicleNo, false, gateId);
|
|
@@ -170,30 +170,34 @@ const actions = {
|
|
|
// 记录buildingId
|
|
|
window.localStorage.setItem('buildingId', checkOutResponse.parkInfo.buildingId);
|
|
|
commit('setOrderDetail', checkOutResponse);
|
|
|
+ const isShowDiscounts = checkOutResponse?.parkingRule?.enableCoupon || false;
|
|
|
// 是否展示优惠
|
|
|
- commit('setIsShowDiscounts', checkOutResponse?.parkingRule?.enableCoupon || false);
|
|
|
- // 会员等级减免
|
|
|
- // 停车优惠(首停、会员减免、消费减免)
|
|
|
- dispatch('getCheckedTotal', checkOutResponse);
|
|
|
- // 是否开启新会员积分(hold)
|
|
|
- commit('setEnableNewMemberPoints', checkOutResponse.parkingRule.enableNewMemberPoints);
|
|
|
- // 积分减免
|
|
|
- dispatch('pointsRule', checkOutResponse);
|
|
|
- // dispatch('getIntegralDesc', checkOutResponse.parkingRule.enablePoints);
|
|
|
- // 电子优惠券:是否启用
|
|
|
- // 处理电子优惠券相关逻辑
|
|
|
- dispatch('couponRule', checkOutResponse);
|
|
|
- // 纸质优惠券(hold)
|
|
|
- commit('setEnablePaperCoupons', checkOutResponse.parkingRule.enablePaperCoupons);
|
|
|
- // 其他数据收集
|
|
|
- commit('setUsingTotalDiscount', checkOutResponse.discountInfo.usingTotalDiscount);
|
|
|
- commit('setActualPayFee', checkOutResponse.parkingRecord.actualPayFee);
|
|
|
+ commit('setIsShowDiscounts', isShowDiscounts);
|
|
|
+ if(isShowDiscounts) {
|
|
|
+ // 会员等级减免
|
|
|
+ // 停车优惠(首停、会员减免、消费减免)
|
|
|
+ dispatch('getCheckedTotal', checkOutResponse);
|
|
|
+ // 是否开启新会员积分(hold)
|
|
|
+ commit('setEnableNewMemberPoints', checkOutResponse.parkingRule.enableNewMemberPoints);
|
|
|
+ // 积分减免
|
|
|
+ dispatch('pointsRule', checkOutResponse);
|
|
|
+ // dispatch('getIntegralDesc', checkOutResponse.parkingRule.enablePoints);
|
|
|
+ // 电子优惠券:是否启用
|
|
|
+ // 处理电子优惠券相关逻辑
|
|
|
+ dispatch('couponRule', checkOutResponse);
|
|
|
+ // 纸质优惠券(hold)
|
|
|
+ commit('setEnablePaperCoupons', checkOutResponse?.parkingRule?.enablePaperCoupons || []);
|
|
|
+ // 其他数据收集
|
|
|
+ commit('setUsingTotalDiscount', checkOutResponse?.discountInfo?.usingTotalDiscount || 0);
|
|
|
+ }
|
|
|
+ console.log('190190190190', checkOutResponse);
|
|
|
+ commit('setActualPayFee', checkOutResponse.parkingRecord?.actualPayFee || checkOutResponse.parkingRecord?.totalFeeInYuan || 0.00);
|
|
|
},
|
|
|
// 停车优惠(首停、会员减免、消费减免)
|
|
|
getCheckedTotal({ commit, dispatch }, orderDetail) {
|
|
|
let checkedTotal = 0;
|
|
|
console.log(orderDetail);
|
|
|
- if (orderDetail?.discountInfo.memberLevelDiscount && orderDetail?.discountInfo?.memberGrade.length) {
|
|
|
+ if (orderDetail?.discountInfo?.memberLevelDiscount && orderDetail?.discountInfo?.memberGrade.length) {
|
|
|
orderDetail.discountInfo.memberGrade.forEach((elm) => {
|
|
|
if (elm.defaultSelected) {
|
|
|
checkedTotal++;
|