agent-requests.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import { httpDelete, httpGet, httpPost, httpPut } from '../../utils/http'
  2. import {
  3. PointsOrder,
  4. ResPageData,
  5. Todo,
  6. Agent,
  7. Designer,
  8. AgentTask,
  9. ReportInfo,
  10. FollowUp,
  11. } from '@designer-hub/app/src/core/libs/models'
  12. /**
  13. * 通过ID获取用户信息
  14. */
  15. export const getUserInfoById = (id) =>
  16. httpGet<
  17. Partial<{
  18. mobile: string
  19. status: string
  20. nickname: string
  21. avatar: string
  22. name: string
  23. sex: string
  24. areaId: number
  25. areaName: string
  26. birthday: string
  27. mark: string
  28. tagIds: string
  29. levelId: number
  30. groupId: number
  31. id: number
  32. registerIp: string
  33. loginIp: string
  34. loginDate: string
  35. createTime: string
  36. point: number
  37. totalPoint: number
  38. tagNames: string
  39. levelName: string
  40. groupName: string
  41. experience: number
  42. }>
  43. >('/app-api/member/user/getByUserId', { id })
  44. /**
  45. * 获取设计师信息
  46. */
  47. // export const getDesignerInfo = (userId: number) =>
  48. // httpGet<Designer>('/app-api/member/designer/getDesignerInfo', { userId })
  49. /**
  50. * 获取设计师基本信息
  51. */
  52. export const getStylistBasicInfo = (userId: number) =>
  53. httpGet<Designer>('/app-api/member/stylist-basic-info/get', { userId })
  54. /**
  55. * 设计师列表
  56. */
  57. export const getDesigners = (query = {}) =>
  58. httpGet<ResPageData<Designer>>('/app-api/member/app-broker/pageStylist', query)
  59. /**
  60. * 任务列表
  61. */
  62. export const getTasks = (query = {}) =>
  63. httpGet<ResPageData<AgentTask>>('/app-api/member/task/page', query)
  64. /**
  65. * 关系报备
  66. */
  67. export const getReportInfoPage = (query = {}) =>
  68. httpGet<ResPageData<ReportInfo>>('/app-api/member/report-info/page', query)
  69. /**
  70. * 删除关系报备
  71. */
  72. export const deleteReportInfo = (id: number) =>
  73. httpDelete(`/app-api/member/report-info/delete`, { id })
  74. /**
  75. * 创建设计师跟进
  76. */
  77. export const createFollowUp = (data: Partial<FollowUp>) =>
  78. httpPost('/app-api/member/stylist-follow-up/create', data)
  79. /**
  80. * 获取设计师跟进列表
  81. */
  82. export const getFollowUpPage = (query = {}) =>
  83. httpGet<ResPageData<FollowUp & { followTypeName: string; brokerName: string }>>(
  84. '/app-api/member/stylist-follow-up/page',
  85. query,
  86. )
  87. /**
  88. * 更新设计师跟进
  89. */
  90. export const updateFollowUp = (data: Partial<FollowUp>) =>
  91. httpPut('/app-api/member/stylist-follow-up/update', data)
  92. /**
  93. * /app-api/member/user-auth-info/focus 重点跟进或取消
  94. */
  95. export const focusOrCancel = (data: { brokerId: number; userId: number }) =>
  96. httpPost('/app-api/member/user-auth-info/focus', data)