app.jsx 4.5 KB

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