You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB
TypeScript

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 "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;
}
// Taro.switchTab({
// url: "pages/index/index",
// });
// go("/pages/initiate/initiate"); // 介绍页
// go("/pages/entry/entry"); // 介绍页
// go("/pages/userInfo/userInfo"); // 个人信息完善
// go("/pages/register/register");
// go("/pages/instrument/instrument");
// go("/pages/userInfoDetail/userInfoDetail");
// Taro.reLaunch({
// 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;