webVideo.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. import request from '@/utils/request'
  2. // 视频课程相关接口
  3. // IE 视频
  4. export function ieVideoSubjects(query) {
  5. return request({
  6. url: '/front/videoCourse/subjects',
  7. method: 'get',
  8. params: query
  9. })
  10. }
  11. export function ieVideoKnowledge(query) {
  12. return request({
  13. url: '/front/videoCourse/knowledges',
  14. method: 'get',
  15. params: query
  16. })
  17. }
  18. // 查询视频大类
  19. export function videoType() {
  20. return request({
  21. url: '/front/videoCourse/subjects',
  22. method: 'get',
  23. })
  24. }
  25. // 查询科目
  26. export function videoSubjects(query) {
  27. return request({
  28. url: '/front/videoCourse/courses',
  29. method: 'get',
  30. params: query
  31. })
  32. }
  33. // 查询年级
  34. export function videoGrades(query) {
  35. return request({
  36. url: '/front/videoCourse/grades',
  37. method: 'get',
  38. params: query
  39. })
  40. }
  41. // 查询版本
  42. export function videoVersions(query) {
  43. return request({
  44. url: '/front/videoCourse/versions',
  45. method: 'get',
  46. params: query
  47. })
  48. }
  49. // 视频包列表
  50. export function packList(query) {
  51. return request({
  52. url: '/front/videoCourse/pack/list',
  53. method: 'get',
  54. params: query
  55. })
  56. }
  57. // 视频列表
  58. export function videoList(query) {
  59. return request({
  60. url: '/front/videoCourse/video/list',
  61. method: 'get',
  62. params: query
  63. })
  64. }
  65. // 章节树
  66. export function getChapterTreeList(query) {
  67. return request({
  68. url: '/common/chapter/getChapterTreeList',
  69. method: 'get',
  70. params: query
  71. })
  72. }
  73. // 视频详情
  74. export function videoInfo(query) {
  75. return request({
  76. url: '/front/videoCourse/video/info/tree',
  77. method: 'get',
  78. params: query
  79. })
  80. }
  81. // 视频详情 7.1
  82. export function videoInfoTree(query) {
  83. return request({
  84. url: '/front/videoCourse/video/info/tree',
  85. method: 'get',
  86. params: query
  87. })
  88. }
  89. // 获取视频播放信息
  90. export function getVideoPlayInfo(query) {
  91. return request({
  92. url: '/common/vod/getVideoPlayInfo',
  93. method: 'get',
  94. params: query
  95. })
  96. }
  97. // 视频点播
  98. export function getVideoPlayAuth(query) {
  99. return request({
  100. url: '/common/vod/getVideoPlayAuth',
  101. method: 'get',
  102. params: query
  103. })
  104. }
  105. // /prod-api/front/videoCourse/listForHomepageLogined
  106. // 08.2 首页视频列表(已登陆时)
  107. export function listForHomepageLogined() {
  108. return request({
  109. url: '/front/videoCourse/listForHomepageLogined',
  110. method: 'get',
  111. params: {
  112. pageNum: 1,
  113. pageSize: 4
  114. }
  115. })
  116. }
  117. // /prod-api/front/videoCourse/saveWatchRecord
  118. export function saveWatchRecord(sectionId, duration, percent, aliType) {
  119. if (aliType == 'undefined' || typeof aliType == 'undefined') aliType = '' // 容错处理
  120. return request({
  121. url: '/front/videoCourse/saveWatchRecord',
  122. method: 'post',
  123. params: {
  124. sectionId,
  125. duration: Math.floor(duration),
  126. percent: percent.toFixed(3),
  127. type: aliType
  128. },
  129. custom: {toast: false} // 保持静默行为,出错时无需让用户知道
  130. })
  131. }
  132. // 老师收藏视频
  133. export function collectVideoCourse(params) {
  134. return request({
  135. url: '/front/videoCourse/video/collectVideoCourse',
  136. method: 'post',
  137. params
  138. })
  139. }