App.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <script>
  2. import Vue from 'vue';
  3. export default {
  4. mpType: 'app',
  5. globalData: {
  6. NavHeight: 0,
  7. windowHeight: 0,
  8. isIPX: false,
  9. statusBarHeight: 0
  10. },
  11. onLaunch: function() {
  12. // console.log('App Launch');
  13. this.$nextTick(function() {
  14. uni.hideTabBar();
  15. });
  16. uni.getSystemInfo({
  17. success: res => {
  18. console.log(res);
  19. this.globalData.statusBarHeight = res.statusBarHeight;
  20. this.globalData.NavHeight = res.statusBarHeight + 42;
  21. this.globalData.windowHeight = res.windowHeight;
  22. if (res.statusBarHeight > 20 && res.platform.toUpperCase() === 'IOS') {
  23. console.log('Device is iPhoneX!!!');
  24. // 底部安全距离为 68rpx 34px
  25. this.globalData.isIPX = true;
  26. }
  27. }
  28. });
  29. },
  30. onShow: function() {
  31. // console.log('App Show');
  32. },
  33. onHide: function() {
  34. // console.log('App Hide');
  35. }
  36. };
  37. </script>
  38. <style lang="scss">
  39. /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
  40. @font-face {
  41. font-family: 'iconfont';
  42. /* Project id 3695491 */
  43. src: url('https://at.alicdn.com/t/c/font_3695491_hk38bgiibu.woff2?t=1683873775480') format('woff2'),
  44. url('https://at.alicdn.com/t/c/font_3695491_hk38bgiibu.woff?t=1683873775480') format('woff'),
  45. url('https://at.alicdn.com/t/c/font_3695491_hk38bgiibu.ttf?t=1683873775480') format('truetype');
  46. }
  47. /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
  48. @font-face {
  49. font-family: 'iconfont'; /* Project id 4211324 */
  50. src: url('https://at.alicdn.com/t/c/font_4211324_j8cypmf8zve.woff2?t=1695089595832') format('woff2'),
  51. url('https://at.alicdn.com/t/c/font_4211324_j8cypmf8zve.woff?t=1695089595832') format('woff'),
  52. url('https://at.alicdn.com/t/c/font_4211324_j8cypmf8zve.ttf?t=1695089595832') format('truetype');
  53. }
  54. /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
  55. @font-face {
  56. font-family: 'iconfont'; /* Project id 4805946 */
  57. src: url('https://at.alicdn.com/t/c/font_4805946_jmfulvedwi.woff2?t=1736847537403') format('woff2'),
  58. url('https://at.alicdn.com/t/c/font_4805946_jmfulvedwi.woff?t=1736847537403') format('woff'),
  59. url('https://at.alicdn.com/t/c/font_4805946_jmfulvedwi.ttf?t=1736847537403') format('truetype');
  60. }
  61. page {
  62. background-color: #FAFAFA;
  63. }
  64. </style>