app.jsx 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. 'follow',
  46. 'history',
  47. 'search',
  48. 'pkList',
  49. 'pkDtl',
  50. 'pkAdd',
  51. 'price',
  52. 'priceChart',
  53. 'bargain',
  54. 'cooperate',
  55. ]
  56. },
  57. {
  58. root: 'pagesMore/',
  59. pages: [
  60. 'news/index',
  61. 'news/list',
  62. 'news/indexDtl',
  63. 'news/tpDtl',
  64. 'news/plan',
  65. 'news/planDtl',
  66. 'center/index',
  67. 'center/group',
  68. 'center/feedback',
  69. 'center/loanCalc',
  70. 'center/webViews',
  71. 'center/coupon',
  72. 'center/sxf',
  73. 'center/saleEdit',
  74. 'center/userEdit',
  75. 'center/uploadRoom',
  76. 'center/uploadRoom2',
  77. 'center/uploadRoomHl',
  78. 'comment/add',
  79. 'comment/list',
  80. 'comment/dtl',
  81. 'qa/list',
  82. 'qa/add',
  83. // 'qa/dtl',
  84. 'test/index',
  85. 'score/list',
  86. 'score/edit',
  87. ]
  88. },
  89. {
  90. root: 'pagesPlan/',
  91. pages: [
  92. 'apply',
  93. 'apply2',
  94. 'yanfang',
  95. 'discountGroup',
  96. 'queryBuyHouse',
  97. ]
  98. },
  99. {
  100. root: 'pagesSchool/',
  101. pages: [
  102. 'index',
  103. 'indexDtl',
  104. 'houseList',
  105. 'class',
  106. 'theme',
  107. 'area',
  108. ]
  109. },
  110. {
  111. root: 'pagesQa/',
  112. pages: [
  113. 'index',
  114. 'add',
  115. 'dtl',
  116. 'dtlSub',
  117. 'msg/index',
  118. 'msg/chat',
  119. 'msg/message',
  120. // 'todayNews',
  121. 'area',
  122. 'areaImg',
  123. 'areaSub',
  124. 'areaEstate',
  125. 'yhBaike',
  126. ]
  127. },
  128. {
  129. root: 'pagesRoom/',
  130. pages: [
  131. 'estate',
  132. 'list',
  133. 'list2',
  134. 'listMy',
  135. 'listed',
  136. 'rentlist',
  137. 'rentdtl',
  138. 'rentUpload',
  139. 'dtl',
  140. 'roomPrice',
  141. 'roomPrice2',
  142. 'roomPriceXk',
  143. // 'roomPriceEdit',
  144. 'roomPriceImg',
  145. 'roomPriceList',
  146. // 'card/index',
  147. 'follow/list',
  148. 'follow/user',
  149. 'follow/room',
  150. 'follow/roomAdd',
  151. 'follow/add',
  152. 'follow/history',
  153. 'follow/lineup',
  154. 'follow/lineup2',
  155. 'follow/lineupRecord',
  156. 'follow/lineupRecord2',
  157. ]
  158. },
  159. {
  160. root: 'pagesOther/',
  161. pages: [
  162. 'index',
  163. 'integralRecord',
  164. 'channel/index',
  165. 'foodout/index',
  166. 'map/dtl',
  167. 'map/dtl2',
  168. 'map/metro',
  169. 'map/aftermetro',
  170. 'map/vr',
  171. 'map/plan',
  172. 'bankRate/index',
  173. 'brand/index'
  174. ]
  175. },
  176. ],
  177. window: {
  178. backgroundTextStyle: 'light',
  179. navigationBarBackgroundColor: '#fff',
  180. navigationBarTitleText: 'WeChat',
  181. navigationBarTextStyle: 'black'
  182. },
  183. plugins: {
  184. // "chooseLocation": {
  185. // "version": "1.0.9",
  186. // "provider": "wx76a9a06e5b4e693e"
  187. // },
  188. "live-player-plugin": {
  189. "version": "1.3.4",
  190. "provider": "wx2b03c6e691cd7370"
  191. }
  192. },
  193. permission: {
  194. "scope.userLocation": {
  195. "desc": "你的位置信息将用于小程序定位"
  196. }
  197. }
  198. }
  199. componentWillMount () {
  200. // Taro.loadFontFace({
  201. // global: true,
  202. // family: 'pf',
  203. // source: 'url("http://h5.honglounews.com/PF.TTF")',
  204. // })
  205. mixins.initBaseData()
  206. }
  207. componentDidMount () {}
  208. componentDidShow () {}
  209. componentDidHide () {}
  210. componentDidCatchError () {}
  211. // 在 App 类中的 render() 函数没有实际作用
  212. // 请勿修改此函数
  213. render () {
  214. return (
  215. <Provider store={store}>
  216. <Index />
  217. </Provider>
  218. )
  219. }
  220. }
  221. Taro.render(<App />, document.getElementById('app'))