living.js 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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, liveId) => `/app/live/store/${storeld}?key=${key}&liveId=${liveId}`, // 小黄车查询店铺
  8. queryStore: (storeld, pageSize, pageNum, keywords) =>
  9. `/app/live/store?storeId=${storeld}&pageSize=${pageSize}&pageNum=${pageNum}&keywords=${keywords}`, // 查询店铺
  10. follow: (liveId) => `/app/live/liveData/follow/${liveId}`, // 关注/取消关注
  11. // getRecentLiveViewers: (liveId) => `/app/live/liveData/getRecentLiveViewers/${liveId}`, // 获取直播间用户(展示在线用户)
  12. watchUserList: (liveId, pageSize, pageNum, reasonable) =>
  13. `/app/live/liveWatchUser/watchUserList/?liveId=${liveId}&pageSize=${pageSize}&pageNum=${pageNum}&reasonable=${reasonable}`, // 获取直播间用户(展示在线用户)
  14. liveMsg: (liveId, pageSize, pageNum) =>
  15. `/app/live/liveMsg/list/?liveId=${liveId}&pageSize=${pageSize}&pageNum=${pageNum}`, //获取最近聊天记录
  16. // checkSms: 'api/sms/checkSms',
  17. getLiveInfo: (liveId) => `/app/live/${liveId}`, // 获取直播间信息接口
  18. getLiveViewData: (liveId) => `/app/live/liveData/getLiveViewData/${liveId}`, // 直播间点赞、关注、在线人数数据
  19. liveRed: '/app/live/liveRed/claim', // 点击领红包
  20. // 直播订单
  21. liveStore: (liveId, key) => `/app/live/liveGoods/liveStore/${liveId}?key=${key}`, // 店铺展示
  22. liveGoodsDetail: (productId) => `/app/live/liveGoods/liveGoodsDetail/${productId}`, // 商品详情
  23. liveOrderUser: (liveId) => `/app/live/liveOrder/liveOrderUser/${liveId}`, // 正在购买
  24. showGoods: (liveId) => `/app/live/liveGoods/showGoods/${liveId}`, // 弹出商品卡片
  25. currentActivities: (liveId) => `/app/live/currentActivities?liveId=${liveId}`, // 弹出商品卡片
  26. claim: '/app/live/liveLottery/claim', // 抽奖
  27. liveLottery: '/app/live/liveLottery/detail', // 抽奖查询
  28. getlive: '/app/live/live',
  29. liveList: '/app/live/liveList', //直播列表
  30. // liveShareList: (companyId, pageSize, pageNum) =>
  31. // `/app/live/liveList/${companyId}?pageSize=${pageSize}&pageNum=${pageNum}`, //销售端分享直播列表
  32. liveShareList: ( pageSize, pageNum) =>
  33. `/app/live/liveListAll?pageSize=${pageSize}&pageNum=${pageNum}`, //销售端分享直播列表
  34. subNotifyLive: '/app/live/subNotifyLive' ,//订阅消息
  35. coupon: '/app/live/coupon/claim' ,//领取优惠券
  36. curCoupon: '/app/live/coupon/curCoupon' ,//优惠券列表
  37. // export function getGotoWxAppLiveLink(data) {
  38. // return request('/app/fs/course/getGotoWxAppLiveLink', data, 'GET', 'application/json;charset=UTF-8');
  39. // }
  40. // getGotoWxAppLiveLink: (appid, linkst) =>
  41. // `/app/fs/course/getGotoWxAppLiveLink?appid=${appid}&linkst=${linkst}`,
  42. }
  43. // 点赞
  44. export function liveDataLike(liveId, data = {}) {
  45. return request(api.liveDataLike(liveId), data, 'GET', 'application/json;charset=UTF-8')
  46. }
  47. // 店铺收藏/取消收藏
  48. export function collectStore(sotreId, data = {}) {
  49. return request(api.collectStore(sotreId), data, 'POST', 'application/json;charset=UTF-8')
  50. }
  51. // 商品收藏/取消收藏
  52. export function collectGoods(goodId, data = {}) {
  53. return request(api.collectGoods(goodId), data, 'POST', 'application/json;charset=UTF-8')
  54. }
  55. // 小黄车查询店铺
  56. export function store(storeld, key, liveId, data = {}) {
  57. return request(api.store(storeld, key, liveId), data, 'GET', 'application/json;charset=UTF-8')
  58. }
  59. // 查询店铺
  60. export function queryStore(storeld, pageSize, pageNum, keywords, data = {}) {
  61. return request(api.queryStore(storeld, pageSize, pageNum, keywords), data, 'GET', 'application/json;charset=UTF-8',
  62. false)
  63. }
  64. //弹出商品卡片
  65. export function showGoods(liveId, data = {}) {
  66. return request(api.showGoods(liveId), data, 'GET', 'application/json;charset=UTF-8')
  67. }
  68. // 点击领红包
  69. export function liveRed(data) {
  70. return request(api.liveRed, data, 'POST', 'application/json;charset=UTF-8')
  71. }
  72. // 关注/取消关注
  73. export function follow(liveId, data = {}) {
  74. return request(api.follow(liveId), data, 'GET', 'application/json;charset=UTF-8')
  75. }
  76. // 观众
  77. // 获取直播间用户(展示在线用户)
  78. // export function getRecentLiveViewers(liveId, data = {}) {
  79. // return request(api.getRecentLiveViewers(liveId), data, 'GET', 'application/json;charset=UTF-8')
  80. // }
  81. // 获取直播间用户(展示在线用户)
  82. export function watchUserList(liveId, pageSize, pageNum, reasonable, data = {}) {
  83. return request(api.watchUserList(liveId, pageSize, pageNum, reasonable), data, 'GET',
  84. 'application/json;charset=UTF-8')
  85. }
  86. // 获取最近聊天记录
  87. export function liveMsg(liveId, pageSize, pageNum, data = {}) {
  88. return request(api.liveMsg(liveId, pageSize, pageNum), data, 'GET', 'application/json;charset=UTF-8')
  89. }
  90. // 加载直播间消息接口
  91. // export function liveMsg(liveId, pageSize, pageNum, data = {}) {
  92. // return request('/app/live/liveMsg/list', data, 'GET', 'application/json;charset=UTF-8');
  93. // }
  94. // 小黄车
  95. // 店铺展示
  96. export function liveStore(liveId, key, data) {
  97. return request(api.liveStore(liveId, key), data, 'GET', 'application/json;charset=UTF-8')
  98. }
  99. // 商品详情
  100. export function liveGoodsDetail(productId, data) {
  101. return request(api.liveGoodsDetail(productId), data, 'GET', 'application/json;charset=UTF-8')
  102. }
  103. //正在购买
  104. export function liveOrderUser(liveId, data = {}) {
  105. return request(api.liveOrderUser(liveId), data, 'GET', 'application/json;charset=UTF-8')
  106. }
  107. // 直播间
  108. export function getLiveInfo(liveId, data = {}) {
  109. return request(api.getLiveInfo(liveId), data, 'GET', 'application/json;charset=UTF-8')
  110. }
  111. // 直播间点赞、关注、在线人数数据
  112. export function getLiveViewData(liveId, data = {}) {
  113. return request(api.getLiveViewData(liveId), data, 'GET', 'application/json;charset=UTF-8')
  114. }
  115. // 红包 卡片 抽奖
  116. export function currentActivities(liveId, data = {}) {
  117. return request(api.currentActivities(liveId), data, 'GET', 'application/json;charset=UTF-8')
  118. }
  119. //抽奖
  120. export function claim(data) {
  121. return request(api.claim, data, 'POST', 'application/json;charset=UTF-8')
  122. }
  123. // 抽奖查询
  124. export function liveLottery(data) {
  125. return request(api.liveLottery, data, 'POST', 'application/json;charset=UTF-8')
  126. }
  127. //直播间信息
  128. export function getlive(data) {
  129. return request(api.getlive, data, 'GET', 'application/json;charset=UTF-8');
  130. }
  131. //直播列表
  132. export function liveList(data) {
  133. return request(api.liveList, data, 'GET', 'application/json;charset=UTF-8');
  134. }
  135. //销售端分享直播列表
  136. export function liveShareList(pageSize, pageNum, data = {}) {
  137. return request(api.liveShareList( pageSize, pageNum), data, 'GET', 'application/json;charset=UTF-8');
  138. }
  139. //订阅消息
  140. export function subNotifyLive(data) {
  141. return request(api.subNotifyLive, data, 'POST', 'application/json;charset=UTF-8');
  142. }
  143. //领取优惠券
  144. export function coupon(data) {
  145. return request(api.coupon, data, 'POST', 'application/json;charset=UTF-8');
  146. }
  147. //优惠券列表
  148. export function curCoupon(data) {
  149. return request(api.curCoupon, data, 'POST', 'application/json;charset=UTF-8');
  150. }
  151. // 流量(缓冲百分比)
  152. export function internetTraffic(data) {
  153. return request('/app/live/liveTrafficLog/getInternetTraffic', data, 'POST', 'application/json;charset=UTF-8');
  154. }
  155. // 直播流量(缓冲百分比)
  156. export function liveInternetTraffic(data) {
  157. return request('/app/live/liveTrafficLog/getLiveInternetTraffic', data, 'POST', 'application/json;charset=UTF-8');
  158. }
  159. // 积分
  160. export function getUserIntegralInfo(data) {
  161. return request('/app/live/liveData/getUserIntegralInfo', data, 'GET', 'application/json;charset=UTF-8');
  162. }
  163. // 我的中奖明细
  164. export function myLottery(data) {
  165. return request('/app/live/liveLottery/myLottery', data, 'GET', 'application/json;charset=UTF-8');
  166. }
  167. // // 消息弹窗
  168. // export function sendPopMsg(liveId, pageSize, pageNum, data = {}) {
  169. // return request('/app/live/liveMsg/myList', data, 'GET', 'application/json;charset=UTF-8');
  170. // }
  171. // 电话号码登录
  172. export function login(data) {
  173. return request('/app/app/login', data, 'POST', 'application/json;charset=UTF-8');
  174. }
  175. // 分享直播间短链
  176. // export function getGotoWxAppLiveLink(appid,linkst,data={}) {
  177. // return request(api.getGotoWxAppLiveLink(appid,linkst), data, 'GET', 'application/json;charset=UTF-8');
  178. // }
  179. export function getGotoWxAppLiveLink(data) {
  180. return request('/app/fs/course/getGotoWxAppLiveLink', data, 'GET', 'application/json;charset=UTF-8');
  181. }
  182. // export function getGotoWxAppLiveLink(data) {
  183. // return request('/app/fs/course/getGotoWxAppLiveLink', data, 'GET', 'application/json;charset=UTF-8');
  184. // }
  185. export function loginByMp(data) {
  186. return request('/liveAPP/app/wx/courseLogin',data,'POST','application/json;charset=UTF-8');
  187. }
  188. export function getUserInfo() {
  189. return request('/liveAPP/app/user/getUserInfo',null,'GET');
  190. }