import Taro , { Component , Config } from "@tarojs/taro" ; import "@tarojs/async-await" ; import { Provider } from "@tarojs/redux" ; import "./config/taroConfig" ; import "./utils/request" ; import Index from "./pages/index" ; import dva from './utils/dva' ; import models from './models' ; import './app.scss' ; import { globalData } from "./utils/common" ; const dvaApp = dva . createApp ( { initialState : { } , models : models , } ) ; const store = dvaApp . getStore ( ) ; class App extends Component { config : Config = { pages : [ 'pages/index/index' ] , window : { backgroundTextStyle : 'light' , navigationBarBackgroundColor : '#fff' , navigationBarTitleText : 'WeChat' , navigationBarTextStyle : 'black' } } ; memberof async componentDidMount ( ) { const referrerInfo = this . $router . params . referrerInfo ; const query = this . $router . params . query ; ! globalData . extraData && ( globalData . extraData = { } ) ; if ( referrerInfo && referrerInfo . extraData ) { globalData . extraData = referrerInfo . extraData ; } if ( query ) { globalData . extraData = { ... globalData . extraData , ... query } ; } const sys = await Taro . getSystemInfo ( ) ; sys && ( globalData . systemInfo = sys ) ; } componentDidShow ( ) { } componentDidHide ( ) { } componentDidCatchError ( ) { } render ( ) { return ( < Provider store = { store } > < Index /> < /Provider>); } } Taro . render ( < App />, document.getElementById('app'));