refund.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // 退款相关接口
  2. import { get, post } from '@/core/http/http-client'
  3. import { buildRestPath } from '@/core/config/api-paths'
  4. /**
  5. * 获取退款列表
  6. * page: 分页页码
  7. */
  8. export async function pullRefundList({ page = 1 } = {}) {
  9. const { data } = await post(buildRestPath('refund/refundList'), { page })
  10. return {
  11. rows: Array.isArray(data.data) ? data.data : [],
  12. currentPage: data.current_page || 1,
  13. lastPage: data.last_page || 1,
  14. total: data.total || 0
  15. }
  16. }
  17. /**
  18. * 获取退款详情
  19. * id: 退款ID
  20. */
  21. export async function pullRefundInfo({ id } = {}) {
  22. const { data } = await get(buildRestPath('refund/getRefundInfo'), { id })
  23. return data
  24. }
  25. /**
  26. * 申请退款
  27. * data: { order_id, order_type, expressType, type, reason, goods, money, images, refund_content }
  28. */
  29. export async function postRefundApply(data) {
  30. const { data: resData } = await post(buildRestPath('refund/addApply'), data)
  31. return resData
  32. }
  33. /**
  34. * 编辑退款申请
  35. * data: { id, expressType, type, reason, price, images, refund_content }
  36. */
  37. export async function postRefundEdit(data) {
  38. const { data: resData } = await post(buildRestPath('refund/editRefund'), data)
  39. return resData
  40. }
  41. /**
  42. * 关闭退款
  43. * id: 退款ID
  44. */
  45. export async function postRefundClose({ id } = {}) {
  46. const { data } = await post(buildRestPath('refund/closeRefund'), { id })
  47. return data
  48. }
  49. /**
  50. * 平台介入
  51. * id: 退款ID
  52. */
  53. export async function postRefundArbitration({ id } = {}) {
  54. const { data } = await post(buildRestPath('refund/arbitrationRefund'), { id })
  55. return data
  56. }
  57. /**
  58. * 提交退货物流
  59. * data: { id, express_no, express_name }
  60. */
  61. export async function postRefundExpress(data) {
  62. const { data: resData } = await post(buildRestPath('refund/toExpress'), data)
  63. return resData
  64. }
  65. /**
  66. * 获取退款记录
  67. * id: 退款ID
  68. */
  69. export async function pullRefundLog({ id } = {}) {
  70. const { data } = await get(buildRestPath('refund/getRefundLog'), { id })
  71. return data
  72. }