This commit is contained in:
2026-04-23 18:51:49 +08:00
parent 3284321919
commit 6be9d4afb7
74 changed files with 7660 additions and 688 deletions
-1
View File
@@ -138,7 +138,6 @@ export interface IOrder {
checkOutDate: string;
nights: number;
roomPrice: number;
serviceFee: number;
couponDiscount: number;
totalAmount: number;
payAmount: number;
+3 -3
View File
@@ -43,10 +43,10 @@ export function normalizePagination(page?: number, pageSize?: number): { page: n
}
/**
* 价格计算: 房费 + 服务费 - 优惠券
* 价格计算: 房费 - 优惠券
*/
export function calcOrderAmount(roomPrice: number, nights: number, serviceFee: number, couponDiscount: number): { totalAmount: number; payAmount: number } {
const totalAmount = roomPrice * nights + serviceFee;
export function calcOrderAmount(roomPrice: number, nights: number, couponDiscount: number): { totalAmount: number; payAmount: number } {
const totalAmount = roomPrice * nights;
const payAmount = Math.max(0, totalAmount - couponDiscount);
return { totalAmount, payAmount };
}