先下单后付款了积分调整

This commit is contained in:
GaoHao
2024-11-21 17:00:47 +08:00
parent 88478b2768
commit 20350ea247

View File

@@ -237,8 +237,8 @@
}, },
methods: { methods: {
childOnShow() { childOnShow() {
this.getCalcUsablePoints()
if (!this.isShow ) { if (!this.isShow ) {
this.getCalcUsablePoints()
return; return;
} }
// uni.$on('couponItem',this.changeCoupon) // uni.$on('couponItem',this.changeCoupon)
@@ -268,11 +268,11 @@
// 判断优惠金额不能大于支付金额 // 判断优惠金额不能大于支付金额
if ( couponData.discountAmount < currentPayAmount) { if ( couponData.discountAmount < currentPayAmount) {
if ( this.isPointsChecked ) { // if ( this.isPointsChecked && this.calcUsablePointsData) {
this.listinfo.payAmount = (this.listinfo.payAmount-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2); // this.listinfo.payAmount = (this.listinfo.payAmount-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
} else { // } else {
this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2); // this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
} // }
this.listinfo.payAmount = ( currentPayAmount - couponData.discountAmount).toFixed(2) this.listinfo.payAmount = ( currentPayAmount - couponData.discountAmount).toFixed(2)
this.favorable[0].value = ('-¥'+couponData.discountAmount) this.favorable[0].value = ('-¥'+couponData.discountAmount)
@@ -282,10 +282,7 @@
discountAmount: couponData.discountAmount, discountAmount: couponData.discountAmount,
num: couponData.type == 1 ? 1 : couponData.num, num: couponData.type == 1 ? 1 : couponData.num,
}) })
if ( this.isPointsChecked ) {
this.isPointsChecked = !this.isPointsChecked
this.getCalcUsablePoints()
}
this.$emit("setPayAmount",{ this.$emit("setPayAmount",{
payAmount: this.listinfo.payAmount, payAmount: this.listinfo.payAmount,
userCouponInfos: this.userCouponInfos, userCouponInfos: this.userCouponInfos,
@@ -351,10 +348,7 @@
} }
}) })
if ( this.isPointsChecked) {
this.isPointsChecked = !this.isPointsChecked
this.getCalcUsablePoints()
}
} }
this.setPayAmount() this.setPayAmount()