|
@@ -63,16 +63,17 @@ export default {
|
|
|
this.enableConsumeSplit = this.orderDetail.parkingRule.enableConsumeSplit
|
|
|
}
|
|
|
|
|
|
-
|
|
|
this.checkedList = []
|
|
|
const {memberGrade = [],consume = [],memberLevelDiscount} = this.orderDetail.discountInfo;
|
|
|
this.memberGrade = {...memberGrade[0]}
|
|
|
this.consume = {...consume[0]}
|
|
|
- if ( JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected && !this.isMember ) {
|
|
|
+ if ( JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected) {
|
|
|
this.checkedList.push('member')
|
|
|
+ this.isMember = false
|
|
|
}
|
|
|
- if ( JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected && !this.isReduces ) {
|
|
|
- consume[0].defaultSelected && this.checkedList.push('reduces')
|
|
|
+ if ( JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected) {
|
|
|
+ this.checkedList.push('reduces')
|
|
|
+ this.isReduces = false
|
|
|
// 如果存在拆分逻辑的话
|
|
|
// this.consume.
|
|
|
}
|
|
@@ -87,7 +88,7 @@ export default {
|
|
|
setIsMemberDiscountDisabled() {
|
|
|
this.todayReduceDiscountMessage = '当日'
|
|
|
},
|
|
|
- confirm() {
|
|
|
+ async confirm() {
|
|
|
let orderDetail = cloneDeep(this.orderDetail)
|
|
|
// 如果初次进来操作的跟原来的不一样则重新计算优惠
|
|
|
if ( this.checkedList.length !== this.checkedTotal ) {
|
|
@@ -111,7 +112,8 @@ export default {
|
|
|
orderDetail.discountInfo.consume = [this.consume]
|
|
|
}
|
|
|
})
|
|
|
- this.$store.dispatch('order/saveDiscounts',{orderDetail,callback: () => this.$router.back()})
|
|
|
+ console.log(orderDetail.discountInfo.consume);
|
|
|
+ await this.$store.dispatch('order/saveDiscounts',{orderDetail,callback: () => this.$router.back()})
|
|
|
} else {
|
|
|
this.$router.back();
|
|
|
}
|
|
@@ -128,7 +130,10 @@ export default {
|
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
|
|
|
const remainConsumeTimeFee = remainConsumeTime * hourPrice
|
|
|
console.log(133,this.usingTotalDiscount,remainConsumeTimeFee,maxOneTimeDiscountFee)
|
|
|
- console.log('this.isMember',this.usingTotalDiscount,remainConsumeTimeFee,maxOneTimeDiscountFee,this.memberLevelDiscount)
|
|
|
+ console.log('this.isMember',{
|
|
|
+ usingTotalDiscount: this.usingTotalDiscount,remainConsumeTimeFee,maxOneTimeDiscountFee,memberLevelDiscount: this.memberLevelDiscount
|
|
|
+ })
|
|
|
+
|
|
|
// TODO: 统计纸质优惠券的总金额, usingTotalDiscount - 纸质优惠券的总金额,才是用户当前订单使用的优惠总数
|
|
|
this.isMember = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.memberLevelDiscount )
|
|
|
this.isReduces = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.enableConsume )
|