Browse Source

feat(course): 教练课程列表增加日历打点功能

- 在 common.js 中添加 getMonthDate 方法,用于获取课表日历打点信息
- 在课程列表页面中集成该方法,实现日历打点数据的动态加载- 替换原有的静态打点数据,改为根据当前月份动态获取打点信息
master
liutong 12 months ago
parent
commit
79fcae4b39
  1. 9
      api/common.js
  2. 43
      pages/coach/course/list.vue

9
api/common.js

@ -41,6 +41,15 @@ export default {
}) })
}, },
//获取课表日历打点信息
getMonthDate(data) {
let url = `/member/get_month_date`
return http.get(url,data).then(res => {
return res;
})
},
} }

43
pages/coach/course/list.vue

@ -211,6 +211,7 @@
<script> <script>
// import user from '@/api/user.js'; // import user from '@/api/user.js';
import commonApi from '@/api/common.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
@ -341,18 +342,38 @@ export default {
console.log([this.startDate,this.endDate]) console.log([this.startDate,this.endDate])
}, },
// //
setCalendarSelected(){ async setCalendarSelected(){
this.calendarSelected = [ //
{ let month = new Date().getMonth() + 1;
date: '2025-04-07',
}, let res = await commonApi.getMonthDate({month:month})
{ if (res.code != 1){
date: '2025-04-08', //
}, uni.showToast({
{ title: res.msg,
date: '2025-04-09', icon: 'none',
duration: 2000
})
return
} }
] this.calendarSelected = []
res.data.forEach((v,k)=>{
this.calendarSelected.push({
date: v.date,
})
})
// this.calendarSelected = [
// {
// date: '2025-04-07',
// },
// {
// date: '2025-04-08',
// },
// {
// date: '2025-04-09',
// }
// ]
}, },
// //
changeCalendar(e){ changeCalendar(e){

Loading…
Cancel
Save