courseDetails.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import APIConfig from './api.js';
  2. // import efunRequest from '../utils/efunRequest'
  3. import request from '../utils/request'
  4. export default class CourseDetails {
  5. // 获取课程详细信息
  6. static getCourseDetails(courseId) {
  7. // return efunRequest.getHttpRequest().url(`http://ott80testlibrary.yifangjiaoyu.cn/mobile/course/${courseId}`).get();
  8. return request(`http://ott80testlibrary.yifangjiaoyu.cn/mobile/course/${courseId}`)
  9. }
  10. // 获取评论列表
  11. static getPostsList(columnId) {
  12. console.log(columnId)
  13. // return efunRequest.getHttpRequest().url(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts`).header({
  14. // uid: ''
  15. // }).params({
  16. // columnId,
  17. // pageNo: '',
  18. // pageSize: ''
  19. // }).get();
  20. return request(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts?columnId=${columnId}`, {
  21. method: "get",
  22. })
  23. // return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts?columnId=${columnId}`,{
  24. // method:"GET",
  25. // headers:{
  26. // "Accept": "application/json",
  27. // "Content-Type": "application/json",
  28. // "uid": "c2e13090a563447c8744a8c03171d1db"
  29. // }
  30. // })
  31. // .then((response)=>response.json())
  32. }
  33. // 收藏
  34. static setFavorites(data) {
  35. return request(`http://ott80test-base.yifangjiaoyu.cn/mobile/favorites`, {
  36. method:"post",
  37. body: data,
  38. })
  39. // return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/favorites`,{
  40. // method:"POST",
  41. // headers:{
  42. // "Accept": "application/json",
  43. // "Content-Type": "application/json",
  44. // "uid": "c2e13090a563447c8744a8c03171d1db"
  45. // },
  46. // body: JSON.stringify(data),
  47. // })
  48. // .then((response)=>response.json())
  49. }
  50. // 获取是否收藏
  51. static getisFavorites(data) {
  52. return request(`http://ott80test-base.yifangjiaoyu.cn/mobile/favorites/isFavorites`, {
  53. method:"post",
  54. body: data,
  55. })
  56. // return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/favorites/isFavorites`,{
  57. // method:"POST",
  58. // headers:{
  59. // "Accept": "application/json",
  60. // "Content-Type": "application/json",
  61. // "uid": "c2e13090a563447c8744a8c03171d1db"
  62. // },
  63. // body: JSON.stringify(data),
  64. // })
  65. // .then((response)=>response.json())
  66. }
  67. // 写评论
  68. static addCommentList(data) {
  69. return request(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts`, {
  70. method:"post",
  71. body: data,
  72. })
  73. // return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts`,{
  74. // method:"POST",
  75. // headers:{
  76. // "Accept": "application/json",
  77. // "Content-Type": "application/json",
  78. // "uid": "c2e13090a563447c8744a8c03171d1db"
  79. // },
  80. // body: JSON.stringify(data),
  81. // })
  82. // .then((response)=>response.json())
  83. }
  84. // 输入回复
  85. static addReplyList(data) {
  86. return request(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts/reply`, {
  87. method:"post",
  88. body: data,
  89. })
  90. // return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts/reply`,{
  91. // method:"POST",
  92. // headers:{
  93. // "Accept": "application/json",
  94. // "Content-Type": "application/json",
  95. // "uid": "c2e13090a563447c8744a8c03171d1db"
  96. // },
  97. // body: JSON.stringify(data),
  98. // })
  99. // .then((response)=>response.json())
  100. }
  101. static playLog(data) {
  102. return request(`http://ott80test-base.yifangjiaoyu.cn/mobile/playLog`, {
  103. method:"post",
  104. body: data,
  105. })
  106. }
  107. }