community.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import request from '@/utils/request'
  2. // 关联商品
  3. export function getCommunityGoods(params) {
  4. return request.get("community/goods", {params})
  5. }
  6. // 关联店铺
  7. export function getCommunityShop(params) {
  8. return request.get("community/shop", {params})
  9. }
  10. // 推荐话题
  11. export function getCommunityRecommendTopic() {
  12. return request.get("community/recommendTopic")
  13. }
  14. // 话题列表
  15. export function getCommunityTopicLists(params) {
  16. return request.get("community/topicLists", {params})
  17. }
  18. // 发布文章
  19. export function apiCommunityAdd(params) {
  20. return request.post("community/addArticle", params)
  21. }
  22. // 编辑文章
  23. export function apiCommunityEdit(params) {
  24. return request.post("community/editArticle", params)
  25. }
  26. // 个人中心
  27. export function getCommunityUserCenter(params) {
  28. return request.get("community_user/center", {params})
  29. }
  30. // 分类
  31. export function getCommunityCate() {
  32. return request.get("community/cate")
  33. }
  34. // 发现页文章列表
  35. export function getCommunityArticleLists(params) {
  36. return request.get("community/articleLists", {params})
  37. }
  38. // 关注/取消
  39. export function apiCommunityFollow(params) {
  40. return request.post("community/follow", params)
  41. }
  42. // 获取设置
  43. export function getCommunitySetting() {
  44. return request.get("community_user/getSetting")
  45. }
  46. // 提交设置
  47. export function apiCommunitySetSetting(params) {
  48. return request.post("community_user/setSetting", params)
  49. }
  50. // 关注页-数据
  51. export function getCommunityFollow(params) {
  52. return request.get("community/followArticle", { params })
  53. }
  54. // 个人页-作品列表
  55. export function getCommunityWorksLists(params) {
  56. return request.get("community/worksLists", { params })
  57. }
  58. // 个人页-点赞列表
  59. export function getCommunityLikeLists(params) {
  60. return request.get("community/likeLists", { params })
  61. }
  62. // 相关话题
  63. export function getCommunityTopicArticle(params) {
  64. return request.get("community/topicArticle", { params })
  65. }
  66. // 文章详情
  67. export function getCommunityDetail(params) {
  68. return request.get("community/detail", { params })
  69. }
  70. // 文章中的关联商品
  71. export function getCommunityGoodsLists(params) {
  72. return request.get("community/relationGoods", { params })
  73. }
  74. // 文章中的关联店铺
  75. export function getCommunityShopLists(params) {
  76. return request.get("community/relationShop", { params })
  77. }
  78. // 删除文章
  79. export function apiCommunityDel(params) {
  80. return request.post("community/delArticle", params)
  81. }
  82. // 添加评论
  83. export function apiCommunityCommentAdd(params) {
  84. return request.post("community_comment/add", params)
  85. }
  86. // 文章评论
  87. export function getCommunityCommentLists(params) {
  88. return request.get("community_comment/lists", { params })
  89. }
  90. // 文章子级评论
  91. export function getCommunityCommentChildLists(params) {
  92. return request.get("community_comment/commentChild", { params })
  93. }
  94. // 点赞 | 取消 | 作品点赞 | 评论点赞
  95. export function apiCommunityCommentLike(params) {
  96. return request.post("community/giveLike", params)
  97. }
  98. // 搜索记录
  99. export function getCommunitySearchHistory() {
  100. return request.get("community_search/lists")
  101. }
  102. // 清空搜索记录
  103. export function apiCommunityClearSearchHistory() {
  104. return request.post("community_search/clear")
  105. }