live.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import Request from '@/common/request.js';
  2. let request = new Request().http
  3. const api = {
  4. liveDataLike: (liveId) => `/app/live/liveData/like/${liveId}`, // 点赞
  5. collectStore:(sotreId)=> `/app/live/liveData/collectStore?storeId=${sotreId}`, // 店铺收藏/取消收藏
  6. collectGoods:(goodId)=> `/app/live/liveData/collectGoods?goodId=${goodId}`, // 商品收藏/取消收藏
  7. store:(storeld,key)=> `/app/live/store/${storeld}?key=${key}`, // 小黄车查询店铺
  8. queryStore:(storeld,pageSize,pageNum,keywords)=> `/app/live/store?storeId=${storeld}&pageSize=${pageSize}&pageNum=${pageNum}&keywords=${keywords}`, // 查询店铺
  9. follow: (liveId) => `/app/live/liveData/follow/${liveId}`, // 关注/取消关注
  10. // getRecentLiveViewers: (liveId) => `/app/live/liveData/getRecentLiveViewers/${liveId}`, // 获取直播间用户(展示在线用户)
  11. watchUserList: (liveId,pageSize,pageNum,reasonable) => `/app/live/liveWatchUser/watchUserList/?liveId=${liveId}&pageSize=${pageSize}&pageNum=${pageNum}&reasonable=${reasonable}`, // 获取直播间用户(展示在线用户)
  12. liveMsg: (liveId,pageSize,pageNum) => `/app/live/liveMsg/list/?liveId=${liveId}&pageSize=${pageSize}&pageNum=${pageNum}`, //获取最近聊天记录
  13. // checkSms: 'api/sms/checkSms',
  14. getLiveInfo: (liveId) => `/app/live/${liveId}`, // 获取直播间信息接口
  15. getLiveViewData: (liveId) => `/app/live/liveData/getLiveViewData/${liveId}`, // 直播间点赞、关注、在线人数数据
  16. liveRed:'/app/live/liveRed/claim', // 点击领红包
  17. // 直播订单
  18. liveStore: (liveId,key) => `/app/live/liveGoods/liveStore/${liveId}?key=${key}`, // 店铺展示
  19. liveGoodsDetail: (productId) => `/app/live/liveGoods/liveGoodsDetail/${productId}`, // 商品详情
  20. liveOrderUser: (liveId) => `/app/live/liveOrder/liveOrderUser/${liveId}`, // 正在购买
  21. }
  22. // 点赞
  23. export function liveDataLike(liveId, data = {}) {
  24. return request(api.liveDataLike(liveId), data, 'GET', 'application/json;charset=UTF-8')
  25. }
  26. // 店铺收藏/取消收藏
  27. export function collectStore(sotreId,data= {}) {
  28. return request(api.collectStore(sotreId),data,'POST', 'application/json;charset=UTF-8')
  29. }
  30. // 商品收藏/取消收藏
  31. export function collectGoods(goodId,data= {}) {
  32. return request(api.collectGoods(goodId), data, 'POST', 'application/json;charset=UTF-8')
  33. }
  34. // 小黄车查询店铺
  35. export function store(storeld,key,data= {}) {
  36. return request(api.store(storeld,key), data, 'GET', 'application/json;charset=UTF-8')
  37. }
  38. // 查询店铺
  39. export function queryStore(storeld,pageSize,pageNum,keywords,data= {}) {
  40. return request(api.queryStore(storeld,pageSize,pageNum,keywords), data, 'GET', 'application/json;charset=UTF-8')
  41. }
  42. // 分享(还没有)
  43. // export function userLoginH5(data) {
  44. // return request.get(api.userLoginH5, data)
  45. // }
  46. // 点击领红包
  47. export function liveRed (data) {
  48. return request(api.liveRed, data, 'POST', 'application/json;charset=UTF-8')
  49. }
  50. // 关注/取消关注
  51. export function follow(liveId, data = {}) {
  52. return request(api.follow(liveId), data, 'GET', 'application/json;charset=UTF-8')
  53. }
  54. // 返回(还没有)
  55. // export function userLoginH5(data) {
  56. // return request.get(api.userLoginH5, data)
  57. // }
  58. // 观众
  59. // 获取直播间用户(展示在线用户)
  60. // export function getRecentLiveViewers(liveId, data = {}) {
  61. // return request(api.getRecentLiveViewers(liveId), data, 'GET', 'application/json;charset=UTF-8')
  62. // }
  63. // 获取直播间用户(展示在线用户)
  64. export function watchUserList(liveId,pageSize,pageNum,reasonable, data = {}) {
  65. return request(api.watchUserList(liveId,pageSize,pageNum,reasonable), data, 'GET', 'application/json;charset=UTF-8')
  66. }
  67. // 获取最近聊天记录
  68. export function liveMsg(liveId,pageSize,pageNum, data = {}) {
  69. return request(api.liveMsg(liveId,pageSize,pageNum), data, 'GET', 'application/json;charset=UTF-8')
  70. }
  71. // 小黄车
  72. // 店铺展示
  73. export function liveStore(liveId,key, data) {
  74. return request(api.liveStore(liveId,key), data, 'GET', 'application/json;charset=UTF-8')
  75. }
  76. // 商品详情
  77. export function liveGoodsDetail(productId, data) {
  78. return request(api.liveGoodsDetail(productId), data, 'GET', 'application/json;charset=UTF-8')
  79. }
  80. //正在购买
  81. export function liveOrderUser(liveId, data = {}) {
  82. return request(api.liveOrderUser(liveId), data, 'GET', 'application/json;charset=UTF-8')
  83. }
  84. // 直播间
  85. export function getLiveInfo(liveId, data = {}) {
  86. return request(api.getLiveInfo(liveId), data, 'GET', 'application/json;charset=UTF-8')
  87. }
  88. // 直播间点赞、关注、在线人数数据
  89. export function getLiveViewData(liveId, data = {}) {
  90. return request(api.getLiveViewData(liveId), data, 'GET', 'application/json;charset=UTF-8')
  91. }