App.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <script>
  2. import md5Libs from '@/uni_modules/uview-ui/libs/function/md5';
  3. import Vue from 'vue';
  4. import { getConfig } from '@/service/api/common.js';
  5. export default {
  6. created() {
  7. // #ifdef APP-PLUS
  8. plus.navigator.closeSplashscreen();
  9. // #endif
  10. },
  11. onLaunch: async function () {
  12. // console.log('App Launch');
  13. /* 隐藏默认tabBar */
  14. uni.hideTabBar();
  15. //加载配置
  16. uni.getSystemInfo({
  17. success: function (e) {
  18. // #ifndef MP
  19. Vue.prototype.StatusBar = e.statusBarHeight;
  20. if (e.platform == 'android') {
  21. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  22. } else {
  23. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  24. }
  25. // #endif
  26. // #ifdef MP-WEIXIN
  27. Vue.prototype.StatusBar = e.statusBarHeight;
  28. let custom = wx.getMenuButtonBoundingClientRect();
  29. Vue.prototype.Custom = custom;
  30. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  31. // #endif
  32. // #ifdef MP-ALIPAY
  33. Vue.prototype.StatusBar = e.statusBarHeight;
  34. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  35. // #endif
  36. }
  37. });
  38. // getConfig().then(([err, res]) => {
  39. // // console.log('getConfig', err, res);
  40. // if (!err) {
  41. // this.$store.commit('setGlobalConfig', res);
  42. // // 当前活动无效
  43. // if (res.activity_invalid) {
  44. // this.$store.commit('delActivityId'); // 删除活动ID
  45. // // 重新加载配置
  46. // getConfig().then(([err, res]) => {
  47. // // console.log('getConfig reload', err, res);
  48. // if (!err) {
  49. // this.$store.commit('setGlobalConfig', res);
  50. // }
  51. // });
  52. // }
  53. // }
  54. // });
  55. // let res = await this.$api.getConfig();
  56. //console.log(res);
  57. // if (!res.code) {
  58. // return;
  59. // }
  60. // Vue.prototype.vuex_config = res.data;
  61. // this.vuex_config = res.data;
  62. },
  63. onShow: function () {
  64. // console.log('App 开启');
  65. },
  66. onHide: function () {
  67. // console.log('App 关闭');
  68. },
  69. /* 隐藏默认tabBar */
  70. onLoad: function () {
  71. uni.hideTabBar();
  72. }
  73. };
  74. </script>
  75. <style lang="scss">
  76. @import 'colorui/main.css';
  77. @import 'colorui/icon.css';
  78. // @import '@/uni_modules/uview-ui/index.scss';
  79. // // @import './GraceUI5/css/graceUI.css';
  80. // // @import './GraceUI5/skin/black.css';
  81. // /* 加载图标字体 - 条件编译模式 */
  82. // /* #ifdef APP-PLUS-NVUE */
  83. // // .gui-icons {
  84. // // font-family: graceIconfont;
  85. // // }
  86. // /* #endif */
  87. </style>