playmate.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * Playmate API module
  3. */
  4. import { http } from '~/utils/request'
  5. import type {
  6. NextVOSkillOrderInfoVo,
  7. NextVOPlaymateSearchVo,
  8. OrderRefundApplyDTO,
  9. PlaymateSearchDTO,
  10. SkillOrderDetailRequest,
  11. SkillOrderInfoDetailVo,
  12. SkillOrderListDTO,
  13. } from '~/types/api'
  14. /**
  15. * 陪玩师相关接口
  16. */
  17. export const playmateApi = {
  18. /**
  19. * 搜索陪玩师 - POST /playmate/search
  20. * @param data - keyword, page (size, next)
  21. */
  22. search(data: PlaymateSearchDTO) {
  23. return http.post<NextVOPlaymateSearchVo>('/playmate/search', data)
  24. },
  25. /**
  26. * 陪玩师接单列表
  27. * 对应后端接口:POST /playmate/order/list
  28. */
  29. orderList(data: SkillOrderListDTO) {
  30. return http.post<NextVOSkillOrderInfoVo>('/playmate/order/list', data)
  31. },
  32. /**
  33. * 陪玩师查看-订单详情
  34. * 对应后端接口:POST /playmate/order/detail
  35. */
  36. orderDetail(data: SkillOrderDetailRequest) {
  37. return http.post<SkillOrderInfoDetailVo>('/playmate/order/detail', data)
  38. },
  39. /**
  40. * 陪玩师处理订单:接单/拒绝/开始服务/服务完成
  41. * 对应后端接口:POST /playmate/order/handler
  42. *
  43. * type: 1=接单,2=拒绝,3=服务(开始),4=服务完成
  44. */
  45. orderHandler(data: { orderNo: string, type: 1 | 2 | 3 | 4 }) {
  46. return http.post<Record<string, never> | object>('/playmate/order/handler', data)
  47. },
  48. /**
  49. * 陪玩师提交退款凭证
  50. * 对应后端接口:POST /playmate/submit/refundVoucher
  51. */
  52. submitRefundVoucher(data: Pick<OrderRefundApplyDTO, 'orderId' | 'reason' | 'attachments'>) {
  53. return http.post<unknown>('/playmate/submit/refundVoucher', data)
  54. },
  55. }