|
@@ -1,7 +1,8 @@
|
|
|
+import { memberType } from '@/constant'
|
|
|
import request from '@/helpers/request'
|
|
|
import { orderStatus } from '@/views/order-detail/orderStatus'
|
|
|
import dayjs from 'dayjs'
|
|
|
-// LIVE: '直播课',
|
|
|
+// LIVE: '直播课',
|
|
|
// PRACTICE: '陪练课',
|
|
|
// VIDEO: '视频课',
|
|
|
// VIP: '开通会员',
|
|
@@ -77,16 +78,15 @@ export const formatOrderDetail = async (item: any) => {
|
|
|
case 'VIP':
|
|
|
{
|
|
|
try {
|
|
|
- const res = await getVipDetail()
|
|
|
- const buyObject = res.find((member: any) => member.id === item.bizId)
|
|
|
+ const res = await getVipDetail(item.id)
|
|
|
tempList = {
|
|
|
orderType: item.goodType,
|
|
|
goodsName: item.goodName,
|
|
|
- id: buyObject.id,
|
|
|
- title: buyObject.title,
|
|
|
- price: buyObject.salePrice
|
|
|
- // startTime: dayjs(startTime).format('YYYY-MM-DD'),
|
|
|
- // endTime: dayjs(endTime).format('YYYY-MM-DD')
|
|
|
+ id: res.id,
|
|
|
+ title: memberType[res.period] || '',
|
|
|
+ price: res.salePrice,
|
|
|
+ startTime: dayjs(res.startTime).format('YYYY-MM-DD'),
|
|
|
+ endTime: dayjs(res.endTime).format('YYYY-MM-DD')
|
|
|
}
|
|
|
} catch (e: any) {
|
|
|
throw new Error(e.message)
|
|
@@ -147,14 +147,9 @@ export const getLiveDetail = async (groupId: any) => {
|
|
|
}
|
|
|
|
|
|
// 获取会员详情
|
|
|
-export const getVipDetail = async () => {
|
|
|
+export const getVipDetail = async (id: any) => {
|
|
|
try {
|
|
|
- const setting = await request.post(
|
|
|
- '/api-student/memberPriceSettings/list',
|
|
|
- {
|
|
|
- data: {}
|
|
|
- }
|
|
|
- )
|
|
|
+ const setting = await request.get('/api-student/vipCardRecord/detail/' + id)
|
|
|
return setting.data || []
|
|
|
} catch {
|
|
|
throw new Error('获取会员详情失败')
|
|
@@ -191,7 +186,6 @@ export const tradeOrder = (result: any, callBack?: any) => {
|
|
|
orderDetailList.forEach(async (item: any) => {
|
|
|
await formatOrderDetail(item)
|
|
|
})
|
|
|
- // console.log(orderStatus.orderObject, 'orderStatus.orderObject')
|
|
|
callBack && callBack()
|
|
|
} catch {
|
|
|
//
|