|
@@ -88,6 +88,14 @@ export const formatOrderDetail = async (item: any, amount?: IAmount) => {
|
|
|
{
|
|
|
try {
|
|
|
const res = await getVipDetail(item.id)
|
|
|
+
|
|
|
+ // couponAmount 总的优惠金额
|
|
|
+ // discountPrice 优惠券金额
|
|
|
+ let tempPrice = res.salePrice || item.actualPrice
|
|
|
+ if (amount?.couponAmount) {
|
|
|
+ tempPrice = Number(((res.salePrice - (amount.couponAmount -
|
|
|
+ amount.discountPrice) / res.times)).toFixed(2))
|
|
|
+ }
|
|
|
tempList = {
|
|
|
orderType: item.goodType,
|
|
|
goodName: item.goodName,
|
|
@@ -96,15 +104,7 @@ export const formatOrderDetail = async (item: any, amount?: IAmount) => {
|
|
|
title: memberType[res.period] || '',
|
|
|
vipEndDays: item.vipEndDays,
|
|
|
// 判断是否有优惠金额
|
|
|
- price: amount?.couponAmount
|
|
|
- ? Number(
|
|
|
- (
|
|
|
- res.salePrice -
|
|
|
- amount.couponAmount +
|
|
|
- amount.discountPrice
|
|
|
- ).toFixed(2)
|
|
|
- )
|
|
|
- : res.salePrice || item.actualPrice,
|
|
|
+ price: tempPrice,
|
|
|
startTime: dayjs(res.startTime).format('YYYY-MM-DD'),
|
|
|
endTime: dayjs(res.endTime).format('YYYY-MM-DD')
|
|
|
}
|