|
@@ -46,7 +46,7 @@ export default {
|
|
|
commit('setMaxDiscountFee',maxDiscountFee);
|
|
|
let pointsTime = 0
|
|
|
// 深圳
|
|
|
- if ( parkMallCode === 5 ) {
|
|
|
+ if ( parkMallCode === 5 || parkMallCode === 10) {
|
|
|
pointsTime = discountFee || 0
|
|
|
} else {
|
|
|
pointsTime = discountFee ? discountFee / unitAmount: 0
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
commit('setIntegralDesc', '今日积分已达上限');
|
|
|
return
|
|
|
}
|
|
|
- commit('setIntegralDesc',pointsTime ? `已选择兑换${ pointsTime }${parkMallCode === 5 ? '元' : '小时'}` : available > pointsPerUnit ? `${ available }积分可减免` : `${ pointsPerUnit }积分可停车1小时`); // 积分优惠处的描述
|
|
|
+ commit('setIntegralDesc',pointsTime ? `已选择兑换${ pointsTime }${parkMallCode === 5 || parkMallCode === 10 ? '元' : '小时'}` : available > pointsPerUnit ? `${ available }积分可减免` : `${ pointsPerUnit }积分可停车1小时`); // 积分优惠处的描述
|
|
|
},
|
|
|
// 当前最大可选优惠时间
|
|
|
/*
|
|
@@ -132,7 +132,7 @@ export default {
|
|
|
maxPointsTime = state.availableDiscountFee
|
|
|
}
|
|
|
// if ( parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT' ) {
|
|
|
- if ( parkMallCode === 5 && !state.unLimitWeekendPoints ) {
|
|
|
+ if ( [ 5, 10 ].indexOf(parkMallCode) > -1 && !state.unLimitWeekendPoints ) {
|
|
|
if ( type === 'add' && (state.pointsTime >= maxPointsTime || state.usingTotalDiscount >= state.availableDiscountFee) ) {
|
|
|
// 以下是深圳积分上限规则
|
|
|
// 超出抵扣上限,每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元 '优惠金额' >= '每日最高可抵扣'
|
|
@@ -146,7 +146,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// 单日上限限制
|
|
|
- if ( oneDayLimitation && !msg && parkMallCode !== 5 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
|
|
|
+ if ( oneDayLimitation && !msg && [5,4,2, 10].indexOf(parkMallCode) < 0 && type === 'add') {
|
|
|
// const maxOneTimeDiscountFee = maxOneDayDiscountFee
|
|
|
// const remainConsumeTimeFee = remainConsumeTime * hourPrice
|
|
|
// 计算单日剩余 remainConsumeTime
|
|
@@ -158,7 +158,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// 单次上限限制
|
|
|
- if ( oneTimeLimitation && !msg && parkMallCode !== 5 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
|
|
|
+ if ( oneTimeLimitation && !msg && [5, 10].indexOf(parkMallCode) < 0 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
|
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice // 计算时间对应的金额
|
|
|
// const remainConsumeTimeFee = remainConsumeTime * hourPrice
|
|
|
// 计算单日剩余 remainConsumeTime
|
|
@@ -202,7 +202,7 @@ export default {
|
|
|
// return
|
|
|
// }
|
|
|
let pointsTime = 0;
|
|
|
- pointsTime = state.pointsTime + (parkMallCode === 5 ? state.unitAmount : state.unitHour);
|
|
|
+ pointsTime = state.pointsTime + ([5,10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
|
|
|
const available = state.available - state.pointsPerUnit;
|
|
|
const usingTotalDiscount = state.usingTotalDiscount + (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
|
|
|
if ( available > -1 ) {
|
|
@@ -213,7 +213,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if ( type === 'minus' && state.pointsTime > 0 ) {
|
|
|
- const pointsTime = state.pointsTime - (parkMallCode === 5 ? state.unitAmount : state.unitHour);
|
|
|
+ const pointsTime = state.pointsTime - ([5,10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
|
|
|
const usingTotalDiscount = state.usingTotalDiscount - (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
|
|
|
// 如果是深圳车场
|
|
|
commit('setAvailable',state.available + state.pointsPerUnit);
|
|
@@ -235,7 +235,7 @@ export default {
|
|
|
}
|
|
|
let pointsTime = 0
|
|
|
// 深圳
|
|
|
- if ( parkMallCode === 5 ) {
|
|
|
+ if ( parkMallCode === 5 || parkMallCode === 10) {
|
|
|
pointsTime = discountFee || 0
|
|
|
} else {
|
|
|
pointsTime = discountFee ? discountFee / unitAmount : 0
|
|
@@ -260,7 +260,7 @@ export default {
|
|
|
setSelected(['memberGrade','consume','paperCoupons','coupons','newMemberPoints'],orderDetail)
|
|
|
// 计算积分修改之后的金额,返回给后端
|
|
|
// orderDetail.discountInfo.points[0].discountFee = state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
|
|
|
- orderDetail.discountInfo.points[0].discountFee = parkMallCode === 5 ? state.pointsTime : state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
|
|
|
+ orderDetail.discountInfo.points[0].discountFee = [5,10].indexOf(parkMallCode) > -1 ? state.pointsTime : state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
|
|
|
orderDetail.discountInfo.points[0].available = state.available;
|
|
|
orderDetail.discountInfo.points[0].selected = true;
|
|
|
/* 其他优惠统计 */
|