sellerInstantMessage.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { requestApi } from '../util/network'
  2. // 发送聊天
  3. export const addInstantMessage =
  4. (data) =>
  5. requestApi(
  6. '/seller_instant_message/add',
  7. 'POST',
  8. data,
  9. 'seller'
  10. )
  11. // 加入聊天
  12. export const joinChat =
  13. (client_id) =>
  14. requestApi(
  15. '/seller_instant_message/join',
  16. 'POST',
  17. {
  18. client_id: client_id
  19. },
  20. 'seller'
  21. )
  22. // 已读消息
  23. export const setMessage =
  24. (data) =>
  25. requestApi(
  26. '/seller_instant_message/set_message',
  27. 'POST',
  28. data,
  29. 'seller'
  30. )
  31. // 聊天历史
  32. export const getChatHistory =
  33. (params, t_id) =>
  34. requestApi(
  35. '/seller_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. 'seller'
  43. )
  44. // 最近消息
  45. export const getChatList =
  46. () =>
  47. requestApi(
  48. '/seller_instant_message/get_user_list',
  49. 'POST',
  50. {
  51. recent: 1
  52. },
  53. 'seller'
  54. )