fix
This commit is contained in:
@@ -138,7 +138,6 @@ export interface IOrder {
|
||||
checkOutDate: string;
|
||||
nights: number;
|
||||
roomPrice: number;
|
||||
serviceFee: number;
|
||||
couponDiscount: number;
|
||||
totalAmount: number;
|
||||
payAmount: number;
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user