s-live-card.js 4.4 KB

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