s-tabbar.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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_su_tabbar_item2 = common_vendor.resolveComponent("su-tabbar-item");
  67. const _easycom_su_tabbar2 = common_vendor.resolveComponent("su-tabbar");
  68. (_easycom_su_tabbar_item2 + _easycom_su_tabbar2)();
  69. }
  70. const _easycom_su_tabbar_item = () => "../../ui/su-tabbar-item/su-tabbar-item.js";
  71. const _easycom_su_tabbar = () => "../../ui/su-tabbar/su-tabbar.js";
  72. if (!Math) {
  73. (_easycom_su_tabbar_item + _easycom_su_tabbar)();
  74. }
  75. const _sfc_main = {
  76. __name: "s-tabbar",
  77. props: {
  78. path: String,
  79. default: ""
  80. },
  81. setup(__props) {
  82. const tabbar = common_vendor.computed(() => {
  83. var _a;
  84. return (_a = sheep_index.sheep.$store("app").template.basic) == null ? void 0 : _a.tabbar;
  85. });
  86. const tabbarStyle = common_vendor.computed(() => {
  87. const backgroundStyle = tabbar.value.style;
  88. if (backgroundStyle.bgType === "color") {
  89. return { background: backgroundStyle.bgColor };
  90. }
  91. if (backgroundStyle.bgType === "img")
  92. return {
  93. background: `url(${sheep_index.sheep.$url.cdn(
  94. backgroundStyle.bgImg
  95. )}) no-repeat top center / 100% auto`
  96. };
  97. });
  98. const getTabbarCenter = (index) => {
  99. if (common_vendor.unref(tabbar).mode !== 2)
  100. return false;
  101. return common_vendor.unref(tabbar).items % 2 > 0 ? Math.ceil(common_vendor.unref(tabbar).items.length / 2) === index + 1 : false;
  102. };
  103. return (_ctx, _cache) => {
  104. var _a, _b, _c, _d;
  105. return common_vendor.e({
  106. a: ((_b = (_a = tabbar.value) == null ? void 0 : _a.items) == null ? void 0 : _b.length) > 0
  107. }, ((_d = (_c = tabbar.value) == null ? void 0 : _c.items) == null ? void 0 : _d.length) > 0 ? {
  108. b: common_vendor.f(tabbar.value.items, (item, index, i0) => {
  109. return {
  110. a: common_vendor.unref(sheep_index.sheep).$url.cdn(item.activeIconUrl),
  111. b: common_vendor.unref(sheep_index.sheep).$url.cdn(item.iconUrl),
  112. c: item.text,
  113. d: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go(item.url), item.text),
  114. e: "2c28bd42-1-" + i0 + ",2c28bd42-0",
  115. f: common_vendor.p({
  116. text: item.text,
  117. name: item.url,
  118. isCenter: getTabbarCenter(index),
  119. centerImage: common_vendor.unref(sheep_index.sheep).$url.cdn(item.iconUrl)
  120. })
  121. };
  122. }),
  123. c: common_vendor.p({
  124. value: __props.path,
  125. fixed: true,
  126. placeholder: true,
  127. safeAreaInsetBottom: true,
  128. inactiveColor: tabbar.value.style.color,
  129. activeColor: tabbar.value.style.activeColor,
  130. midTabBar: tabbar.value.mode === 2,
  131. customStyle: tabbarStyle.value
  132. })
  133. } : {});
  134. };
  135. }
  136. };
  137. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/zx/mall-front-app/sheep/components/s-tabbar/s-tabbar.vue"]]);
  138. wx.createComponent(Component);