index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. const { request } = require('../../../api/request')
  2. /**
  3. * 关注商户
  4. * @param id 商户ID
  5. * @returns {Promise<*>}
  6. */
  7. export const postFollowUser = (id, type) => request({
  8. url: '/api/user/follow/user',
  9. method: 'POST',
  10. data: {
  11. shop_id: id,
  12. type: type // 类型(1关注2取消关注)
  13. },
  14. showLoading: true
  15. })
  16. /**
  17. * 评论动态
  18. * @param postData
  19. * @returns {Promise<*>}
  20. */
  21. export const postAddComment = (postData) => request({
  22. url: '/api/user/track/add/comment',
  23. method: 'POST',
  24. data: {
  25. ...postData
  26. // 'track_comment': '', // 评论内容
  27. // 'track_id': '' // 动态ID
  28. },
  29. showLoading: true
  30. })
  31. /**
  32. * 动态点赞、取消点赞
  33. * @param postData
  34. * @returns {Promise<*>}
  35. */
  36. export const postGood = (postData) => request({
  37. url: '/api/user/track/good',
  38. method: 'POST',
  39. data: {
  40. ...postData
  41. // 'track_id': 1, // 动态ID
  42. // 'type': 1 // 类型(1点赞2取消点赞)
  43. },
  44. showLoading: true
  45. })
  46. /**
  47. * 删除动态
  48. * @param track_id
  49. * @returns {Promise<*>}
  50. */
  51. export const postDelComment = (track_id) => request({
  52. url: '/api/user/track/delete',
  53. method: 'POST',
  54. data: {
  55. 'track_id': track_id // 动态ID
  56. },
  57. showLoading: true
  58. })