s-layout.js 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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_navbar2 = common_vendor.resolveComponent("su-navbar");
  67. const _easycom_s_custom_navbar2 = common_vendor.resolveComponent("s-custom-navbar");
  68. const _easycom_su_inner_navbar2 = common_vendor.resolveComponent("su-inner-navbar");
  69. const _easycom_s_tabbar2 = common_vendor.resolveComponent("s-tabbar");
  70. const _easycom_s_wallet_modal2 = common_vendor.resolveComponent("s-wallet-modal");
  71. const _easycom_s_signup_modal2 = common_vendor.resolveComponent("s-signup-modal");
  72. const _easycom_s_auth_modal2 = common_vendor.resolveComponent("s-auth-modal");
  73. const _easycom_s_share_modal2 = common_vendor.resolveComponent("s-share-modal");
  74. const _easycom_s_menu_tools2 = common_vendor.resolveComponent("s-menu-tools");
  75. (_easycom_su_navbar2 + _easycom_s_custom_navbar2 + _easycom_su_inner_navbar2 + _easycom_s_tabbar2 + _easycom_s_wallet_modal2 + _easycom_s_signup_modal2 + _easycom_s_auth_modal2 + _easycom_s_share_modal2 + _easycom_s_menu_tools2)();
  76. }
  77. const _easycom_su_navbar = () => "../../ui/su-navbar/su-navbar.js";
  78. const _easycom_s_custom_navbar = () => "../s-custom-navbar/s-custom-navbar.js";
  79. const _easycom_su_inner_navbar = () => "../../ui/su-inner-navbar/su-inner-navbar.js";
  80. const _easycom_s_tabbar = () => "../s-tabbar/s-tabbar.js";
  81. const _easycom_s_wallet_modal = () => "../s-wallet-modal/s-wallet-modal.js";
  82. const _easycom_s_signup_modal = () => "../s-signup-modal/s-signup-modal.js";
  83. const _easycom_s_auth_modal = () => "../s-auth-modal/s-auth-modal.js";
  84. const _easycom_s_share_modal = () => "../s-share-modal/s-share-modal.js";
  85. const _easycom_s_menu_tools = () => "../s-menu-tools/s-menu-tools.js";
  86. if (!Math) {
  87. (_easycom_su_navbar + _easycom_s_custom_navbar + _easycom_su_inner_navbar + _easycom_s_tabbar + _easycom_s_wallet_modal + _easycom_s_signup_modal + _easycom_s_auth_modal + _easycom_s_share_modal + _easycom_s_menu_tools)();
  88. }
  89. const _sfc_main = {
  90. __name: "s-layout",
  91. props: {
  92. title: {
  93. type: String,
  94. default: ""
  95. },
  96. navbar: {
  97. type: String,
  98. default: "normal"
  99. },
  100. opacityBgUi: {
  101. type: String,
  102. default: "bg-white"
  103. },
  104. color: {
  105. type: String,
  106. default: ""
  107. },
  108. tools: {
  109. type: String,
  110. default: "title"
  111. },
  112. keyword: {
  113. type: String,
  114. default: ""
  115. },
  116. navbarStyle: {
  117. type: Object,
  118. default: () => ({
  119. mode: "",
  120. type: "",
  121. color: "",
  122. src: "",
  123. list: [],
  124. alwaysShow: 0
  125. })
  126. },
  127. bgStyle: {
  128. type: Object,
  129. default: () => ({
  130. src: "",
  131. color: "var(--ui-BG-1)"
  132. })
  133. },
  134. tabbar: {
  135. type: [String, Boolean],
  136. default: ""
  137. },
  138. onShareAppMessage: {
  139. type: [Boolean, Object],
  140. default: true
  141. },
  142. leftWidth: {
  143. type: [Number, String],
  144. default: 100
  145. },
  146. rightWidth: {
  147. type: [Number, String],
  148. default: 100
  149. },
  150. defaultSearch: {
  151. type: String,
  152. default: ""
  153. },
  154. //展示返回按钮
  155. showLeftButton: {
  156. type: Boolean,
  157. default: false
  158. }
  159. },
  160. emits: ["search"],
  161. setup(__props, { emit: __emit }) {
  162. const props = __props;
  163. const emits = __emit;
  164. const sysStore = sheep_index.sheep.$store("sys");
  165. sheep_index.sheep.$store("user");
  166. sheep_index.sheep.$store("app");
  167. sheep_index.sheep.$store("modal");
  168. const sys = common_vendor.computed(() => sysStore);
  169. const navbarMode = common_vendor.computed(() => {
  170. if (props.navbar === "normal" || props.navbarStyle.mode === "normal") {
  171. return "normal";
  172. }
  173. return "inner";
  174. });
  175. const bgMain = common_vendor.computed(() => {
  176. if (navbarMode.value === "inner") {
  177. return {
  178. background: `${props.bgStyle.backgroundColor} url(${sheep_index.sheep.$url.cdn(
  179. props.bgStyle.backgroundImage
  180. )}) no-repeat top center / 100% auto`
  181. };
  182. }
  183. return {};
  184. });
  185. const bgBody = common_vendor.computed(() => {
  186. if (navbarMode.value === "normal") {
  187. return {
  188. background: `${props.bgStyle.backgroundColor} url(${sheep_index.sheep.$url.cdn(
  189. props.bgStyle.backgroundImage
  190. )}) no-repeat top center / 100% auto`
  191. };
  192. }
  193. return {};
  194. });
  195. const shareInfo = common_vendor.computed(() => {
  196. if (props.onShareAppMessage === true) {
  197. return sheep_index.sheep.$platform.share.getShareInfo();
  198. } else {
  199. if (!common_vendor.lodashExports.isEmpty(props.onShareAppMessage)) {
  200. sheep_index.sheep.$platform.share.updateShareInfo(props.onShareAppMessage);
  201. return props.onShareAppMessage;
  202. }
  203. }
  204. return {};
  205. });
  206. common_vendor.onShareAppMessage(() => {
  207. return {
  208. title: shareInfo.value.title,
  209. path: shareInfo.value.path,
  210. imageUrl: shareInfo.value.image
  211. };
  212. });
  213. common_vendor.onShow(() => {
  214. if (!common_vendor.lodashExports.isEmpty(shareInfo.value)) {
  215. sheep_index.sheep.$platform.share.updateShareInfo(shareInfo.value);
  216. }
  217. });
  218. return (_ctx, _cache) => {
  219. return common_vendor.e({
  220. a: __props.navbar === "normal"
  221. }, __props.navbar === "normal" ? {
  222. b: common_vendor.o((e) => emits("search", e)),
  223. c: common_vendor.p({
  224. title: __props.title,
  225. statusBar: true,
  226. color: __props.color,
  227. tools: __props.tools,
  228. opacityBgUi: __props.opacityBgUi,
  229. defaultSearch: __props.defaultSearch
  230. })
  231. } : __props.navbar === "custom" && navbarMode.value === "normal" ? {
  232. e: common_vendor.p({
  233. data: __props.navbarStyle,
  234. showLeftButton: __props.showLeftButton
  235. })
  236. } : {}, {
  237. d: __props.navbar === "custom" && navbarMode.value === "normal",
  238. f: __props.navbar === "inner"
  239. }, __props.navbar === "inner" ? {
  240. g: common_vendor.p({
  241. title: __props.title
  242. })
  243. } : {}, {
  244. h: __props.navbar === "inner"
  245. }, __props.navbar === "inner" ? {
  246. i: common_vendor.s({
  247. paddingTop: common_vendor.unref(sheep_index.sheep).$platform.navbar + "px"
  248. })
  249. } : {}, {
  250. j: __props.tabbar !== ""
  251. }, __props.tabbar !== "" ? {
  252. k: common_vendor.p({
  253. path: __props.tabbar
  254. })
  255. } : {}, {
  256. l: common_vendor.s(bgBody.value),
  257. m: common_vendor.s(bgMain.value),
  258. n: common_vendor.p({
  259. shareInfo: shareInfo.value
  260. }),
  261. o: common_vendor.n("theme-" + sys.value.mode),
  262. p: common_vendor.n("main-" + sys.value.theme),
  263. q: common_vendor.n("font-" + sys.value.fontSize)
  264. });
  265. };
  266. }
  267. };
  268. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-32d0115a"], ["__file", "D:/zx/mall-front-app/sheep/components/s-layout/s-layout.vue"]]);
  269. wx.createComponent(Component);