App.vue 994 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!-- <template>
  2. <div class="app">
  3. <router-view class="page-top-space"></router-view>
  4. </div>
  5. </template> -->
  6. <script setup>
  7. import { onShow, onHide, onLaunch } from '@dcloudio/uni-app'
  8. onLaunch(async()=> {
  9. console.log('App onLaunch')
  10. uni.getSystemInfo({
  11. success: function(e) {
  12. // Vue.prototype.StatusBar = e.statusBarHeight;
  13. console.log("e.statusBarHeight", e.statusBarHeight)
  14. if (e.platform == 'android') {
  15. // Vue.prototype.CustomBar = e.statusBarHeight + 50;
  16. console.log('CustomBar', e.statusBarHeight + 50)
  17. } else {
  18. console.log('CustomBar', e.statusBarHeight + 45)
  19. };
  20. }
  21. })
  22. })
  23. onShow(()=>{
  24. console.log('App Show')
  25. })
  26. onHide(()=>{
  27. console.log('App Hide')
  28. })
  29. </script>
  30. <style>
  31. /*每个页面公共css */
  32. /* page{
  33. padding-top: 0;
  34. } */
  35. /* @import "@/static/iconfont.css" */
  36. .main{
  37. background-color: #bcbcbc;
  38. display: flex;
  39. flex-direction:column;
  40. width: 1200px;
  41. /* height: 2000px; */
  42. }
  43. </style>