app.jsx 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. import Taro, { Component } from '@tarojs/taro'
  2. import { Provider } from '@tarojs/redux'
  3. import Index from './pages/index'
  4. import configStore from './store'
  5. import 'taro-ui/dist/style/index.scss'
  6. import './app.scss'
  7. import api from './api'
  8. Taro.api = api
  9. import * as tools from './utils/tool'
  10. import * as mixins from './mixins'
  11. Taro.$msg = tools.msgBase
  12. Taro.$CR = tools.configRight
  13. Taro.$msgConfirm = tools.confirmMsgFn
  14. Taro.$AHU = mixins.addHistoryUrl
  15. Taro.$getLvIcon = mixins.getLvIcon
  16. Taro.$initBaseData = mixins.initBaseData
  17. // 如果需要在 h5 环境中开启 React Devtools
  18. // 取消以下注释:
  19. // if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5') {
  20. // require('nerv-devtools')
  21. // }
  22. const store = configStore()
  23. class App extends Component {
  24. config = {
  25. lazyCodeLoading: "requiredComponents",
  26. pages: [
  27. 'pages/index/index',
  28. ],
  29. subPackages: [
  30. {
  31. root: 'pagesHouse/',
  32. pages: [
  33. 'index',
  34. 'list',
  35. 'indexDtl',
  36. 'indexDtlMore',
  37. 'indexDtlAround',
  38. // 'indexDtlMap',
  39. 'produceType',
  40. 'vr',
  41. 'vrList',
  42. 'photo',
  43. 'photoin',
  44. 'news',
  45. 'newsEdit',
  46. 'follow',
  47. 'history',
  48. 'search',
  49. 'pkList',
  50. 'pkDtl',
  51. 'pkAdd',
  52. 'price',
  53. 'priceChart',
  54. 'bargain',
  55. 'cooperate',
  56. ]
  57. },
  58. {
  59. root: 'pagesMore/',
  60. pages: [
  61. 'news/index',
  62. 'news/list',
  63. 'news/indexDtl',
  64. 'news/tpDtl',
  65. 'news/plan',
  66. 'news/planDtl',
  67. 'center/index',
  68. 'center/group',
  69. 'center/feedback',
  70. 'center/loanCalc',
  71. 'center/webViews',
  72. // 'center/coupon',
  73. 'center/sxf',
  74. 'center/saleEdit',
  75. 'center/userEdit',
  76. 'center/uploadRoom',
  77. 'center/uploadRoom2',
  78. 'center/uploadRoomHl',
  79. 'comment/add',
  80. 'comment/list',
  81. 'comment/dtl',
  82. 'qa/list',
  83. 'qa/add',
  84. // 'qa/dtl',
  85. // 'test/index',
  86. 'score/list',
  87. 'score/edit',
  88. ]
  89. },
  90. {
  91. root: 'pagesPlan/',
  92. pages: [
  93. 'apply',
  94. 'apply2',
  95. 'yanfang',
  96. 'discountGroup',
  97. 'queryBuyHouse',
  98. ]
  99. },
  100. {
  101. root: 'pagesSchool/',
  102. pages: [
  103. 'index',
  104. 'indexDtl',
  105. 'houseList',
  106. 'class',
  107. 'theme',
  108. 'area',
  109. ]
  110. },
  111. {
  112. root: 'pagesQa/',
  113. pages: [
  114. 'index',
  115. 'add',
  116. 'dtl',
  117. 'dtlSub',
  118. 'msg/index',
  119. 'msg/chat',
  120. 'msg/message',
  121. // 'todayNews',
  122. 'area',
  123. 'areaImg',
  124. 'areaSub',
  125. 'areaEstate',
  126. 'yhBaike',
  127. ]
  128. },
  129. {
  130. root: 'pagesDesc/',
  131. pages: [
  132. 'desc',
  133. ]
  134. },
  135. {
  136. root: 'pagesRoom/',
  137. pages: [
  138. 'estate',
  139. 'list',
  140. 'list2',
  141. 'listMy',
  142. 'listed',
  143. 'listed2',
  144. 'rentlist',
  145. 'rentdtl',
  146. 'rentUpload',
  147. 'dtl',
  148. 'roomPrice',
  149. 'roomPrice2',
  150. 'roomPriceXk',
  151. // 'roomPriceEdit',
  152. 'roomPriceImg',
  153. 'roomPriceList',
  154. // 'card/index',
  155. 'follow/list',
  156. 'follow/user',
  157. 'follow/room',
  158. 'follow/roomAdd',
  159. 'follow/add',
  160. 'follow/history',
  161. 'follow/lineup',
  162. 'follow/lineup2',
  163. 'follow/lineupRecord',
  164. 'follow/lineupRecord2',
  165. 'estateTrend',
  166. 'estateTrendRecord',
  167. 'estateTrendUpdate',
  168. ]
  169. },
  170. {
  171. root: 'pagesOther/',
  172. pages: [
  173. 'index',
  174. 'integralRecord',
  175. 'channel/index',
  176. // 'foodout/index',
  177. 'map/dtl',
  178. 'map/dtl2',
  179. 'map/metro',
  180. 'map/aftermetro',
  181. 'map/vr',
  182. 'map/plan',
  183. 'bankRate/index',
  184. 'brand/index'
  185. ],
  186. },
  187. ],
  188. window: {
  189. backgroundTextStyle: 'light',
  190. navigationBarBackgroundColor: '#fff',
  191. navigationBarTitleText: 'WeChat',
  192. navigationBarTextStyle: 'black'
  193. },
  194. plugins: {
  195. // "chooseLocation": {
  196. // "version": "1.0.9",
  197. // "provider": "wx76a9a06e5b4e693e"
  198. // },
  199. // "live-player-plugin": {
  200. // "version": "1.3.4",
  201. // "provider": "wx2b03c6e691cd7370"
  202. // }
  203. },
  204. permission: {
  205. "scope.userLocation": {
  206. "desc": "你的位置信息将用于小程序定位"
  207. }
  208. }
  209. }
  210. componentWillMount () {
  211. // Taro.loadFontFace({
  212. // global: true,
  213. // family: 'pf',
  214. // source: 'url("http://h5.honglounews.com/PF.TTF")',
  215. // })
  216. mixins.initBaseData()
  217. }
  218. componentDidMount () {}
  219. componentDidShow () {}
  220. componentDidHide () {}
  221. componentDidCatchError () {}
  222. // 在 App 类中的 render() 函数没有实际作用
  223. // 请勿修改此函数
  224. render () {
  225. return (
  226. <Provider store={store}>
  227. <Index />
  228. </Provider>
  229. )
  230. }
  231. }
  232. Taro.render(<App />, document.getElementById('app'))