order.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import request from '../utils/request.js'
  2. class order extends request {
  3. static async getOrderList(page = 1, pageSize = 10, orderStatus, writeOffStatus) {
  4. const res = await this.getRequest(`${this.BASE_URL}Order/index?page=${page}&pageSize=${pageSize}&orderStatus=${orderStatus}&writeOffStatus=${writeOffStatus}`)
  5. return res.data
  6. }
  7. static async getDiscussOffOrderList(page = 1, pageSize = 10, orderStatus, writeOffStatus) {
  8. const res = await this.getRequest(`${this.BASE_URL}Order/index?page=${page}&pageSize=${pageSize}&orderStatus=${orderStatus}&writeOffStatus=${writeOffStatus}&discussStatus=1`)
  9. return res.data
  10. }
  11. static async getAllOrderList(page = 1, pageSize = 10) {
  12. const res = await this.getRequest(`${this.BASE_URL}Order/index?page=${page}&pageSize=${pageSize}`)
  13. return res.data
  14. }
  15. static async getOrderById(id) {
  16. const res = await this.getRequest(`${this.BASE_URL}Order/read?id=${id}`)
  17. return res.data
  18. }
  19. static async payOrderAgain(data) {
  20. const res = await this.postRequest(`${this.BASE_URL}Order/payOrderAgain`,data)
  21. return res.data
  22. }
  23. static async refreshCode(data) {
  24. const res = await this.postRequest(`${this.BASE_URL}Order/changeCode`,data)
  25. return res.data
  26. }
  27. static async createOrder(data) {
  28. const res = await this.postRequest(`${this.BASE_URL}Order/createOrder`,data)
  29. return res.data
  30. }
  31. static async deleteOrder(id) {
  32. const res = await this.postRequest(`${this.BASE_URL}Order/deleteOrder?orderId=${id}`)
  33. return res.data
  34. }
  35. static async closeOrder(id) {
  36. const res = await this.postRequest(`${this.BASE_URL}Order/closeOrder?orderId=${id}`)
  37. return res
  38. }
  39. }
  40. export default order