App.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 + 4;
  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. console.log('App Show')
  30. },
  31. onHide: function() {
  32. console.log('App Hide')
  33. }
  34. }
  35. </script>
  36. <style lang="scss">
  37. @import "colorui/main.css";
  38. @import "colorui/icon.css";
  39. @import "uview-ui/index.scss";
  40. </style>