order.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import request from '../utils/request.js'
  2. class order extends request {
  3. static cancelOrder(params) {
  4. return this.postRequest(`${this.BASE_GROUP_URL}open/order/cancel`, {
  5. orderSn: params.orderSn,
  6. mobile: params.mobile,
  7. })
  8. }
  9. /**
  10. * 获取订单列表
  11. */
  12. static getOrderList(params) {
  13. return this.postRequest(`${this.BASE_GROUP_URL}open/order/user-order-list`, {
  14. mobile: params.mobile,
  15. page: params.page || 1,
  16. pageSize: params.pageSize || 10,
  17. keyword: params.keyword || ''
  18. });
  19. }
  20. /**
  21. * 清空购物车
  22. */
  23. static emptyCart(params) {
  24. return this.postRequest(`${this.BASE_GROUP_URL}open/order/empty-cart`, {
  25. storeId: params.storeId,
  26. mobile: params.mobile,
  27. tableId: params.tableId,
  28. orderMode:params.orderMode
  29. })
  30. }
  31. /**
  32. * 订单详情
  33. */
  34. static getOrderDetail(params) {
  35. return this.postRequest(`${this.BASE_GROUP_URL}open/order/detail`, {
  36. orderSn: params.orderSn,
  37. mobile: params.mobile,
  38. })
  39. }
  40. /**
  41. * 订单退款
  42. */
  43. static refund(params) {
  44. return this.postRequest(`${this.BASE_GROUP_URL}open/order/refund`, {
  45. mobile: params.mobile,
  46. orderSn: params.orderSn,
  47. reason: params.reason,
  48. photoList:params.photoList
  49. })
  50. }
  51. }
  52. export default order