App.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <script>
  2. import Vue from 'vue'
  3. export default {
  4. onLaunch: function () {
  5. uni.getSystemInfo({
  6. success: function (e) {
  7. // #ifndef MP
  8. Vue.prototype.StatusBar = e.statusBarHeight;
  9. if (e.platform == 'android') {
  10. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  11. } else {
  12. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  13. };
  14. // #endif
  15. // #ifdef MP-WEIXIN
  16. Vue.prototype.StatusBar = e.statusBarHeight;
  17. let custom = wx.getMenuButtonBoundingClientRect();
  18. Vue.prototype.Custom = custom;
  19. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  20. // #endif
  21. // #ifdef MP-ALIPAY
  22. Vue.prototype.StatusBar = e.statusBarHeight;
  23. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  24. // #endif
  25. }
  26. })
  27. },
  28. onShow: function () {
  29. },
  30. onHide: function () {
  31. }
  32. }
  33. </script>
  34. <style lang="scss">
  35. @import "@/uni_modules/uview-ui/index.scss";
  36. @import "colorui/main.css";
  37. @import "colorui/icon.css";
  38. /* 你的项目css */
  39. @import "uni.scss";
  40. </style>