s-live-block.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../index.js");
  4. require("../../api/index.js");
  5. require("../../api/distri/score.js");
  6. require("../../request/index.js");
  7. require("../../config/index.js");
  8. require("../../store/index.js");
  9. require("../../store/app.js");
  10. require("../../api/promotion/diy.js");
  11. require("../../platform/index.js");
  12. require("../../platform/provider/wechat/index.js");
  13. require("../../platform/provider/wechat/miniProgram.js");
  14. require("../../api/member/auth.js");
  15. require("../../api/member/social.js");
  16. require("../../api/member/user.js");
  17. require("../../platform/provider/apple/index.js");
  18. require("../../platform/share.js");
  19. require("../../router/index.js");
  20. require("../../hooks/useModal.js");
  21. require("../../helper/index.js");
  22. require("../../helper/test.js");
  23. require("../../helper/digit.js");
  24. require("../../api/member/signin.js");
  25. require("../../helper/throttle.js");
  26. require("../../url/index.js");
  27. require("../../platform/pay.js");
  28. require("../../api/pay/order.js");
  29. require("../../store/user.js");
  30. require("../../store/cart.js");
  31. require("../../api/trade/cart.js");
  32. require("../../api/pay/wallet.js");
  33. require("../../api/trade/order.js");
  34. require("../../api/promotion/coupon.js");
  35. require("../../store/sys.js");
  36. require("../../store/modal.js");
  37. require("../../api/distri/share.js");
  38. require("../../api/distri/team.js");
  39. require("../../api/infra/file.js");
  40. require("../../api/member/address.js");
  41. require("../../api/member/point.js");
  42. require("../../api/migration/app.js");
  43. require("../../api/migration/chat.js");
  44. require("../../api/migration/index.js");
  45. require("../../api/migration/third.js");
  46. require("../../api/pay/channel.js");
  47. require("../../api/product/category.js");
  48. require("../../api/product/comment.js");
  49. require("../../api/product/favorite.js");
  50. require("../../api/product/history.js");
  51. require("../../api/product/spu.js");
  52. require("../../api/promotion/activity.js");
  53. require("../../api/promotion/article.js");
  54. require("../../api/promotion/bargain.js");
  55. require("../../api/promotion/combination.js");
  56. require("../../api/promotion/rewardActivity.js");
  57. require("../../api/promotion/seckill.js");
  58. require("../../api/system/area.js");
  59. require("../../api/system/voice.js");
  60. require("../../api/trade/afterSale.js");
  61. require("../../api/trade/brokerage.js");
  62. require("../../api/trade/config.js");
  63. require("../../api/trade/delivery.js");
  64. require("../../config/zIndex.js");
  65. if (!Array) {
  66. const _easycom_s_live_card2 = common_vendor.resolveComponent("s-live-card");
  67. _easycom_s_live_card2();
  68. }
  69. const _easycom_s_live_card = () => "../s-live-card/s-live-card.js";
  70. if (!Math) {
  71. _easycom_s_live_card();
  72. }
  73. const _sfc_main = {
  74. __name: "s-live-block",
  75. props: {
  76. data: {
  77. type: Object,
  78. default() {
  79. }
  80. },
  81. styles: {
  82. type: Object,
  83. default() {
  84. }
  85. }
  86. },
  87. setup(__props) {
  88. const state = common_vendor.reactive({
  89. liveList: [],
  90. mpLink: ""
  91. });
  92. const props = __props;
  93. const { mode, goodsFields, mpliveIds } = props.data ?? {};
  94. props.styles ?? {};
  95. async function getLiveListByIds(ids) {
  96. const { data } = await sheep_index.sheep.$api.app.mplive.getRoomList(ids);
  97. return data;
  98. }
  99. function goRoom(id) {
  100. common_vendor.index.navigateTo({
  101. url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}`
  102. });
  103. }
  104. common_vendor.onMounted(async () => {
  105. state.liveList = await getLiveListByIds(mpliveIds);
  106. });
  107. return (_ctx, _cache) => {
  108. return common_vendor.e({
  109. a: common_vendor.unref(mode) === 2 && state.liveList.length
  110. }, common_vendor.unref(mode) === 2 && state.liveList.length ? {
  111. b: common_vendor.f(state.liveList, (item, k0, i0) => {
  112. var _a, _b;
  113. return {
  114. a: common_vendor.o(($event) => goRoom(item.roomid), item.id),
  115. b: "74052372-0-" + i0,
  116. c: common_vendor.p({
  117. size: "md",
  118. goodsFields: common_vendor.unref(goodsFields),
  119. data: item,
  120. titleColor: (_a = common_vendor.unref(goodsFields).name) == null ? void 0 : _a.color,
  121. subTitleColor: (_b = common_vendor.unref(goodsFields).anchor_name) == null ? void 0 : _b.color,
  122. topRadius: __props.data.borderRadiusTop,
  123. bottomRadius: __props.data.borderRadiusBottom
  124. }),
  125. d: item.id
  126. };
  127. }),
  128. c: common_vendor.s({
  129. padding: __props.data.space + "rpx"
  130. }),
  131. d: common_vendor.s({
  132. margin: "-" + __props.data.space + "rpx"
  133. })
  134. } : {}, {
  135. e: common_vendor.unref(mode) === 1 && state.liveList.length
  136. }, common_vendor.unref(mode) === 1 && state.liveList.length ? {
  137. f: common_vendor.f(state.liveList, (item, k0, i0) => {
  138. var _a;
  139. return {
  140. a: common_vendor.o(($event) => goRoom(item.roomid), item.id),
  141. b: "74052372-1-" + i0,
  142. c: common_vendor.p({
  143. size: "sl",
  144. goodsFields: common_vendor.unref(goodsFields),
  145. data: item,
  146. titleColor: (_a = common_vendor.unref(goodsFields).name) == null ? void 0 : _a.color,
  147. subTitleColor: common_vendor.unref(goodsFields).anchor_name.color,
  148. topRadius: __props.data.borderRadiusTop,
  149. bottomRadius: __props.data.borderRadiusBottom
  150. }),
  151. d: item.id
  152. };
  153. }),
  154. g: common_vendor.s({
  155. marginBottom: __props.data.space + "px"
  156. })
  157. } : {});
  158. };
  159. }
  160. };
  161. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-74052372"], ["__file", "D:/zx/mall-front-app/sheep/components/s-live-block/s-live-block.vue"]]);
  162. wx.createComponent(Component);