|
@@ -41,6 +41,9 @@ export default {
|
|
|
maxOneDayCoupons: ( state ) => state.order.maxOneDayCoupons,// 仅限杭州当日电子券可选上限
|
|
|
paperDiscountFee: ( state ) => state.order.paperDiscountFee,// 纸质券的优惠金额
|
|
|
}),
|
|
|
+ totalFeeInYuan() {
|
|
|
+ return this?.orderDetail?.parkingRecord?.totalFee / 100
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
@@ -82,7 +85,7 @@ export default {
|
|
|
this.remainPrice = this.remainPrice - this.orderDetail.discountInfo.points[0].discountFee
|
|
|
}
|
|
|
// 如果前海开启无积分上限的话,则
|
|
|
- if ( [5, 10].indexOf(parkMallCode) > -1 && this.unLimitWeekendPoints && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
|
|
|
+ if ( [5, 10].indexOf(parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
|
|
|
this.remainPrice = this.remainPrice - this.orderDetail?.discountInfo?.points[0]?.discountFee
|
|
|
}
|
|
|
this.newAvailableDiscountFee = this.availableDiscountFee
|
|
@@ -122,7 +125,7 @@ export default {
|
|
|
checkboxItemChange(name, index) {
|
|
|
const coupon = this.couponList[index];
|
|
|
if ( coupon.disabled ) {
|
|
|
- if(!this.actualPayFee) {
|
|
|
+ if (this.getAmountToBePaid() <= 0) {
|
|
|
Toast('当前无需追加优惠')
|
|
|
return;
|
|
|
}
|
|
@@ -144,7 +147,8 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
// 如果有选中项
|
|
|
- if(!this.actualPayFee) {
|
|
|
+ // 还需支付金额 = 总金额 - 优惠金额
|
|
|
+ if (this.getAmountToBePaid() <= 0) {
|
|
|
Toast('当前无需追加优惠')
|
|
|
return;
|
|
|
}
|
|
@@ -334,7 +338,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// 深圳超限处理
|
|
|
- if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice >= this.newAvailableDiscountFee) {
|
|
|
+ if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice >= this.availableDiscountFee) {
|
|
|
if ( showMsg ) return true
|
|
|
return Toast({
|
|
|
message: `优惠券已达当日使用上限,不可再用`,
|
|
@@ -344,7 +348,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
// 单日上限
|
|
|
- if (oneDayLimitation && this.remainPrice >= this.newAvailableDiscountFee) {
|
|
|
+ if (oneDayLimitation && this.remainPrice >= this.availableDiscountFee) {
|
|
|
if ( showMsg ) return true
|
|
|
return Toast({
|
|
|
message: [5, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,
|
|
@@ -412,6 +416,17 @@ export default {
|
|
|
navigate_time:new Date().getTime()
|
|
|
}
|
|
|
},
|
|
|
+ // 获取还需支付金额
|
|
|
+ getAmountToBePaid() {
|
|
|
+ let amountToBePaid = this.totalFeeInYuan - this.paperDiscountFee - this.remainPrice;
|
|
|
+ if([ 5, 10 ].indexOf(this.parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
|
|
|
+ amountToBePaid = amountToBePaid - this.orderDetail.discountInfo?.points?.[0]?.discountFee
|
|
|
+ }
|
|
|
+ if([ 4, 6 ].indexOf(this.parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
|
|
|
+ amountToBePaid = amountToBePaid - this.orderDetail.discountInfo?.points?.[0]?.discountFee
|
|
|
+ }
|
|
|
+ return amountToBePaid
|
|
|
+ },
|
|
|
// 跳转小程序
|
|
|
navigateToMiniProgram() {
|
|
|
if (this.platform === 'miniprogram') {
|