s-layout.js 8.0 KB

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