s-tabbar.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. if (!Array) {
  36. const _easycom_su_tabbar_item2 = common_vendor.resolveComponent("su-tabbar-item");
  37. const _easycom_su_tabbar2 = common_vendor.resolveComponent("su-tabbar");
  38. (_easycom_su_tabbar_item2 + _easycom_su_tabbar2)();
  39. }
  40. const _easycom_su_tabbar_item = () => "../../ui/su-tabbar-item/su-tabbar-item.js";
  41. const _easycom_su_tabbar = () => "../../ui/su-tabbar/su-tabbar.js";
  42. if (!Math) {
  43. (_easycom_su_tabbar_item + _easycom_su_tabbar)();
  44. }
  45. const _sfc_main = {
  46. __name: "s-tabbar",
  47. props: {
  48. path: String,
  49. default: ""
  50. },
  51. setup(__props) {
  52. const tabbar = common_vendor.computed(() => {
  53. var _a;
  54. return (_a = sheep_index.sheep.$store("app").template.basic) == null ? void 0 : _a.tabbar;
  55. });
  56. const tabbarStyle = common_vendor.computed(() => {
  57. const backgroundStyle = tabbar.value.style;
  58. if (backgroundStyle.bgType === "color") {
  59. return { background: backgroundStyle.bgColor };
  60. }
  61. if (backgroundStyle.bgType === "img")
  62. return {
  63. background: `url(${sheep_index.sheep.$url.cdn(
  64. backgroundStyle.bgImg
  65. )}) no-repeat top center / 100% auto`
  66. };
  67. });
  68. const getTabbarCenter = (index) => {
  69. if (common_vendor.unref(tabbar).mode !== 2)
  70. return false;
  71. return common_vendor.unref(tabbar).items % 2 > 0 ? Math.ceil(common_vendor.unref(tabbar).items.length / 2) === index + 1 : false;
  72. };
  73. return (_ctx, _cache) => {
  74. var _a, _b, _c, _d;
  75. return common_vendor.e({
  76. a: ((_b = (_a = common_vendor.unref(tabbar)) == null ? void 0 : _a.items) == null ? void 0 : _b.length) > 0
  77. }, ((_d = (_c = common_vendor.unref(tabbar)) == null ? void 0 : _c.items) == null ? void 0 : _d.length) > 0 ? {
  78. b: common_vendor.f(common_vendor.unref(tabbar).items, (item, index, i0) => {
  79. return {
  80. a: common_vendor.unref(sheep_index.sheep).$url.cdn(item.activeIconUrl),
  81. b: common_vendor.unref(sheep_index.sheep).$url.cdn(item.iconUrl),
  82. c: item.text,
  83. d: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go(item.url), item.text),
  84. e: "79795989-1-" + i0 + ",79795989-0",
  85. f: common_vendor.p({
  86. text: item.text,
  87. name: item.url,
  88. isCenter: getTabbarCenter(index),
  89. centerImage: common_vendor.unref(sheep_index.sheep).$url.cdn(item.iconUrl)
  90. })
  91. };
  92. }),
  93. c: common_vendor.p({
  94. value: __props.path,
  95. fixed: true,
  96. placeholder: true,
  97. safeAreaInsetBottom: true,
  98. inactiveColor: common_vendor.unref(tabbar).style.color,
  99. activeColor: common_vendor.unref(tabbar).style.activeColor,
  100. midTabBar: common_vendor.unref(tabbar).mode === 2,
  101. customStyle: common_vendor.unref(tabbarStyle)
  102. })
  103. } : {});
  104. };
  105. }
  106. };
  107. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/components/s-tabbar/s-tabbar.vue"]]);
  108. wx.createComponent(Component);