1
0

sentence.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import BaseStore from '@src/stores/base';
  2. export default class SentenceStore extends BaseStore {
  3. /**
  4. * 所有长难句信息
  5. */
  6. getInfo() {
  7. return this.apiGet('/sentence/info');
  8. }
  9. /**
  10. * 激活长难句
  11. * @param {*} code
  12. */
  13. active(code) {
  14. return this.apiPut('/sentence/active', { code });
  15. }
  16. /**
  17. * 文章列表
  18. * @param {*} chapter
  19. */
  20. listArticle() {
  21. return this.apiGet('/sentence/article/list');
  22. }
  23. /**
  24. * 获取文章详情
  25. * @param {*} articleId
  26. */
  27. detailArticle(articleId) {
  28. return this.apiGet('/sentence/article/detail', { articleId });
  29. }
  30. /**
  31. * 更新长难句文章进度
  32. * @param {*} chapter
  33. * @param {*} part
  34. * @param {*} progress
  35. * @param {*} time
  36. * @param {*} currentChapter
  37. * @param {*} currentPart
  38. */
  39. updateProgress(chapter, part, progress, time, currentChapter, currentPart) {
  40. return this.apiPut('/sentence/article/progress', { chapter, part, progress, time, currentChapter, currentPart });
  41. }
  42. /**
  43. * 获取练习卷
  44. */
  45. listPaper() {
  46. return this.apiGet('/sentence/paper/list');
  47. }
  48. }
  49. export const Sentence = new SentenceStore({ key: 'sentence' });