su-inner-navbar.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../index.js");
  4. const sheep_hooks_useModal = require("../../hooks/useModal.js");
  5. require("../../api/index.js");
  6. require("../../api/distri/score.js");
  7. require("../../request/index.js");
  8. require("../../config/index.js");
  9. require("../../store/index.js");
  10. require("../../store/app.js");
  11. require("../../api/promotion/diy.js");
  12. require("../../platform/index.js");
  13. require("../../platform/provider/wechat/index.js");
  14. require("../../platform/provider/wechat/miniProgram.js");
  15. require("../../api/member/auth.js");
  16. require("../../api/member/social.js");
  17. require("../../api/member/user.js");
  18. require("../../platform/provider/apple/index.js");
  19. require("../../platform/share.js");
  20. require("../../router/index.js");
  21. require("../../helper/throttle.js");
  22. require("../../url/index.js");
  23. require("../../platform/pay.js");
  24. require("../../helper/index.js");
  25. require("../../helper/test.js");
  26. require("../../helper/digit.js");
  27. require("../../api/pay/order.js");
  28. require("../../store/user.js");
  29. require("../../store/cart.js");
  30. require("../../api/trade/cart.js");
  31. require("../../api/pay/wallet.js");
  32. require("../../api/trade/order.js");
  33. require("../../api/promotion/coupon.js");
  34. require("../../store/sys.js");
  35. require("../../store/modal.js");
  36. require("../../api/distri/share.js");
  37. require("../../api/distri/team.js");
  38. require("../../api/infra/file.js");
  39. require("../../api/member/address.js");
  40. require("../../api/member/point.js");
  41. require("../../api/member/signin.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_status_bar2 = common_vendor.resolveComponent("su-status-bar");
  67. const _easycom_su_fixed2 = common_vendor.resolveComponent("su-fixed");
  68. (_easycom_su_status_bar2 + _easycom_su_fixed2)();
  69. }
  70. const _easycom_su_status_bar = () => "../su-status-bar/su-status-bar.js";
  71. const _easycom_su_fixed = () => "../su-fixed/su-fixed.js";
  72. if (!Math) {
  73. (_easycom_su_status_bar + _easycom_su_fixed)();
  74. }
  75. const _sfc_main = {
  76. __name: "su-inner-navbar",
  77. props: {
  78. zIndex: {
  79. type: Number,
  80. default: 100
  81. },
  82. title: {
  83. //返回文本
  84. type: String,
  85. default: ""
  86. },
  87. bg: {
  88. type: String,
  89. default: "bg-white"
  90. },
  91. // 常驻
  92. alway: {
  93. type: Boolean,
  94. default: true
  95. },
  96. opacity: {
  97. //是否开启滑动渐变
  98. type: Boolean,
  99. default: true
  100. },
  101. noFixed: {
  102. //是否浮动
  103. type: Boolean,
  104. default: true
  105. },
  106. ui: {
  107. type: String,
  108. default: ""
  109. },
  110. capsule: {
  111. //是否开启胶囊返回
  112. type: Boolean,
  113. default: false
  114. },
  115. stopBack: {
  116. type: Boolean,
  117. default: false
  118. },
  119. placeholder: {
  120. type: [Boolean],
  121. default: false
  122. },
  123. bgStyles: {
  124. type: Object,
  125. default() {
  126. }
  127. }
  128. },
  129. emits: ["navback", "clickLeft"],
  130. setup(__props, { emit: __emit }) {
  131. const state = common_vendor.reactive({
  132. statusCur: "",
  133. capsuleStyle: {},
  134. capsuleBack: {},
  135. isDark: true
  136. });
  137. const sys_statusBar = sheep_index.sheep.$platform.device.statusBarHeight;
  138. const sys_navBar = sheep_index.sheep.$platform.navbar;
  139. const props = __props;
  140. const emits = __emit;
  141. const hasHistory = sheep_index.sheep.$router.hasHistory();
  142. common_vendor.onBeforeMount(() => {
  143. init();
  144. });
  145. common_vendor.onPageScroll((e) => {
  146. let top = e.scrollTop;
  147. state.isDark = top < sheep_index.sheep.$platform.navbar;
  148. });
  149. function onClickLeft() {
  150. if (hasHistory) {
  151. sheep_index.sheep.$router.back();
  152. } else {
  153. sheep_index.sheep.$router.go("/pages/index/index");
  154. }
  155. emits("clickLeft");
  156. }
  157. function onClickRight() {
  158. sheep_hooks_useModal.showMenuTools();
  159. }
  160. const init = () => {
  161. state.capsuleStyle = {
  162. width: sheep_index.sheep.$platform.capsule.width + "px",
  163. height: sheep_index.sheep.$platform.capsule.height + "px"
  164. };
  165. state.capsuleBack = state.capsuleStyle;
  166. };
  167. return (_ctx, _cache) => {
  168. return common_vendor.e({
  169. a: common_vendor.unref(hasHistory)
  170. }, common_vendor.unref(hasHistory) ? {} : {}, {
  171. b: common_vendor.o(onClickLeft),
  172. c: common_vendor.o(onClickRight),
  173. d: common_vendor.t(__props.title),
  174. e: common_vendor.s(state.capsuleStyle),
  175. f: common_vendor.n(state.isDark ? "text-white" : "text-black"),
  176. g: common_vendor.s({
  177. height: common_vendor.unref(sys_navBar) - common_vendor.unref(sys_statusBar) + "px"
  178. }),
  179. h: common_vendor.p({
  180. noFixed: props.noFixed,
  181. alway: props.alway,
  182. bgStyles: props.bgStyles,
  183. val: 0,
  184. index: props.zIndex,
  185. noNav: true,
  186. bg: props.bg,
  187. ui: props.ui,
  188. opacity: props.opacity,
  189. placeholder: props.placeholder
  190. })
  191. });
  192. };
  193. }
  194. };
  195. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-374b2fee"], ["__file", "D:/zx/mall-front-app/sheep/ui/su-inner-navbar/su-inner-navbar.vue"]]);
  196. wx.createComponent(Component);