import Taro from "@tarojs/taro";
import { Component, PropsWithChildren } from "react";
import "./app.less";
// // html4
// import "@tarojs/taro/html.css";
// // html5
// import "@tarojs/taro/html5.css";

import { Provider } from "react-redux";
import store from "./store";
import './iconfont/iconfont.css'
import "taro-ui/rn/style/components/icon.scss";

import { go } from "./utils/traoAPI";

class App extends Component<PropsWithChildren> {
  // 可以使用所有的 React 生命周期方法
  componentDidMount() {}

  // 对应 onLaunch
  onLaunch(options) {
    // console.log("onLaunch", options);
    if (options.scene == 1007 || options.scene == 1008) {
      return;
    }

    // go("/pages/instrument_clickin_upload/index");
    // go("/pages/instrument/intro");
    // Taro.switchTab({
    //   url: "/pages/user/user",
    // });
  }

  onError(error) {
    console.log("error 错误捕获", error);
  }

  // 对应 onShow
  componentDidShow() {}

  // 对应 onHide
  componentDidHide() {}

  // this.props.children 是将要会渲染的页面
  render() {
    // return this.props.children
    return <Provider store={store} children={this.props.children}></Provider>;
  }
}

export default App;
