完善团课相关页面交互,完成团课列表页基础后端交互。(后端连接至服务器,版本为DEV分支版本)

This commit is contained in:
2026-06-13 17:11:36 +08:00
parent b345ceeb42
commit 96b8fd2534
16 changed files with 2760 additions and 384 deletions
@@ -301,6 +301,48 @@ const mockCourseList = [
}
]
// 模拟团课类型标签数据
const mockCourseTypeLabels = [
{
"id": "1",
"createBy": null,
"updateBy": null,
"createdAt": "2026-06-11T11:29:07.859339",
"updatedAt": "2026-06-11T11:29:07.859339",
"deletedAt": null,
"labelName": "高级进阶",
"color": "#f5222d",
"description": "适合高级学员"
},
{
"id": "2",
"createBy": null,
"updateBy": null,
"createdAt": "2026-06-11T11:29:07.859339",
"updatedAt": "2026-06-11T11:29:07.859339",
"deletedAt": null,
"labelName": "增肌强化",
"color": "#13c2c2",
"description": "有助于增肌强化"
}
]
// 团课类型与标签的关联关系
const courseTypeLabelMap = {
'1': [
{ id: '1', labelName: '高级进阶', color: '#f5222d' },
{ id: '2', labelName: '增肌强化', color: '#13c2c2' }
],
'2': [
{ id: '3', labelName: '燃脂挑战', color: '#fa8c16' },
{ id: '4', labelName: 'HIIT高强度', color: '#722ed1' }
],
'3': [
{ id: '5', labelName: '塑形美体', color: '#eb2f96' },
{ id: '6', labelName: '核心训练', color: '#52c41a' }
]
}
/**
* 模拟团课API(测试环境)
* 接口签名与真实API保持一致
@@ -401,6 +443,25 @@ export const groupCourseMockApi = {
})
}, 300)
})
},
/**
* 基于类型ID获取标签列表
* @param {string} courseType - 团课类型ID
* @returns {Promise} - 标签列表数据
*/
getLabelsByCourseType: (courseType) => {
return new Promise((resolve) => {
setTimeout(() => {
console.log('[groupCourse.mock.js] 模拟获取团课类型标签:', courseType)
const labels = courseTypeLabelMap[courseType] || []
resolve({
code: 0,
message: 'success',
data: labels
})
}, 200)
})
}
}