s-goods-shelves.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../index.js");
  4. const sheep_api_product_spu = require("../../api/product/spu.js");
  5. require("../../api/index.js");
  6. require("../../api/distri/score.js");
  7. require("../../request/index.js");
  8. require("../../config/index.js");
  9. require("../../store/index.js");
  10. require("../../store/app.js");
  11. require("../../api/promotion/diy.js");
  12. require("../../platform/index.js");
  13. require("../../platform/provider/wechat/index.js");
  14. require("../../platform/provider/wechat/miniProgram.js");
  15. require("../../api/member/auth.js");
  16. require("../../api/member/social.js");
  17. require("../../api/member/user.js");
  18. require("../../platform/provider/apple/index.js");
  19. require("../../platform/share.js");
  20. require("../../router/index.js");
  21. require("../../hooks/useModal.js");
  22. require("../../helper/index.js");
  23. require("../../helper/test.js");
  24. require("../../helper/digit.js");
  25. require("../../api/member/signin.js");
  26. require("../../helper/throttle.js");
  27. require("../../url/index.js");
  28. require("../../platform/pay.js");
  29. require("../../api/pay/order.js");
  30. require("../../store/user.js");
  31. require("../../store/cart.js");
  32. require("../../api/trade/cart.js");
  33. require("../../api/pay/wallet.js");
  34. require("../../api/trade/order.js");
  35. require("../../api/promotion/coupon.js");
  36. require("../../store/sys.js");
  37. require("../../store/modal.js");
  38. require("../../api/distri/share.js");
  39. require("../../api/distri/team.js");
  40. require("../../api/infra/file.js");
  41. require("../../api/member/address.js");
  42. require("../../api/member/point.js");
  43. require("../../api/migration/app.js");
  44. require("../../api/migration/chat.js");
  45. require("../../api/migration/index.js");
  46. require("../../api/migration/third.js");
  47. require("../../api/pay/channel.js");
  48. require("../../api/product/category.js");
  49. require("../../api/product/comment.js");
  50. require("../../api/product/favorite.js");
  51. require("../../api/product/history.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_goods_column2 = common_vendor.resolveComponent("s-goods-column");
  67. _easycom_s_goods_column2();
  68. }
  69. const _easycom_s_goods_column = () => "../s-goods-column/s-goods-column.js";
  70. if (!Math) {
  71. _easycom_s_goods_column();
  72. }
  73. const _sfc_main = {
  74. __name: "s-goods-shelves",
  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 props = __props;
  89. const { layoutType, spuIds } = props.data;
  90. let { marginLeft, marginRight } = props.styles;
  91. const goodsList = common_vendor.ref([]);
  92. common_vendor.onMounted(async () => {
  93. if (spuIds.length > 0) {
  94. let { data } = await sheep_api_product_spu.SpuApi.getSpuListByIds(spuIds.join(","));
  95. goodsList.value = data;
  96. }
  97. });
  98. return (_ctx, _cache) => {
  99. return common_vendor.e({
  100. a: common_vendor.unref(layoutType) === "twoCol"
  101. }, common_vendor.unref(layoutType) === "twoCol" ? {
  102. b: common_vendor.f(goodsList.value, (item, k0, i0) => {
  103. var _a;
  104. return {
  105. a: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/goods/index", {
  106. id: item.id
  107. }), item.id),
  108. b: "9630804b-0-" + i0,
  109. c: common_vendor.p({
  110. size: "xs",
  111. goodsFields: __props.data.fields,
  112. tagStyle: __props.data.badge,
  113. data: item,
  114. titleColor: (_a = __props.data.fields.name) == null ? void 0 : _a.color,
  115. topRadius: __props.data.borderRadiusTop,
  116. bottomRadius: __props.data.borderRadiusBottom,
  117. titleWidth: (454 - common_vendor.unref(marginRight) * 2 - __props.data.space * 2 - common_vendor.unref(marginLeft) * 2) / 2
  118. }),
  119. d: item.id
  120. };
  121. }),
  122. c: common_vendor.s({
  123. padding: __props.data.space + "rpx"
  124. }),
  125. d: common_vendor.s({
  126. margin: "-" + __props.data.space + "rpx"
  127. })
  128. } : {}, {
  129. e: common_vendor.unref(layoutType) === "threeCol"
  130. }, common_vendor.unref(layoutType) === "threeCol" ? {
  131. f: common_vendor.f(goodsList.value, (item, k0, i0) => {
  132. var _a;
  133. return {
  134. a: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/goods/index", {
  135. id: item.id
  136. }), item.id),
  137. b: "9630804b-1-" + i0,
  138. c: common_vendor.p({
  139. size: "sm",
  140. goodsFields: __props.data.fields,
  141. tagStyle: __props.data.badge,
  142. data: item,
  143. titleColor: (_a = __props.data.fields.name) == null ? void 0 : _a.color,
  144. topRadius: __props.data.borderRadiusTop,
  145. bottomRadius: __props.data.borderRadiusBottom
  146. }),
  147. d: item.id
  148. };
  149. }),
  150. g: common_vendor.s({
  151. padding: __props.data.space + "rpx"
  152. }),
  153. h: common_vendor.s({
  154. margin: "-" + __props.data.space + "rpx"
  155. })
  156. } : {}, {
  157. i: common_vendor.unref(layoutType) === "horizSwiper"
  158. }, common_vendor.unref(layoutType) === "horizSwiper" ? {
  159. j: common_vendor.f(goodsList.value, (item, k0, i0) => {
  160. var _a;
  161. return {
  162. a: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/goods/index", {
  163. id: item.id
  164. }), item.id),
  165. b: "9630804b-2-" + i0,
  166. c: common_vendor.p({
  167. size: "sm",
  168. goodsFields: __props.data.fields,
  169. tagStyle: __props.data.badge,
  170. data: item,
  171. titleColor: (_a = __props.data.fields.name) == null ? void 0 : _a.color,
  172. titleWidth: (750 - common_vendor.unref(marginRight) * 2 - __props.data.space * 4 - common_vendor.unref(marginLeft) * 2) / 3
  173. }),
  174. d: item.id
  175. };
  176. }),
  177. k: common_vendor.s({
  178. marginRight: __props.data.space * 2 + "rpx"
  179. })
  180. } : {});
  181. };
  182. }
  183. };
  184. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-9630804b"], ["__file", "D:/zx/mall-front-app/sheep/components/s-goods-shelves/s-goods-shelves.vue"]]);
  185. wx.createComponent(Component);