替换人脸拍照
This commit is contained in:
@ -501,6 +501,7 @@
|
||||
self.bill.dgf.nums = 0;
|
||||
self.bill.dgf.price = 0;
|
||||
self.bill.dgf.total = 0;
|
||||
self.bill.unLightTotal = 0;
|
||||
for (const key in self.order.trade) {
|
||||
const value = self.order.trade[key];
|
||||
for (const item of value) {
|
||||
@ -510,6 +511,11 @@
|
||||
self.bill.dgf.nums = self.order.hours;
|
||||
self.bill.dgf.price = 0; // 假设每个时间段的灯光价格相同
|
||||
self.bill.dgf.total += Number(item.light_price);
|
||||
// 将非灯光费用累加到 unLightTotal
|
||||
// if (Number(item.light_price) > 0) {
|
||||
// self.bill.unLightTotal += Number(item.room_price) - Number(item.light_price);
|
||||
// console.log("🚀 ~ Number(item.room_price):", Number(item.room_price), Number(item.light_price))
|
||||
// }
|
||||
}
|
||||
}
|
||||
// 保留两位小数但不四舍五入
|
||||
@ -519,10 +525,17 @@
|
||||
if (idx === -1) return str + (decimal > 0 ? '.' + '0'.repeat(decimal) : '');
|
||||
return str.substring(0, idx + decimal + 1).padEnd(idx + decimal + 1, '0');
|
||||
}
|
||||
|
||||
// self.bill.unLightTotal = Number(toFixedNoRound(self.bill.cdf.total - self.bill.dgf.total, 2));
|
||||
console.log("🚀 ~ self.bill.unLightTotal:", self.bill.unLightTotal)
|
||||
self.bill.cdf.total = Number(toFixedNoRound(self.bill.cdf.total - self.bill.dgf.total, 2));
|
||||
self.bill.dgf.total = Number(toFixedNoRound(self.bill.dgf.total, 2));
|
||||
self.bill.total = Number(toFixedNoRound(self.bill.cdf.total + self.bill.dgf.total, 2));
|
||||
self.originalTotal = self.bill.total; // 记录原始总价
|
||||
console.log("🚀 ~ self.bill:", self.bill)
|
||||
console.log("🚀 ~ self.bill.unLightTotal:", self.bill.unLightTotal)
|
||||
|
||||
|
||||
// }
|
||||
// self.countPrice()
|
||||
}
|
||||
@ -847,17 +860,17 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.userAccount = this.userBalance['balance' + this.currentType];
|
||||
this.userDiscount = this.balance['discount' + this.currentType];
|
||||
|
||||
const discount = Number(this.userDiscount) || 10; // 折扣,默认10(不打折)
|
||||
|
||||
// 始终基于原始金额打折
|
||||
const baseTotal = Number(this.originalTotal) || 0;
|
||||
// const baseTotal = Number(this.originalTotal) || 0;
|
||||
const baseTotal = Number(this.bill.cdf.total) || 0;
|
||||
const finalPrice = Number((baseTotal * (discount / 10)).toFixed(2));
|
||||
this.bill.dis = Number((baseTotal - finalPrice).toFixed(2));
|
||||
this.bill.total = finalPrice;
|
||||
this.bill.total = finalPrice + Number(this.bill.dgf.total);
|
||||
console.log("🚀 ~ finalPrice:", finalPrice)
|
||||
|
||||
// this.payType = this.currentType;
|
||||
|
||||
Reference in New Issue
Block a user