|  | @@ -7,7 +7,11 @@ import dayjs from 'dayjs'
 | 
	
		
			
				|  |  |  // VIDEO: '视频课',
 | 
	
		
			
				|  |  |  // VIP: '开通会员',
 | 
	
		
			
				|  |  |  // MUSIC: '单曲点播'
 | 
	
		
			
				|  |  | -export const formatOrderDetail = async (item: any) => {
 | 
	
		
			
				|  |  | +interface IAmount {
 | 
	
		
			
				|  |  | +  couponAmount: number
 | 
	
		
			
				|  |  | +  discountPrice: number
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +export const formatOrderDetail = async (item: any, amount?: IAmount) => {
 | 
	
		
			
				|  |  |    const type = item.goodType
 | 
	
		
			
				|  |  |    let tempList: any = {}
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -35,7 +39,17 @@ export const formatOrderDetail = async (item: any) => {
 | 
	
		
			
				|  |  |            goodName: item.goodName,
 | 
	
		
			
				|  |  |            id: item.id,
 | 
	
		
			
				|  |  |            title: memberType[res.period] || '',
 | 
	
		
			
				|  |  | -          price: res.salePrice || item.actualPrice,
 | 
	
		
			
				|  |  | +          // price: res.salePrice || item.actualPrice,
 | 
	
		
			
				|  |  | +          // 判断是否有优惠金额
 | 
	
		
			
				|  |  | +          price: amount?.couponAmount
 | 
	
		
			
				|  |  | +            ? Number(
 | 
	
		
			
				|  |  | +                (
 | 
	
		
			
				|  |  | +                  res.salePrice -
 | 
	
		
			
				|  |  | +                  amount.couponAmount +
 | 
	
		
			
				|  |  | +                  amount.discountPrice
 | 
	
		
			
				|  |  | +                ).toFixed(2)
 | 
	
		
			
				|  |  | +              )
 | 
	
		
			
				|  |  | +            : res.salePrice || item.actualPrice,
 | 
	
		
			
				|  |  |            startTime: dayjs(res.startTime).format('YYYY-MM-DD'),
 | 
	
		
			
				|  |  |            endTime: dayjs(res.endTime).format('YYYY-MM-DD')
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -76,19 +90,25 @@ export const tradeOrder = (result: any, callBack?: any) => {
 | 
	
		
			
				|  |  |      orderDesc,
 | 
	
		
			
				|  |  |      orderName,
 | 
	
		
			
				|  |  |      orderType,
 | 
	
		
			
				|  |  | -    orderDetailList
 | 
	
		
			
				|  |  | +    orderDetailList,
 | 
	
		
			
				|  |  | +    couponAmount,
 | 
	
		
			
				|  |  | +    discountPrice
 | 
	
		
			
				|  |  |    } = result
 | 
	
		
			
				|  |  |    orderStatus.orderObject.orderType = orderType
 | 
	
		
			
				|  |  |    orderStatus.orderObject.orderName = orderName
 | 
	
		
			
				|  |  |    orderStatus.orderObject.orderDesc = orderDesc
 | 
	
		
			
				|  |  |    orderStatus.orderObject.orderNo = orderNo
 | 
	
		
			
				|  |  |    orderStatus.orderObject.actualPrice = actualPrice
 | 
	
		
			
				|  |  | +  orderStatus.orderObject.discountPrice = discountPrice
 | 
	
		
			
				|  |  |    orderStatus.orderObject.orderList = []
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    console.log(result)
 | 
	
		
			
				|  |  |    try {
 | 
	
		
			
				|  |  |      orderDetailList.forEach(async (item: any) => {
 | 
	
		
			
				|  |  | -      await formatOrderDetail(item)
 | 
	
		
			
				|  |  | +      await formatOrderDetail(item, {
 | 
	
		
			
				|  |  | +        couponAmount,
 | 
	
		
			
				|  |  | +        discountPrice
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |      callBack && callBack()
 | 
	
		
			
				|  |  |    } catch {
 |