live.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. "use strict";
  2. const common_request = require("../common/request.js");
  3. let request = new common_request.Request().http;
  4. const api = {
  5. liveDataLike: (liveId) => `/app/live/liveData/like/${liveId}`,
  6. // 点赞
  7. collectStore: (sotreId) => `/app/live/liveData/collectStore?storeId=${sotreId}`,
  8. // 店铺收藏/取消收藏
  9. collectGoods: (goodId) => `/app/live/liveData/collectGoods?goodId=${goodId}`,
  10. // 商品收藏/取消收藏
  11. store: (storeld) => `/app/live/store/${storeld}`,
  12. // 查询店铺
  13. follow: (liveId) => `/app/live/liveData/follow/${liveId}`,
  14. // 关注/取消关注
  15. getRecentLiveViewers: (liveId) => `/app/live/liveData/getRecentLiveViewers/${liveId}`,
  16. // 获取直播间用户(展示在线用户)
  17. // checkSms: 'api/sms/checkSms',
  18. getLiveInfo: (liveId) => `/app/live/${liveId}`,
  19. // 获取直播间信息接口
  20. getLiveViewData: (liveId) => `/app/live/liveData/getLiveViewData/${liveId}`,
  21. // 直播间点赞、关注、在线人数数据
  22. // 直播订单
  23. searchStore: (storeId) => `/app/live/store/${storeId}`,
  24. // 查询店铺
  25. liveStore: (liveId) => `/app/live/liveGoods/liveStore/${liveId}`,
  26. // 店铺展示
  27. liveGoodsDetail: (productId) => `/app/live/liveGoods/liveGoodsDetail/${productId}`,
  28. // 商品详情
  29. liveOrderUser: (liveId) => `/app/live/liveOrder/liveOrderUser/${liveId}`
  30. // 正在购买
  31. };
  32. function liveDataLike(liveId, data = {}) {
  33. return request(api.liveDataLike(liveId), data, "GET", "application/json;charset=UTF-8");
  34. }
  35. function collectStore(sotreId, data = {}) {
  36. return request(api.collectStore(sotreId), data, "POST", "application/json;charset=UTF-8");
  37. }
  38. function collectGoods(goodId, data = {}) {
  39. return request(api.collectGoods(goodId), data, "POST", "application/json;charset=UTF-8");
  40. }
  41. function store(storeld, data = {}) {
  42. return request(api.store(storeld), data, "GET", "application/json;charset=UTF-8");
  43. }
  44. function follow(liveId, data = {}) {
  45. return request(api.follow(liveId), data, "GET", "application/json;charset=UTF-8");
  46. }
  47. function getRecentLiveViewers(liveId, data = {}) {
  48. return request(api.getRecentLiveViewers(liveId), data, "GET", "application/json;charset=UTF-8");
  49. }
  50. function liveStore(liveId, data) {
  51. return request(api.liveStore(liveId), data, "GET", "application/json;charset=UTF-8");
  52. }
  53. function liveGoodsDetail(productId, data) {
  54. return request(api.liveGoodsDetail(productId), data, "GET", "application/json;charset=UTF-8");
  55. }
  56. function liveOrderUser(liveId, data = {}) {
  57. return request(api.liveOrderUser(liveId), data, "GET", "application/json;charset=UTF-8");
  58. }
  59. function searchStore(storeId, data = {}) {
  60. return request(api.searchStore(storeId), data, "GET", "application/json;charset=UTF-8");
  61. }
  62. function getLiveInfo(liveId, data = {}) {
  63. return request(api.getLiveInfo(liveId), data, "GET", "application/json;charset=UTF-8");
  64. }
  65. function getLiveViewData(liveId, data = {}) {
  66. return request(api.getLiveViewData(liveId), data, "GET", "application/json;charset=UTF-8");
  67. }
  68. exports.collectGoods = collectGoods;
  69. exports.collectStore = collectStore;
  70. exports.follow = follow;
  71. exports.getLiveInfo = getLiveInfo;
  72. exports.getLiveViewData = getLiveViewData;
  73. exports.getRecentLiveViewers = getRecentLiveViewers;
  74. exports.liveDataLike = liveDataLike;
  75. exports.liveGoodsDetail = liveGoodsDetail;
  76. exports.liveOrderUser = liveOrderUser;
  77. exports.liveStore = liveStore;
  78. exports.searchStore = searchStore;
  79. exports.store = store;