修复积分抵扣接口报错问题

This commit is contained in:
2024-11-05 16:41:37 +08:00
parent 67a892ac01
commit dfe65e0ae6

View File

@@ -1407,7 +1407,7 @@ export default {
minDeductionPoints: 0, minDeductionPoints: 0,
maxUsablePoints: 0, maxUsablePoints: 0,
usable: false, usable: false,
points: 0, value: 0,
toMoney: 0, toMoney: 0,
}, },
//选中可用优惠券 //选中可用优惠券
@@ -1857,7 +1857,7 @@ export default {
this.createOrder.discount = 1; this.createOrder.discount = 1;
} }
}, },
"vipUser.id": async function (val) { "vipUser.id": function (val) {
// if (!this.table.tableId) { // if (!this.table.tableId) {
// return; // return;
// } // }
@@ -1875,6 +1875,9 @@ export default {
type: val === "" ? 1 : 0, type: val === "" ? 1 : 0,
}).then((res) => { }).then((res) => {
this.createOrder.data.memberId = val.id; this.createOrder.data.memberId = val.id;
this.getCalcUsablePoints().then((res) => {
this.pointsValueChange(this.points.value);
});
}); });
}, },
"prveOrder.list.length": function (val) { "prveOrder.list.length": function (val) {
@@ -1993,8 +1996,12 @@ export default {
}, },
methods: { methods: {
async getCalcUsablePoints() { async getCalcUsablePoints() {
const memberId= this.createOrder.data.memberId || this.vipUser.id
if(!memberId){
return
}
const pointsRes = await $calcUsablePoints({ const pointsRes = await $calcUsablePoints({
memberId: this.createOrder.data.memberId || this.vipUser.id, memberId:memberId,
orderAmount: this.currentPayMoney.toFixed(2), orderAmount: this.currentPayMoney.toFixed(2),
}); });
this.points.res = pointsRes; this.points.res = pointsRes;