s-layout.js 8.1 KB

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