memberInstantMessage.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { requestApi } from '../util/network'
  2. // 获取用户订单列表
  3. export const addInstantMessage =
  4. (data) =>
  5. requestApi(
  6. '/member_instant_message/add',
  7. 'POST',
  8. data,
  9. 'member'
  10. )
  11. // 加入聊天
  12. export const joinChat =
  13. (client_id) =>
  14. requestApi(
  15. '/member_instant_message/join',
  16. 'POST',
  17. {
  18. client_id: client_id
  19. },
  20. 'member'
  21. )
  22. // 已读消息
  23. export const setMessage =
  24. (data) =>
  25. requestApi(
  26. '/member_instant_message/set_message',
  27. 'POST',
  28. data,
  29. 'member'
  30. )
  31. // 聊天历史
  32. export const getChatHistory =
  33. (params, t_id) =>
  34. requestApi(
  35. '/member_instant_message/get_chat_log',
  36. 'POST',
  37. {
  38. page: params.page,
  39. per_page: params.per_page,
  40. t_id: t_id
  41. },
  42. 'member'
  43. )
  44. // 最近消息
  45. export const getChatList =
  46. () =>
  47. requestApi(
  48. '/member_instant_message/get_user_list',
  49. 'POST',
  50. {
  51. recent: 1
  52. },
  53. 'member'
  54. )
  55. // 新消息数
  56. export const getChatCount =
  57. () =>
  58. requestApi(
  59. '/member_instant_message/get_msg_count',
  60. 'POST',
  61. {
  62. },
  63. 'member'
  64. )