s-goods-item.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../index.js");
  4. const sheep_hooks_useGoods = require("../../hooks/useGoods.js");
  5. require("../../url/index.js");
  6. require("../../store/index.js");
  7. require("../../store/app.js");
  8. require("../../api/promotion/diy.js");
  9. require("../../request/index.js");
  10. require("../../config/index.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("../../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. require("../../util/index.js");
  37. const _sfc_main = {
  38. __name: "s-goods-item",
  39. props: {
  40. img: {
  41. type: String,
  42. default: "https://img1.baidu.com/it/u=1601695551,235775011&fm=26&fmt=auto"
  43. },
  44. title: {
  45. type: String,
  46. default: ""
  47. },
  48. titleWidth: {
  49. type: Number,
  50. default: 0
  51. },
  52. skuText: {
  53. type: [String, Array],
  54. default: ""
  55. },
  56. price: {
  57. type: [String, Number],
  58. default: ""
  59. },
  60. priceColor: {
  61. type: [String],
  62. default: ""
  63. },
  64. num: {
  65. type: [String, Number],
  66. default: 0
  67. },
  68. score: {
  69. type: [String, Number],
  70. default: ""
  71. },
  72. radius: {
  73. type: [String],
  74. default: ""
  75. },
  76. marginBottom: {
  77. type: [String],
  78. default: ""
  79. }
  80. },
  81. setup(__props) {
  82. const props = __props;
  83. const skuString = common_vendor.computed(() => {
  84. if (!props.skuText) {
  85. return "";
  86. }
  87. if (typeof props.skuText === "object") {
  88. return props.skuText.join(",");
  89. }
  90. return props.skuText;
  91. });
  92. return (_ctx, _cache) => {
  93. return common_vendor.e({
  94. a: common_vendor.unref(sheep_index.sheep).$url.cdn(__props.img),
  95. b: __props.title
  96. }, __props.title ? {
  97. c: common_vendor.t(__props.title)
  98. } : {}, {
  99. d: common_vendor.unref(skuString)
  100. }, common_vendor.unref(skuString) ? {
  101. e: common_vendor.t(common_vendor.unref(skuString))
  102. } : {}, {
  103. f: __props.price && Number(__props.price) > 0
  104. }, __props.price && Number(__props.price) > 0 ? {
  105. g: common_vendor.t(common_vendor.unref(sheep_hooks_useGoods.fen2yuan)(__props.price)),
  106. h: common_vendor.s({
  107. color: __props.priceColor
  108. })
  109. } : {}, {
  110. i: __props.num
  111. }, __props.num ? {
  112. j: common_vendor.t(__props.num)
  113. } : {}, {
  114. k: common_vendor.s({
  115. width: __props.titleWidth ? __props.titleWidth + "rpx" : ""
  116. }),
  117. l: common_vendor.s({
  118. borderRadius: __props.radius + "rpx",
  119. marginBottom: __props.marginBottom + "rpx"
  120. })
  121. });
  122. };
  123. }
  124. };
  125. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-8a2df41e"], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/components/s-goods-item/s-goods-item.vue"]]);
  126. wx.createComponent(Component);