app-config-service.js 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. var isReady = false;
  2. var onReadyCallbacks = [];
  3. var isServiceReady = false;
  4. var onServiceReadyCallbacks = [];
  5. var __uniConfig = {
  6. "pages": ["pages/index/index", "pages/center/center", "pages/login/login", "pages/login/code", "pages/login/account", "pages/login/problem", "pages/profile/setting", "pages/profile/profile", "pages/profile/password", "pages/search/search", "pages/notice/notice", "pages/profile/aboutMe", "pages/search/searchList", "pages/detail/detail", "pages/detail/addHouse", "pages/detail/preHouse"],
  7. "window": {
  8. "navigationBarTextStyle": "black",
  9. "navigationBarTitleText": "World",
  10. "navigationBarBackgroundColor": "#ffffff",
  11. "backgroundColor": "#ffffff"
  12. },
  13. "tabBar": {
  14. "color": "#909399",
  15. "selectedColor": "#2979ff",
  16. "borderStyle": "#909399",
  17. "backgroundColor": "#ffffff",
  18. "list": [{
  19. "pagePath": "pages/index/index",
  20. "iconPath": "static/index.png",
  21. "selectedIconPath": "static/index-selected.png",
  22. "text": "首页"
  23. }, {
  24. "pagePath": "pages/center/center",
  25. "iconPath": "static/center.png",
  26. "selectedIconPath": "static/center-selected.png",
  27. "text": "我"
  28. }]
  29. },
  30. "nvueCompiler": "uni-app",
  31. "nvueStyleCompiler": "weex",
  32. "renderer": "auto",
  33. "splashscreen": {"alwaysShowBeforeRender": true, "autoclose": false},
  34. "appname": "一心房产",
  35. "compilerVersion": "3.3.5",
  36. "entryPagePath": "pages/index/index",
  37. "networkTimeout": {"request": 60000, "connectSocket": 60000, "uploadFile": 60000, "downloadFile": 60000}
  38. };
  39. var __uniRoutes = [{
  40. "path": "/pages/index/index",
  41. "meta": {"isQuit": true, "isTabBar": true},
  42. "window": {
  43. "navigationStyle": "custom",
  44. "navigationBarTitleText": "首页",
  45. "enablePullDownRefresh": true,
  46. "pullToRefresh": {"support": true, "color": "#2979ff", "style": "circle"}
  47. }
  48. }, {
  49. "path": "/pages/center/center",
  50. "meta": {"isQuit": true, "isTabBar": true},
  51. "window": {"navigationStyle": "custom", "navigationBarTitleText": "我"}
  52. }, {
  53. "path": "/pages/login/login",
  54. "meta": {},
  55. "window": {"navigationStyle": "custom", "navigationBarTitleText": "登录", "enablePullDownRefresh": false}
  56. }, {
  57. "path": "/pages/login/code",
  58. "meta": {},
  59. "window": {"navigationBarTitleText": "验证码", "enablePullDownRefresh": false}
  60. }, {
  61. "path": "/pages/login/account",
  62. "meta": {},
  63. "window": {"navigationBarTitleText": "密码登录", "enablePullDownRefresh": false}
  64. }, {
  65. "path": "/pages/login/problem",
  66. "meta": {},
  67. "window": {"navigationBarTitleText": "常见问题", "enablePullDownRefresh": false}
  68. }, {
  69. "path": "/pages/profile/setting",
  70. "meta": {},
  71. "window": {"navigationStyle": "custom", "navigationBarTitleText": "", "enablePullDownRefresh": false}
  72. }, {
  73. "path": "/pages/profile/profile",
  74. "meta": {},
  75. "window": {"navigationStyle": "custom", "navigationBarTitleText": "", "enablePullDownRefresh": false}
  76. }, {
  77. "path": "/pages/profile/password",
  78. "meta": {},
  79. "window": {"navigationBarTitleText": "修改密码", "enablePullDownRefresh": false}
  80. }, {
  81. "path": "/pages/search/search",
  82. "meta": {},
  83. "window": {"navigationBarTitleText": "搜索", "enablePullDownRefresh": false}
  84. }, {
  85. "path": "/pages/notice/notice",
  86. "meta": {},
  87. "window": {"navigationBarTitleText": "通知", "enablePullDownRefresh": false}
  88. }, {
  89. "path": "/pages/profile/aboutMe",
  90. "meta": {},
  91. "window": {"navigationBarTitleText": "关于我", "enablePullDownRefresh": false, "navigationStyle": "custom"}
  92. }, {
  93. "path": "/pages/search/searchList",
  94. "meta": {},
  95. "window": {"navigationBarTitleText": "房源列表", "enablePullDownRefresh": true}
  96. }, {
  97. "path": "/pages/detail/detail",
  98. "meta": {},
  99. "window": {"navigationStyle": "custom", "navigationBarTitleText": "房源详情", "enablePullDownRefresh": false}
  100. }, {
  101. "path": "/pages/detail/addHouse",
  102. "meta": {},
  103. "window": {"navigationBarTitleText": "新增房源", "enablePullDownRefresh": false}
  104. }, {
  105. "path": "/pages/detail/preHouse",
  106. "meta": {},
  107. "window": {"navigationStyle": "custom", "navigationBarTitleText": "预增房源", "enablePullDownRefresh": false}
  108. }];
  109. __uniConfig.onReady = function (callback) {
  110. if (__uniConfig.ready) {
  111. callback()
  112. } else {
  113. onReadyCallbacks.push(callback)
  114. }
  115. };
  116. Object.defineProperty(__uniConfig, "ready", {
  117. get: function () {
  118. return isReady
  119. }, set: function (val) {
  120. isReady = val;
  121. if (!isReady) {
  122. return
  123. }
  124. const callbacks = onReadyCallbacks.slice(0);
  125. onReadyCallbacks.length = 0;
  126. callbacks.forEach(function (callback) {
  127. callback()
  128. })
  129. }
  130. });
  131. __uniConfig.onServiceReady = function (callback) {
  132. if (__uniConfig.serviceReady) {
  133. callback()
  134. } else {
  135. onServiceReadyCallbacks.push(callback)
  136. }
  137. };
  138. Object.defineProperty(__uniConfig, "serviceReady", {
  139. get: function () {
  140. return isServiceReady
  141. }, set: function (val) {
  142. isServiceReady = val;
  143. if (!isServiceReady) {
  144. return
  145. }
  146. const callbacks = onServiceReadyCallbacks.slice(0);
  147. onServiceReadyCallbacks.length = 0;
  148. callbacks.forEach(function (callback) {
  149. callback()
  150. })
  151. }
  152. });
  153. service.register("uni-app-config", {
  154. create(a, b, c) {
  155. if (!__uniConfig.viewport) {
  156. var d = b.weex.config.env.scale, e = b.weex.config.env.deviceWidth, f = Math.ceil(e / d);
  157. Object.assign(__uniConfig, {viewport: f, defaultFontSize: Math.round(f / 20)})
  158. }
  159. return {
  160. instance: {
  161. __uniConfig: __uniConfig,
  162. __uniRoutes: __uniRoutes,
  163. global: void 0,
  164. window: void 0,
  165. document: void 0,
  166. frames: void 0,
  167. self: void 0,
  168. location: void 0,
  169. navigator: void 0,
  170. localStorage: void 0,
  171. history: void 0,
  172. Caches: void 0,
  173. screen: void 0,
  174. alert: void 0,
  175. confirm: void 0,
  176. prompt: void 0,
  177. fetch: void 0,
  178. XMLHttpRequest: void 0,
  179. WebSocket: void 0,
  180. webkit: void 0,
  181. print: void 0
  182. }
  183. }
  184. }
  185. });