|
@@ -50,7 +50,7 @@ export default {
|
|
|
commit('setMaxDiscountFee',maxDiscountFee);
|
|
|
let pointsTime = 0
|
|
|
// 深圳
|
|
|
- if ( parkMallCode === 5 || parkMallCode === 8 || parkMallCode === 10) {
|
|
|
+ if ( [5, 8, 10].includes(parkMallCode)) {
|
|
|
pointsTime = discountFee || 0
|
|
|
} else {
|
|
|
pointsTime = discountFee ? discountFee / unitAmount: 0
|
|
@@ -123,7 +123,6 @@ export default {
|
|
|
const {parkMallCode} = parkInfo
|
|
|
const [points] = discountInfo?.points || [{}]
|
|
|
const newMemberPoints = discountInfo?.newMemberPoints || {}
|
|
|
- console.log(376,maxOneTimeDiscountTime,state.availableDiscountFee)
|
|
|
/**
|
|
|
* maxDiscountFee 单次最大可使用金额
|
|
|
* availableDiscountFee 当日剩余可使用优惠金额
|
|
@@ -174,7 +173,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// 单次上限限制
|
|
|
- if ( oneTimeLimitation && !msg && [5, 8, 10].indexOf(parkMallCode) < 0 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
|
|
|
+ if ( oneTimeLimitation && !msg && [2, 4, 5, 8, 10].indexOf(parkMallCode) < 0 && type === 'add') {
|
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice // 计算时间对应的金额
|
|
|
// const remainConsumeTimeFee = remainConsumeTime * hourPrice
|
|
|
// 计算单日剩余 remainConsumeTime
|
|
@@ -211,6 +210,7 @@ export default {
|
|
|
// if(parkMallCode === 6 && state?.usingTotalDiscount>= parkingRecord?.totalFeeInYuan) {
|
|
|
// return
|
|
|
// }
|
|
|
+ const isAmount = [5, 8, 10].indexOf(parkMallCode) > -1; // 积分兑换规则是否以 兑换值(元)为主;
|
|
|
if ( type === 'add' ) {
|
|
|
// this.totalFeeInYuan - this.remainPrice <= 0
|
|
|
if(state.orderDetail.parkingRecord.totalFee - state.usingTotalDiscount <= 0) {
|
|
@@ -222,9 +222,9 @@ export default {
|
|
|
// return
|
|
|
// }
|
|
|
let pointsTime = 0;
|
|
|
- pointsTime = state.pointsTime + ([5, 8, 10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
|
|
|
+ pointsTime = state.pointsTime + (isAmount ? state.unitAmount : state.unitHour);
|
|
|
const available = state.available - state.pointsPerUnit;
|
|
|
- const usingTotalDiscount = state.usingTotalDiscount + (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
|
|
|
+ const usingTotalDiscount = state.usingTotalDiscount + (isAmount ? state.unitAmount : state.unitHour * hourPrice ); // 重新计算已经使用的优惠逻辑
|
|
|
if ( available > -1 ) {
|
|
|
// 如果是深圳车场
|
|
|
commit('setAvailable',available);
|
|
@@ -233,8 +233,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if ( type === 'minus' && state.pointsTime > 0 ) {
|
|
|
- const pointsTime = state.pointsTime - ([5, 8, 10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
|
|
|
- const usingTotalDiscount = state.usingTotalDiscount - (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
|
|
|
+ const pointsTime = state.pointsTime - (isAmount ? state.unitAmount : state.unitHour);
|
|
|
+ const usingTotalDiscount = state.usingTotalDiscount - (isAmount ? state.unitAmount : state.unitHour * hourPrice); // 重新计算已经使用的优惠逻辑
|
|
|
// 如果是深圳车场
|
|
|
commit('setAvailable',state.available + state.pointsPerUnit);
|
|
|
commit('setPointsTime',pointsTime);
|