app.wpy 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <style lang="less">
  2. .container {
  3. height: 100%;
  4. display: flex;
  5. flex-direction: column;
  6. align-items: center;
  7. justify-content: space-between;
  8. box-sizing: border-box;
  9. }
  10. page {
  11. height: 100%;
  12. }
  13. </style>
  14. <script>
  15. import wepy from '@wepy/core';
  16. import eventHub from './common/eventHub';
  17. import vuex from '@wepy/x';
  18. wepy.use(vuex);
  19. wepy.app({
  20. hooks: {
  21. // App 级别 hook,对整个 App 生效
  22. // 同时存在 Page hook 和 App hook 时,优先执行 Page hook,返回值再交由 App hook 处
  23. 'before-setData': function(dirty) {
  24. // console.log('setData dirty: ', dirty);
  25. return dirty;
  26. }
  27. },
  28. globalData: {
  29. userInfo: null
  30. },
  31. onLaunch() {
  32. // this.testAsync();
  33. // eventHub.$on('app-launch', (...args) => {
  34. // console.log('app-launch event emitted, the params are:');
  35. // console.log(args);
  36. // });
  37. },
  38. methods: {}
  39. });
  40. </script>
  41. <config>
  42. {
  43. pages: [
  44. 'pages/index',
  45. 'pages/auth/index',
  46. 'pages/bindTenant/index',
  47. ],
  48. "subpackages":[
  49. {
  50. "root": "packagesEnv/",
  51. "pages": [
  52. 'pages/home/index',
  53. 'pages/home/carboncredit',
  54. 'pages/home/overtime',
  55. 'pages/home/resident',
  56. 'pages/home/environment',
  57. 'pages/officehome/index',
  58. 'pages/officehome/detail',
  59. 'pages/officehome/demo',
  60. 'pages/portrait/home',
  61. 'pages/portrait/meeting',
  62. 'pages/portrait/energy',
  63. 'pages/portrait/energyPoint',
  64. 'pages/portrait/todayPoint',
  65. 'pages/portrait/pointExplain',
  66. 'pages/portrait/pointRanking',
  67. 'pages/portrait/ajustRecord',
  68. 'pages/portrait/carbonEnterprise',
  69. 'pages/personalCenter/index',
  70. 'pages/personalCenter/personalInfo',
  71. 'pages/personalCenter/operating',
  72. 'pages/personalCenter/xiaosa',
  73. 'pages/administration/index',
  74. 'pages/administration/asuccess',
  75. 'pages/administration/chooseIdentity'
  76. ]
  77. },
  78. ],
  79. window: {
  80. backgroundTextStyle: 'light',
  81. navigationBarBackgroundColor: '#fff',
  82. navigationBarTitleText: ' ',
  83. navigationBarTextStyle: 'black'
  84. }
  85. }
  86. </config>