order.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import request from '../utils/request.js'
  2. class order extends request {
  3. static async getOrderList(page = 1, pageSize = 10, orderStatus, writeOffStatus,foodOrder=2) {
  4. const res = await this.getRequest(`${this.BASE_URL}Order/index?page=${page}&pageSize=${pageSize}&orderStatus=${orderStatus}&pay=${writeOffStatus}&foodOrder=${foodOrder}`)
  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}&pay=${writeOffStatus}`)
  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. static async createFoodOrder(data) {
  40. const res = await this.postRequest(`${this.BASE_URL}Order/createFoodOrder`,data)
  41. return res.data
  42. }
  43. static async startServer(orderId) {
  44. const res = await this.postRequest(`${this.BASE_URL}Order/serverStart`,{orderId:orderId})
  45. return res.data
  46. }
  47. static async endServer(orderId) {
  48. const res = await this.postRequest(`${this.BASE_URL}Order/serverComplete`,{orderId:orderId})
  49. return res.data
  50. }
  51. static async payOrder(orderIdList){
  52. const res = await this.postRequest(`${this.BASE_URL}Order/xcxPay`,{orderIds:orderIdList})
  53. return res.data
  54. }
  55. static async createMasterOrder(data) {
  56. const res = await this.postRequest(`${this.BASE_URL}Order/payMasterOrder`,data)
  57. return res.data
  58. }
  59. static async couponList(data) {
  60. const res = await this.postRequest(`${this.COUPON_URL}/coupon/kd-sn-list`,data)
  61. return res.data
  62. }
  63. static async writeOffCoupon(data) {
  64. const res = await this.postRequest(`${this.COUPON_URL}/coupon/kd-coupon-writeOff`,data)
  65. return res.data
  66. }
  67. static async writeOffStaff(data) {
  68. const res = await this.postRequest(`${this.COUPON_URL}/coupon/kd-staff-auth`,data)
  69. return res.data
  70. }
  71. static async couponInfo(data) {
  72. const res = await this.postRequest(`${this.COUPON_URL}/coupon/kd-coupon-sn-info`,data)
  73. return res.data
  74. }
  75. }
  76. export default order