app.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import '@tarojs/async-await'
  2. import Taro, { Component } from '@tarojs/taro'
  3. import { Provider } from '@tarojs/redux'
  4. import Index from './pages/index'
  5. import configStore from './store'
  6. import './app.scss'
  7. // 如果需要在 h5 环境中开启 React Devtools
  8. // 取消以下注释:
  9. // if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5') {
  10. // require('nerv-devtools')
  11. // }
  12. const store = configStore()
  13. class App extends Component {
  14. config = {
  15. pages: [
  16. 'pages/user-login/user-login', // 登录页
  17. 'pages/list/list', // 报告列表
  18. 'pages/increase/increase', // 生成报告
  19. 'pages/user/user', // 我的
  20. ],
  21. window: {
  22. backgroundTextStyle: 'light',
  23. navigationBarBackgroundColor: '#fff',
  24. navigationBarTitleText: 'RD-Al生成',
  25. navigationBarTextStyle: 'black'
  26. },
  27. tabBar: {
  28. color: "#666",
  29. selectedColor: "#b4282d",
  30. backgroundColor: "#fafafa",
  31. borderStyle: 'black',
  32. list: [{
  33. pagePath: "pages/list/list",
  34. iconPath: "./assets/tab-bar/home.png",
  35. selectedIconPath: "./assets/tab-bar/home-active.png",
  36. text: "报告列表"
  37. }, {
  38. pagePath: "pages/increase/increase",
  39. iconPath: "./assets/tab-bar/cate.png",
  40. selectedIconPath: "./assets/tab-bar/cate-active.png",
  41. text: "+生成报告"
  42. },{
  43. pagePath: "pages/user/user",
  44. iconPath: "./assets/tab-bar/user.png",
  45. selectedIconPath: "./assets/tab-bar/user-active.png",
  46. text: "我的"
  47. }]
  48. }
  49. }
  50. componentDidMount () {}
  51. componentDidShow () {}
  52. componentDidHide () {}
  53. componentCatchError () {}
  54. componentDidCatchError () {}
  55. // 在 App 类中的 render() 函数没有实际作用
  56. // 请勿修改此函数
  57. render () {
  58. return (
  59. <Provider store={store}>
  60. <Index />
  61. </Provider>
  62. )
  63. }
  64. }
  65. Taro.render(<App />, document.getElementById('app'))