App.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <script>
  2. import md5Libs from '@/uni_modules/uview-ui/libs/function/md5';
  3. import Vue from 'vue';
  4. export default {
  5. created() {
  6. // #ifdef APP-PLUS
  7. plus.navigator.closeSplashscreen();
  8. // #endif
  9. },
  10. onLaunch: async function () {
  11. console.log('App Launch');
  12. uni.hideTabBar();
  13. //加载配置
  14. uni.getSystemInfo({
  15. success: function (e) {
  16. // #ifndef MP
  17. Vue.prototype.StatusBar = e.statusBarHeight;
  18. if (e.platform == 'android') {
  19. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  20. } else {
  21. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  22. }
  23. // #endif
  24. // #ifdef MP-WEIXIN
  25. Vue.prototype.StatusBar = e.statusBarHeight;
  26. let custom = wx.getMenuButtonBoundingClientRect();
  27. Vue.prototype.Custom = custom;
  28. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  29. // #endif
  30. // #ifdef MP-ALIPAY
  31. Vue.prototype.StatusBar = e.statusBarHeight;
  32. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  33. // #endif
  34. }
  35. });
  36. let res = await this.$api.getConfig();
  37. // console.log(res);
  38. if (!res.code) {
  39. return;
  40. }
  41. this.vuex_config = res.data;
  42. },
  43. onShow: function () {
  44. console.log('App 开启');
  45. uni.hideTabBar();
  46. },
  47. onHide: function () {
  48. console.log('App 关闭');
  49. },
  50. onLoad: function () {
  51. uni.hideTabBar();
  52. }
  53. };
  54. </script>
  55. <style lang="scss">
  56. @import '@/uni_modules/uview-ui/index.scss';
  57. @import 'common/app.css';
  58. @import './GraceUI5/css/graceUI.css';
  59. @import './GraceUI5/skin/black.css';
  60. /* 加载图标字体 - 条件编译模式 */
  61. /* #ifdef APP-PLUS-NVUE */
  62. .gui-icons {
  63. font-family: graceIconfont;
  64. }
  65. /* #endif */
  66. </style>