import { Component } from 'react' import Taro from '@tarojs/taro' // import preFetchData from '@/utils/preFetchData' import store, { StoreRoot } from './store' import './app.less' class App extends Component { // componentDidShow(options) { // if (options.path === 'pages/index/index' && options.query?.tab === '1') { // } // } onLaunch(options) { console.group('APP Launch') console.debug(options) console.groupEnd() const { login } = store.getModel('person').getState() Taro.login({ success: (res) => { const { code } = res; login({ code }) } }) // const { login } = store.getModel('person').getState() // 预拉取数据 // preFetchData().then((fetchData) => { // const { fromType, recommender, scene: qrCodeId, mpOpenId, ...leftParams } = options.query // Taro.setStorageSync({ key: 'scene', data: qrCodeId }) // // // 登录获取人员信息 // // Taro.login({ // // success: (res) => { // // const { code } = res; // // login({ code, personId: fetchData.personId, fromType, recommender, qrCodeId, mpOpenId, ...leftParams }) // // } // // }) // }).catch(() => { // Taro.showToast({ // title: '网络异常, 请退出重试', // icon: 'none', // }) // }) } // this.props.children 是将要会渲染的页面 render() { return ( {this.props.children} ) } } export default App