user.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. import BaseStore from '@src/stores/base';
  2. export default class UserStore extends BaseStore {
  3. locationUser(id, url) {
  4. this.token({ id })
  5. .then(token => {
  6. const w = window.open('about:blank');
  7. w.location.href = `${url}?token=${encodeURIComponent(token)}`;
  8. });
  9. }
  10. add(params) {
  11. return this.apiPost('/user/add', params);
  12. }
  13. list(params) {
  14. return this.apiGet('/user/list', params);
  15. }
  16. listStudent(params) {
  17. return this.apiGet('/user/student/list', params);
  18. }
  19. token(params) {
  20. return this.apiGet('/user/token', params);
  21. }
  22. get(params) {
  23. return this.apiGet('/user/detail', params);
  24. }
  25. addMoney(params) {
  26. return this.apiPost('/user/money/add', params);
  27. }
  28. frozen(params) {
  29. return this.apiPost('/user/frozen', params);
  30. }
  31. noFrozen(params) {
  32. return this.apiPost('/user/nofrozen', params);
  33. }
  34. real(params) {
  35. return this.apiPost('/user/real', params);
  36. }
  37. listFeedbackError(params) {
  38. return this.apiGet('/user/feedback_error/list', params);
  39. }
  40. editFeedbackError(params) {
  41. return this.apiPut('/user/feedback_error/edit', params);
  42. }
  43. getFeedbackError(params) {
  44. return this.apiGet('/user/feedback_error/detail', params);
  45. }
  46. listTextbookFeedback(params) {
  47. return this.apiGet('/user/textbook_feedback/list', params);
  48. }
  49. editTextbookFeedback(params) {
  50. return this.apiPut('/user/textbook_feedback/edit', params);
  51. }
  52. getTextbookFeedback(params) {
  53. return this.apiGet('/user/textbook_feedback/detail', params);
  54. }
  55. listReadyRoomFeedback(params) {
  56. return this.apiGet('/user/ready_room_feedback/list', params);
  57. }
  58. editReadyRoomFeedback(params) {
  59. return this.apiPut('/user/ready_room_feedback/edit', params);
  60. }
  61. getReadyRoomFeedback(params) {
  62. return this.apiGet('/user/ready_room_feedback/detail', params);
  63. }
  64. listService(params) {
  65. return this.apiGet('/user/service/list', params);
  66. }
  67. addService(params) {
  68. return this.apiPost('/user/service/add', params);
  69. }
  70. addData(params) {
  71. return this.apiPost('/user/data/add', params);
  72. }
  73. validMobile(params) {
  74. return this.apiGet('/user/valid/mobile', params);
  75. }
  76. allCourseRecord(params) {
  77. return this.apiGet('/user/course/record/all', params);
  78. }
  79. listCourseAppointment(params) {
  80. return this.apiGet('/user/course/appointment/list', params);
  81. }
  82. addCourseAppointment(params) {
  83. return this.apiPost('/user/course/appointment/add', params);
  84. }
  85. editCourseAppointment(params) {
  86. return this.apiPut('/user/course/appointment/edit', params);
  87. }
  88. getCourseAppointment(params) {
  89. return this.apiGet('/user/course/appointment/detail', params);
  90. }
  91. delCourseAppointment(params) {
  92. return this.apiDel('/user/course/appointment/delete', params);
  93. }
  94. allCourseAppointmentComment(params) {
  95. return this.apiGet('/user/course/appointment/comment/all', params);
  96. }
  97. addCourseAppointmentComment(params) {
  98. return this.apiPost('/user/course/appointment/comment/add', params);
  99. }
  100. editCourseAppointmentComment(params) {
  101. return this.apiPut('/user/course/appointment/comment/edit', params);
  102. }
  103. delCourseAppointmentComment(params) {
  104. return this.apiDel('/user/course/appointment/comment/delete', params);
  105. }
  106. listInvoice(params) {
  107. return this.apiGet('/user/invoice/list', params);
  108. }
  109. finishInvoice(params) {
  110. return this.apiPut('/user/invoice/finish', params);
  111. }
  112. downloadInvoice(params) {
  113. return this.apiPut('/user/invoice/download', params);
  114. }
  115. getOrder(params) {
  116. return this.apiGet('/user/order/detail', params);
  117. }
  118. listOrder(params) {
  119. return this.apiGet('/user/order/list', params);
  120. }
  121. finishOrder(params) {
  122. return this.apiPut('/user/order/finish', params);
  123. }
  124. stopRecord(params) {
  125. return this.apiPut('/user/record/stop', params);
  126. }
  127. listRecord(params) {
  128. return this.apiGet('/user/record/list', params);
  129. }
  130. listAbnormal(params) {
  131. return this.apiGet('/user/abnormal/list', params);
  132. }
  133. getAbnormal(params) {
  134. return this.apiGet('/user/abnormal/detail', params);
  135. }
  136. handleAbnormal(params) {
  137. return this.apiPost('/user/abnormal/handler', params);
  138. }
  139. }
  140. export const User = new UserStore({ key: 'users' });