|
@@ -50,7 +50,7 @@ export default {
|
|
commit('setMaxDiscountFee',maxDiscountFee);
|
|
commit('setMaxDiscountFee',maxDiscountFee);
|
|
let pointsTime = 0
|
|
let pointsTime = 0
|
|
// 深圳
|
|
// 深圳
|
|
- if ( parkMallCode === 5 || parkMallCode === 10) {
|
|
|
|
|
|
+ if ( parkMallCode === 5 || parkMallCode === 8 || parkMallCode === 10) {
|
|
pointsTime = discountFee || 0
|
|
pointsTime = discountFee || 0
|
|
} else {
|
|
} else {
|
|
pointsTime = discountFee ? discountFee / unitAmount: 0
|
|
pointsTime = discountFee ? discountFee / unitAmount: 0
|
|
@@ -140,7 +140,7 @@ export default {
|
|
maxPointsTime = state.availableDiscountFee
|
|
maxPointsTime = state.availableDiscountFee
|
|
}
|
|
}
|
|
// if ( parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT' ) {
|
|
// if ( parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT' ) {
|
|
- if ( [ 5, 10 ].indexOf(parkMallCode) > -1 && !state.unLimitWeekendPoints ) {
|
|
|
|
|
|
+ if ( [ 5, 8, 10 ].indexOf(parkMallCode) > -1 && !state.unLimitWeekendPoints ) {
|
|
if ( type === 'add' && (state.pointsTime >= maxPointsTime || state.usingTotalDiscount - state.paperDiscountFee >= state.availableDiscountFee) ) {
|
|
if ( type === 'add' && (state.pointsTime >= maxPointsTime || state.usingTotalDiscount - state.paperDiscountFee >= state.availableDiscountFee) ) {
|
|
// 以下是深圳积分上限规则
|
|
// 以下是深圳积分上限规则
|
|
// 超出抵扣上限,每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元 '优惠金额' >= '每日最高可抵扣'
|
|
// 超出抵扣上限,每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元 '优惠金额' >= '每日最高可抵扣'
|
|
@@ -151,7 +151,7 @@ export default {
|
|
// console.log(4444, points.remainDiscountFeePerDay, state.maxDiscountFee)
|
|
// console.log(4444, points.remainDiscountFeePerDay, state.maxDiscountFee)
|
|
if ( state.pointsTime >= state.maxDiscountFee && !msg ) {
|
|
if ( state.pointsTime >= state.maxDiscountFee && !msg ) {
|
|
// 当前当日积分抵扣上限总额 小于单次积分抵扣金额,加积分抵扣提示 “已达当日积分抵扣上限”
|
|
// 当前当日积分抵扣上限总额 小于单次积分抵扣金额,加积分抵扣提示 “已达当日积分抵扣上限”
|
|
- if ([ 5 ].indexOf(parkMallCode) > -1 && points.remainDiscountFeePerDay === state.maxDiscountFee) {
|
|
|
|
|
|
+ if ([ 5, 8 ].indexOf(parkMallCode) > -1 && points.remainDiscountFeePerDay === state.maxDiscountFee) {
|
|
msg = `已达当日积分抵扣上限`
|
|
msg = `已达当日积分抵扣上限`
|
|
|
|
|
|
} else { // 当前当日积分抵扣上限总额 大于或者等于单次积分抵扣金额,加积分抵扣提示 “超出抵扣上限,每次最高可抵扣 *** 元”
|
|
} else { // 当前当日积分抵扣上限总额 大于或者等于单次积分抵扣金额,加积分抵扣提示 “超出抵扣上限,每次最高可抵扣 *** 元”
|
|
@@ -162,7 +162,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 单日上限限制
|
|
// 单日上限限制
|
|
- if ( oneDayLimitation && !msg && [5,4,2, 10].indexOf(parkMallCode) < 0 && type === 'add') {
|
|
|
|
|
|
+ if ( oneDayLimitation && !msg && [5,4,2, 8, 10].indexOf(parkMallCode) < 0 && type === 'add') {
|
|
// const maxOneTimeDiscountFee = maxOneDayDiscountFee
|
|
// const maxOneTimeDiscountFee = maxOneDayDiscountFee
|
|
// const remainConsumeTimeFee = remainConsumeTime * hourPrice
|
|
// const remainConsumeTimeFee = remainConsumeTime * hourPrice
|
|
// 计算单日剩余 remainConsumeTime
|
|
// 计算单日剩余 remainConsumeTime
|
|
@@ -174,7 +174,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 单次上限限制
|
|
// 单次上限限制
|
|
- if ( oneTimeLimitation && !msg && [5, 10].indexOf(parkMallCode) < 0 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
|
|
|
|
|
|
+ if ( oneTimeLimitation && !msg && [5, 8, 10].indexOf(parkMallCode) < 0 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice // 计算时间对应的金额
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice // 计算时间对应的金额
|
|
// const remainConsumeTimeFee = remainConsumeTime * hourPrice
|
|
// const remainConsumeTimeFee = remainConsumeTime * hourPrice
|
|
// 计算单日剩余 remainConsumeTime
|
|
// 计算单日剩余 remainConsumeTime
|
|
@@ -220,7 +220,7 @@ export default {
|
|
// return
|
|
// return
|
|
// }
|
|
// }
|
|
let pointsTime = 0;
|
|
let pointsTime = 0;
|
|
- pointsTime = state.pointsTime + ([5,10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
|
|
|
|
|
|
+ pointsTime = state.pointsTime + ([5, 8, 10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
|
|
const available = state.available - state.pointsPerUnit;
|
|
const available = state.available - state.pointsPerUnit;
|
|
const usingTotalDiscount = state.usingTotalDiscount + (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
|
|
const usingTotalDiscount = state.usingTotalDiscount + (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
|
|
if ( available > -1 ) {
|
|
if ( available > -1 ) {
|
|
@@ -231,7 +231,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ( type === 'minus' && state.pointsTime > 0 ) {
|
|
if ( type === 'minus' && state.pointsTime > 0 ) {
|
|
- const pointsTime = state.pointsTime - ([5,10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
|
|
|
|
|
|
+ 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 usingTotalDiscount = state.usingTotalDiscount - (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
|
|
// 如果是深圳车场
|
|
// 如果是深圳车场
|
|
commit('setAvailable',state.available + state.pointsPerUnit);
|
|
commit('setAvailable',state.available + state.pointsPerUnit);
|
|
@@ -253,7 +253,7 @@ export default {
|
|
}
|
|
}
|
|
let pointsTime = 0
|
|
let pointsTime = 0
|
|
// 深圳
|
|
// 深圳
|
|
- if ( parkMallCode === 5 || parkMallCode === 10) {
|
|
|
|
|
|
+ if ( parkMallCode === 5 || parkMallCode === 8 || parkMallCode === 10) {
|
|
pointsTime = discountFee || 0
|
|
pointsTime = discountFee || 0
|
|
} else {
|
|
} else {
|
|
pointsTime = discountFee ? discountFee / unitAmount : 0
|
|
pointsTime = discountFee ? discountFee / unitAmount : 0
|
|
@@ -277,7 +277,7 @@ export default {
|
|
setSelected(['memberGrade','consume','paperCoupons','coupons','newMemberPoints'],orderDetail)
|
|
setSelected(['memberGrade','consume','paperCoupons','coupons','newMemberPoints'],orderDetail)
|
|
// 计算积分修改之后的金额,返回给后端
|
|
// 计算积分修改之后的金额,返回给后端
|
|
// orderDetail.discountInfo.points[0].discountFee = state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
|
|
// orderDetail.discountInfo.points[0].discountFee = 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].discountFee = [5, 8, 10].indexOf(parkMallCode) > -1 ? state.pointsTime : state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
|
|
orderDetail.discountInfo.points[0].available = state.available;
|
|
orderDetail.discountInfo.points[0].available = state.available;
|
|
orderDetail.discountInfo.points[0].selected = true;
|
|
orderDetail.discountInfo.points[0].selected = true;
|
|
/* 其他优惠统计 */
|
|
/* 其他优惠统计 */
|
|
@@ -344,7 +344,7 @@ export default {
|
|
integralDescTule({commit,dispatch,state},{pointsTime, parkMallCode, available, pointsPerUnit, enableNewMemberPoints, newMemberPoints,unitAmount, checkOutResponse} ) {
|
|
integralDescTule({commit,dispatch,state},{pointsTime, parkMallCode, available, pointsPerUnit, enableNewMemberPoints, newMemberPoints,unitAmount, checkOutResponse} ) {
|
|
// commit('setIntegralDesc',pointsTime ? `已选择兑换${ pointsTime }${parkMallCode === 5 || parkMallCode === 10 ? '元' : '小时'}` : available > pointsPerUnit ? `${ available }积分可减免` : `${ pointsPerUnit }积分可停车1小时`); // 积分优惠处的描述
|
|
// commit('setIntegralDesc',pointsTime ? `已选择兑换${ pointsTime }${parkMallCode === 5 || parkMallCode === 10 ? '元' : '小时'}` : available > pointsPerUnit ? `${ available }积分可减免` : `${ pointsPerUnit }积分可停车1小时`); // 积分优惠处的描述
|
|
if(pointsTime) {
|
|
if(pointsTime) {
|
|
- commit('setIntegralDesc', `已选择兑换${ pointsTime }${[5, 10].indexOf(parkMallCode)> -1 ? '元' : '小时'}`)
|
|
|
|
|
|
+ commit('setIntegralDesc', `已选择兑换${ pointsTime }${[5, 8, 10].indexOf(parkMallCode)> -1 ? '元' : '小时'}`)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if(available > pointsPerUnit) {
|
|
if(available > pointsPerUnit) {
|
|
@@ -357,7 +357,7 @@ export default {
|
|
commit('setIntegralDesc', `${ available }积分可减免`)
|
|
commit('setIntegralDesc', `${ available }积分可减免`)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- commit('setIntegralDesc', `${ pointsPerUnit }积分可停车${[5, 10].indexOf(parkMallCode)> -1 ? unitAmount + '元' : '1小时'}`)
|
|
|
|
|
|
+ commit('setIntegralDesc', `${ pointsPerUnit }积分可停车${[5, 8, 10].indexOf(parkMallCode)> -1 ? unitAmount + '元' : '1小时'}`)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|