course.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import BaseStore from '@src/stores/base';
  2. export default class CourseStore extends BaseStore {
  3. /**
  4. * 所有vs课程
  5. */
  6. allVs() {
  7. return this.apiGet('/course/vs');
  8. }
  9. listVideo(params) {
  10. return this.apiGet('/course/video/list', params);
  11. }
  12. get(courseId) {
  13. return this.apiGet('/course/simple', { courseId });
  14. }
  15. detail(courseId) {
  16. return this.apiGet('/course/detail', { courseId });
  17. }
  18. listAsk({ keyword, courseId, courseNoId, position, order, direction }) {
  19. return this.apiGet('/course/ask/list', { keyword, courseId, courseNoId, position, order, direction });
  20. }
  21. askView(id) {
  22. return this.apiPost('/course/ask/view', { id });
  23. }
  24. noProgress(courseId, courseNoId, progress, time, currentCourseNoId) {
  25. return this.apiPut('/course/no/progress', { courseId, courseNoId, progress, time, currentCourseNoId });
  26. }
  27. trailView(id) {
  28. return this.apiPost('/course/trail/view', { id });
  29. }
  30. listPackage(params) {
  31. return this.apiGet('/course/package/list', params);
  32. }
  33. getPackage(packageId) {
  34. return this.apiGet('/course/package/detail', { packageId });
  35. }
  36. listData(params) {
  37. return this.apiGet('/course/data/list', params);
  38. }
  39. getData(dataId) {
  40. return this.apiGet('/course/data/detail', { dataId });
  41. }
  42. dataView(id) {
  43. return this.apiPost('/course/data/view', { id });
  44. }
  45. historyData({ page, size, dataId }) {
  46. return this.apiGet('/course/data/history', { page, size, dataId });
  47. }
  48. allTeacher(courseId) {
  49. return this.apiGet('/course/teacher/all', { courseId });
  50. }
  51. listExperience({ page, size, perpareStatus, experienceDay, experienceScore, experiencePercent, order, direction }) {
  52. return this.apiGet('/course/experience/list', { page, size, perpareStatus, experienceDay, experienceScore, experiencePercent, order, direction });
  53. }
  54. getExperience(experienceId) {
  55. return this.apiGet('/course/experience/detail', { experienceId });
  56. }
  57. experienceView(id) {
  58. return this.apiPost('/course/experience/view', { id });
  59. }
  60. /**
  61. * 获取课程进度
  62. */
  63. progress(courseModule, structId, courseId) {
  64. return this.apiGet('/course/progress', { courseModule, structId, courseId });
  65. }
  66. /**
  67. * 课程记录信息
  68. * @param {*} recordId
  69. */
  70. record(recordId) {
  71. return this.apiGet('/course/record', { recordId });
  72. }
  73. /**
  74. * 获取预习作业列表
  75. * @param {*} param0
  76. */
  77. listPreview({ page, size, recordId, finish, endTime }) {
  78. return this.apiGet('/course/preview/list', { page, size, recordId, endTime, times: finish });
  79. }
  80. }
  81. export const Course = new CourseStore({ key: 'course' });