app.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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/reportdetail', // 报告详情
  17. 'pages/user/templatedetail', // 模板详情
  18. 'pages/user-login/user-login', // 登录页
  19. 'pages/list/list', // 报告列表
  20. 'pages/increase/increase', // 生成报告
  21. 'pages/user/user', // 我的
  22. 'pages/user/template', // 模板列表
  23. ],
  24. window: {
  25. backgroundTextStyle: 'light',
  26. navigationBarBackgroundColor: '#fff',
  27. navigationBarTitleText: 'RD-Al生成',
  28. navigationBarTextStyle: 'black'
  29. },
  30. tabBar: {
  31. color: "#666",
  32. selectedColor: "#b4282d",
  33. backgroundColor: "#fafafa",
  34. borderStyle: 'black',
  35. list: [{
  36. pagePath: "pages/list/list",
  37. iconPath: "./assets/tab-bar/home.png",
  38. selectedIconPath: "./assets/tab-bar/home-active.png",
  39. text: "报告列表"
  40. }, {
  41. pagePath: "pages/increase/increase",
  42. iconPath: "./assets/tab-bar/cate.png",
  43. selectedIconPath: "./assets/tab-bar/cate-active.png",
  44. text: "+生成报告"
  45. },{
  46. pagePath: "pages/user/user",
  47. iconPath: "./assets/tab-bar/user.png",
  48. selectedIconPath: "./assets/tab-bar/user-active.png",
  49. text: "我的"
  50. }]
  51. }
  52. }
  53. componentDidMount () {}
  54. componentDidShow () {}
  55. componentDidHide () {}
  56. componentCatchError () {}
  57. componentDidCatchError () {}
  58. // 在 App 类中的 render() 函数没有实际作用
  59. // 请勿修改此函数
  60. render () {
  61. return (
  62. <Provider store={store}>
  63. <Index />
  64. </Provider>
  65. )
  66. }
  67. }
  68. Taro.render(<App />, document.getElementById('app'))