lex 2 năm trước cách đây
mục cha
commit
aa31ad6462
2 tập tin đã thay đổi với 33 bổ sung7 xóa
  1. 7 7
      src/student/trade/tradeOrder.ts
  2. 26 0
      src/teacher/piano-room/tradeOrder.ts

+ 7 - 7
src/student/trade/tradeOrder.ts

@@ -95,12 +95,12 @@ export const formatOrderDetail = async (item: any, amount?: IAmount) => {
             // 判断是否有优惠金额
             price: amount?.couponAmount
               ? Number(
-                  (
-                    res.salePrice -
-                    amount.couponAmount +
-                    amount.discountPrice
-                  ).toFixed(2)
-                )
+                (
+                  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')
@@ -227,7 +227,7 @@ export const getMusicActiveTrack = async (id: any) => {
 // 获取专辑详情
 export const getAlbumDetail = async (id: any) => {
   try {
-    const res = await request.post(`${apiSuffix}//music/album/detail`, {
+    const res = await request.post(`${apiSuffix}/music/album/detail`, {
       data: { id }
     })
     return res.data

+ 26 - 0
src/teacher/piano-room/tradeOrder.ts

@@ -70,6 +70,20 @@ export const formatOrderDetail = async (item: any, amount?: IAmount) => {
         }
       }
       break
+    case 'ALBUM':
+      {
+        try {
+          const res = await getAlbumDetail(item.bizId)
+          tempList = {
+            orderType: item.goodType,
+            goodName: item.goodName,
+            ...res
+          }
+        } catch (e: any) {
+          throw new Error(e.message)
+        }
+      }
+      break
   }
   tempList.orderType = type
   tempList.goodName = item.goodName
@@ -106,6 +120,18 @@ export const getMusicDetail = async (id: any) => {
   }
 }
 
+// 获取专辑详情
+export const getAlbumDetail = async (id: any) => {
+  try {
+    const res = await request.post(`/api-teacher/music/album/detail`, {
+      data: { id }
+    })
+    return res.data
+  } catch {
+    throw new Error('获取专辑详情失败')
+  }
+}
+
 export const tradeOrder = (result: any, callBack?: any) => {
   const {
     orderNo,