live.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. follow: (liveId) => `/app/live/liveData/follow/${liveId}`, // 关注/取消关注
  9. getRecentLiveViewers: (liveId) => `/app/live/liveData/getRecentLiveViewers/${liveId}`, // 获取直播间用户(展示在线用户)
  10. // checkSms: 'api/sms/checkSms',
  11. getLiveInfo: (liveId) => `/app/live/${liveId}`, // 获取直播间信息接口
  12. getLiveViewData: (liveId) => `/app/live/liveData/getLiveViewData/${liveId}`, // 直播间点赞、关注、在线人数数据
  13. liveRed:'/app/live/liveRed/claim', // 点击领红包
  14. // 直播订单
  15. liveStore: (liveId,key) => `/app/live/liveGoods/liveStore/${liveId}?key=${key}`, // 店铺展示
  16. liveGoodsDetail: (productId) => `/app/live/liveGoods/liveGoodsDetail/${productId}`, // 商品详情
  17. liveOrderUser: (liveId) => `/app/live/liveOrder/liveOrderUser/${liveId}`, // 正在购买
  18. }
  19. // 点赞
  20. export function liveDataLike(liveId, data = {}) {
  21. return request(api.liveDataLike(liveId), data, 'GET', 'application/json;charset=UTF-8')
  22. }
  23. // 店铺收藏/取消收藏
  24. export function collectStore(sotreId,data= {}) {
  25. return request(api.collectStore(sotreId),data,'POST', 'application/json;charset=UTF-8')
  26. }
  27. // 商品收藏/取消收藏
  28. export function collectGoods(goodId,data= {}) {
  29. return request(api.collectGoods(goodId), data, 'POST', 'application/json;charset=UTF-8')
  30. }
  31. // 查询店铺
  32. export function store(storeld,key,data= {}) {
  33. return request(api.store(storeld,key), data, 'GET', 'application/json;charset=UTF-8')
  34. }
  35. // 分享(还没有)
  36. // export function userLoginH5(data) {
  37. // return request.get(api.userLoginH5, data)
  38. // }
  39. // 点击领红包
  40. export function liveRed(data) {
  41. return liveRed(api.follow, data, 'POST', 'application/json;charset=UTF-8')
  42. }
  43. // 关注/取消关注
  44. export function follow(liveId, data = {}) {
  45. return request(api.follow(liveId), data, 'GET', 'application/json;charset=UTF-8')
  46. }
  47. // 返回(还没有)
  48. // export function userLoginH5(data) {
  49. // return request.get(api.userLoginH5, data)
  50. // }
  51. // 观众
  52. // 获取直播间用户(展示在线用户)
  53. export function getRecentLiveViewers(liveId, data = {}) {
  54. return request(api.getRecentLiveViewers(liveId), data, 'GET', 'application/json;charset=UTF-8')
  55. }
  56. // 小黄车
  57. // 店铺展示
  58. export function liveStore(liveId,key, data) {
  59. return request(api.liveStore(liveId,key), data, 'GET', 'application/json;charset=UTF-8')
  60. }
  61. // 商品详情
  62. export function liveGoodsDetail(productId, data) {
  63. return request(api.liveGoodsDetail(productId), data, 'GET', 'application/json;charset=UTF-8')
  64. }
  65. //正在购买
  66. export function liveOrderUser(liveId, data = {}) {
  67. return request(api.liveOrderUser(liveId), data, 'GET', 'application/json;charset=UTF-8')
  68. }
  69. // 直播间
  70. export function getLiveInfo(liveId, data = {}) {
  71. return request(api.getLiveInfo(liveId), data, 'GET', 'application/json;charset=UTF-8')
  72. }
  73. // 直播间点赞、关注、在线人数数据
  74. export function getLiveViewData(liveId, data = {}) {
  75. return request(api.getLiveViewData(liveId), data, 'GET', 'application/json;charset=UTF-8')
  76. }