家政小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import config from './base/libs/config';
  2. import eventBus from './base/libs/eventBus';
  3. import router from './base/libs/router';
  4. import timer from './base/libs/timer';
  5. import memory from './base/libs/memory';
  6. import util from './base/libs/util';
  7. import wxApi from './base/libs/wxApi';
  8. import eventLock from './base/libs/eventDelayLock';
  9. import AgentPage from './base/constructor/agentPage';
  10. import controller from './base/libs/global';
  11. import request from './base/libs/request';
  12. const appInit = () => {
  13. Object.defineProperties(global, {
  14. 'config': {
  15. value: config,
  16. writable: false,
  17. configurable: false
  18. },
  19. 'Page': {
  20. value: AgentPage,
  21. writable: false,
  22. configurable: false
  23. },
  24. 'request': {
  25. value: request,
  26. writable: false,
  27. configurable: false
  28. },
  29. 'func': {
  30. value: controller,
  31. writable: false,
  32. configurable: false
  33. },
  34. 'router': {
  35. value: router,
  36. writable: false,
  37. configurable: false
  38. },
  39. 'memory': {
  40. value: memory,
  41. writable: false,
  42. configurable: false
  43. },
  44. 'eventBus': {
  45. value: eventBus,
  46. writable: false,
  47. configurable: false
  48. },
  49. 'wx': {
  50. value: wxApi,
  51. writable: false,
  52. configurable: false
  53. },
  54. 'ROUTER_TYPE': {
  55. value: {
  56. //默认的路由方式,保存当前页面
  57. CLOSE_NONE: 1,
  58. //关闭当前页面,并跳转
  59. CLOSE_CURRENT: 2,
  60. //关闭所有页面,并跳转
  61. CLOSE_ALL: 3,
  62. //回退至某个页面
  63. BACK: 4,
  64. //tab切换
  65. SWITCH_TAB: 5,
  66. },
  67. writable: false,
  68. configurable: false
  69. },
  70. 'tools': {
  71. value: {
  72. util,
  73. eventLock,
  74. timer,
  75. memory
  76. },
  77. writable: false,
  78. configurable: false
  79. }
  80. });
  81. }
  82. appInit();
  83. App({
  84. onLaunch: function () {
  85. },
  86. globalData: {}
  87. })