s-live-card.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../index.js");
  4. require("../../url/index.js");
  5. require("../../store/index.js");
  6. require("../../store/app.js");
  7. require("../../api/promotion/diy.js");
  8. require("../../request/index.js");
  9. require("../../config/index.js");
  10. require("../../platform/index.js");
  11. require("../../platform/provider/wechat/index.js");
  12. require("../../platform/provider/wechat/miniProgram.js");
  13. require("../../api/member/auth.js");
  14. require("../../api/member/social.js");
  15. require("../../api/member/user.js");
  16. require("../../platform/provider/apple/index.js");
  17. require("../../platform/share.js");
  18. require("../../router/index.js");
  19. require("../../hooks/useModal.js");
  20. require("../../helper/index.js");
  21. require("../../helper/test.js");
  22. require("../../helper/digit.js");
  23. require("../../helper/throttle.js");
  24. require("../../platform/pay.js");
  25. require("../../api/pay/order.js");
  26. require("../../store/user.js");
  27. require("../../store/cart.js");
  28. require("../../api/trade/cart.js");
  29. require("../../api/pay/wallet.js");
  30. require("../../api/trade/order.js");
  31. require("../../api/promotion/coupon.js");
  32. require("../../store/sys.js");
  33. require("../../store/modal.js");
  34. require("../../config/zIndex.js");
  35. const _sfc_main = {
  36. __name: "s-live-card",
  37. props: {
  38. goodsFields: {
  39. type: [Array, Object],
  40. default() {
  41. return {};
  42. }
  43. },
  44. tagStyle: {
  45. type: Object,
  46. default: {}
  47. },
  48. data: {
  49. type: Object,
  50. default: {}
  51. },
  52. size: {
  53. type: String,
  54. default: "sl"
  55. },
  56. background: {
  57. type: String,
  58. default: ""
  59. },
  60. topRadius: {
  61. type: Number,
  62. default: 0
  63. },
  64. bottomRadius: {
  65. type: Number,
  66. default: 0
  67. },
  68. titleColor: {
  69. type: String,
  70. default: "#333"
  71. },
  72. subTitleColor: {
  73. type: String,
  74. default: "#999999"
  75. }
  76. },
  77. emits: ["click", "getHeight"],
  78. setup(__props, { emit: emits }) {
  79. const props = __props;
  80. const elStyles = common_vendor.computed(() => {
  81. return {
  82. background: props.background,
  83. "border-top-left-radius": props.topRadius + "px",
  84. "border-top-right-radius": props.topRadius + "px",
  85. "border-bottom-left-radius": props.bottomRadius + "px",
  86. "border-bottom-right-radius": props.bottomRadius + "px"
  87. };
  88. });
  89. const state = common_vendor.reactive({
  90. liveStatus: {
  91. 101: {
  92. img: sheep_index.sheep.$url.static("/static/img/shop/app/mplive/living.png"),
  93. title: "直播中"
  94. },
  95. 102: {
  96. img: sheep_index.sheep.$url.static("/static/img/shop/app/mplive/start.png"),
  97. title: "未开始"
  98. },
  99. 103: {
  100. img: sheep_index.sheep.$url.static("/static/img/shop/app/mplive/ended.png"),
  101. title: "已结束"
  102. }
  103. }
  104. });
  105. const onClick = () => {
  106. emits("click");
  107. };
  108. return (_ctx, _cache) => {
  109. return common_vendor.e({
  110. a: __props.size === "md"
  111. }, __props.size === "md" ? {
  112. b: state.liveStatus[__props.data.status].img,
  113. c: common_vendor.t(state.liveStatus[__props.data.status].title),
  114. d: common_vendor.unref(sheep_index.sheep).$url.cdn(__props.data.feeds_img),
  115. e: common_vendor.t(__props.data.name),
  116. f: common_vendor.s({
  117. color: __props.titleColor
  118. }),
  119. g: common_vendor.t(__props.data.anchor_name),
  120. h: common_vendor.s({
  121. color: __props.subTitleColor
  122. }),
  123. i: common_vendor.s(common_vendor.unref(elStyles)),
  124. j: common_vendor.o(onClick)
  125. } : {}, {
  126. k: __props.size === "sl"
  127. }, __props.size === "sl" ? {
  128. l: state.liveStatus[__props.data.status].img,
  129. m: common_vendor.t(state.liveStatus[__props.data.status].title),
  130. n: common_vendor.unref(sheep_index.sheep).$url.cdn(__props.data.feeds_img),
  131. o: common_vendor.t(__props.data.name),
  132. p: common_vendor.s({
  133. color: __props.titleColor
  134. }),
  135. q: common_vendor.t(__props.data.anchor_name),
  136. r: common_vendor.s({
  137. color: __props.subTitleColor
  138. }),
  139. s: common_vendor.s(common_vendor.unref(elStyles)),
  140. t: common_vendor.o(onClick)
  141. } : {});
  142. };
  143. }
  144. };
  145. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e059c327"], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/components/s-live-card/s-live-card.vue"]]);
  146. wx.createComponent(Component);