Browse Source

add course api

course
郑锦全 3 years ago
parent
commit
53914a54de
  1. 25
      src/subpackage/course/js/course_api.js
  2. 4
      src/subpackage/course/js/course_server.js
  3. 29
      src/subpackage/course/pages/index/index.vue

25
src/subpackage/course/js/course_api.js

@ -3,6 +3,31 @@ import { ORIGIN } from '../../../js/api';
export const COURSE_API = {
stadiumList:`${ORIGIN}/admin/stadium/list`, // 店铺列表
courseHome:`${ORIGIN}/admin/assistant/venueCourse/home`, //课程首页
stuCourse:`${ORIGIN}/admin/assistant/venueCourse/student`, //学员课程
stuInfo:`${ORIGIN}/admin/assistant/venueCourse/studentInfo`, //学员课程 - 详情
stuWorkInfo:`${ORIGIN}/admin/assistant/venueCourse/studentWorkInfo`, //学员作业详情
arrangeStuAcCoach:`${ORIGIN}/admin/assistant/venueCourse/arrangeStudentAcCoach`, //学员课程 - 详情 - 安排上课[私教课] - 获取教练
arrangeStuAc:`${ORIGIN}/admin/assistant/venueCourse/arrangeStudentAc`, //学员课程 - 详情 - 安排上课[私教课]
subscribePri:`${ORIGIN}/admin/assistant/venueCourse/subscribePri`, //约课记录 - 私教课
subscribeBclass:`${ORIGIN}/admin/assistant/venueCourse/subscribeBclass`, //约课记录 - 大班课
subscribeInfo:`${ORIGIN}/admin/assistant/venueCourse/subscribeInfo`, //约课记录 - 详情
setBclassAc:`${ORIGIN}/admin/assistant/venueCourse/setBclassAc`, //约课记录 - 大班课提前确认上课
cancelBclassAc:`${ORIGIN}/admin/assistant/venueCourse/cancelBclassAc`, //约课记录 - 大班课取消上课
cancelStuAc:`${ORIGIN}/admin/assistant/venueCourse/cancelStudentAc`, //约课记录 - 详情 - 某个学员取消上课
bclassStus:`${ORIGIN}/admin/assistant/venueCourse/bclassStudents`, //约课记录 - 详情 - 获取大班课可添加学员
bclassStuAdd:`${ORIGIN}/admin/assistant/venueCourse/bclassStudentAdd`, //约课记录 - 详情 - 大班课添加学员
sclassManage:`${ORIGIN}/admin/assistant/venueCourse/sclass`, //班级管理
sclassInfo:`${ORIGIN}/admin/assistant/venueCourse/sclassInfo`, //班级管理 - 详情
sclassConfirm:`${ORIGIN}/admin/assistant/venueCourse/sclassConfirm`, //班级管理 - 成班课确认成班
stuCanChangeSclass:`${ORIGIN}/admin/assistant/venueCourse/studentCanChangeSclass`, //班级管理 - 学员详情 - 可换班级列表
resetStuSclass:`${ORIGIN}/admin/assistant/venueCourse/resetStudentSclass`, //班级管理 - 学员详情 - 换班
sclassStuWork:`${ORIGIN}/admin/assistant/venueCourse/sclassStudentWork`, //班级管理 - 作业完成情况
sclassTimeChange:`${ORIGIN}/admin/assistant/venueCourse/sclassTimeChange`, //班级管理 - 修改上课时间
}
export default COURSE_API;

4
src/subpackage/course/js/course_server.js

@ -1,10 +1,10 @@
import { Server } from '../../../js/server';
class DeviceServer extends Server {
class CourseServer extends Server {
constructor(props){
super(props)
}
}
export default new DeviceServer();
export default new CourseServer();

29
src/subpackage/course/pages/index/index.vue

@ -47,7 +47,7 @@
<script>
import util from '@/utils/util';
import boxServer from '../../js/course_server';
import { BOX_API } from '../../js/course_api';
import BOX_API from '../../js/course_api';
import { mapState } from 'vuex'
import store_name from '../../components/store_name/store_name';
const tabList = [
@ -82,17 +82,22 @@ export default {
components: {
'store-name': store_name
},
computed:{
...mapState([ 'brandInfo', 'storeInfo' ]),
},
data() {
return {
tabList,
}
},
async onLoad(){
// console.log("",this.brandInfo)
// this.getCourseHome();
try{
util.showLoad();
let _brandInfo = await this.$store.dispatch('getBrandInfo');
await this.$store.dispatch('getStoreList');
// this.updateAC();
// this.getCourseHome();
util.hideLoad();
}catch(err){
util.hideLoad();
@ -105,6 +110,26 @@ export default {
let _type_id = `${id1}-${id2}`
util.routeTo(`/subpackage/course/pages/manage_list/manage_list?type_id=${_type_id}`,'nT')
},
getCourseHome(){
let { brandInfo } = this
util.showLoad();
boxServer.get({
url: BOX_API.courseHome,
data: {
brand_id: brandInfo.brand.id,
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
// this.pageInfo = res
// console.log("",res)
})
.catch(util.hideLoad)
},
}
}
</script>

Loading…
Cancel
Save