live.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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: "/app/live/liveData/collectStore",
  8. // 收藏/取消收藏
  9. follow: (liveId) => `/app/live/liveData/follow/${liveId}`,
  10. // 关注/取消关注
  11. getRecentLiveViewers: (liveId) => `/app/live/liveData/getRecentLiveViewers/${liveId}`,
  12. // 获取直播间用户(展示在线用户)
  13. // checkSms: 'api/sms/checkSms',
  14. getLiveInfo: (liveId) => `/app/live/${liveId}`,
  15. // 获取直播间信息接口
  16. getLiveViewData: (liveId) => `/app/live/liveData/getLiveViewData/${liveId}`,
  17. // 直播间点赞、关注、在线人数数据
  18. // 直播订单
  19. searchStore: (storeId) => `app/live/store/${storeId}`,
  20. // 查询店铺
  21. liveStore: (liveId) => `/app/live/liveGoods/liveStore/${liveId}`,
  22. // 店铺展示
  23. liveGoodsDetail: (productId) => `/app/live/liveGoods/liveGoodsDetail/${productId}`,
  24. // 商品详情
  25. liveOrderUser: (liveId) => `/app/live/liveOrder/liveOrderUser/${liveId}`
  26. // 正在购买
  27. };
  28. function liveDataLike(liveId, data = {}) {
  29. return request(api.liveDataLike(liveId), data, "GET", "application/json;charset=UTF-8");
  30. }
  31. function collectStore(data) {
  32. return request(api.collectStore, data, "GET", "application/json;charset=UTF-8");
  33. }
  34. function follow(liveId, data = {}) {
  35. return request(api.follow(liveId), data, "GET", "application/json;charset=UTF-8");
  36. }
  37. function getRecentLiveViewers(liveId, data = {}) {
  38. return request(api.getRecentLiveViewers(liveId), data, "GET", "application/json;charset=UTF-8");
  39. }
  40. function liveStore(liveId, data) {
  41. return request(api.liveStore(liveId), data, "GET", "application/json;charset=UTF-8");
  42. }
  43. function liveGoodsDetail(productId, data) {
  44. return request(api.liveGoodsDetail(productId), data, "GET", "application/json;charset=UTF-8");
  45. }
  46. function liveOrderUser(liveId, data = {}) {
  47. return request(api.liveOrderUser(liveId), data, "GET", "application/json;charset=UTF-8");
  48. }
  49. function searchStore(storeId, data = {}) {
  50. return request(api.searchStore(storeId), data, "GET", "application/json;charset=UTF-8");
  51. }
  52. function getLiveInfo(liveId, data = {}) {
  53. return request(api.getLiveInfo(liveId), data, "GET", "application/json;charset=UTF-8");
  54. }
  55. function getLiveViewData(liveId, data = {}) {
  56. return request(api.getLiveViewData(liveId), data, "GET", "application/json;charset=UTF-8");
  57. }
  58. exports.collectStore = collectStore;
  59. exports.follow = follow;
  60. exports.getLiveInfo = getLiveInfo;
  61. exports.getLiveViewData = getLiveViewData;
  62. exports.getRecentLiveViewers = getRecentLiveViewers;
  63. exports.liveDataLike = liveDataLike;
  64. exports.liveGoodsDetail = liveGoodsDetail;
  65. exports.liveOrderUser = liveOrderUser;
  66. exports.liveStore = liveStore;
  67. exports.searchStore = searchStore;