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.
55 lines
1.3 KiB
TypeScript
55 lines
1.3 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 "./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;
|
|
}
|
|
|
|
// 每次进入小程序,删除可能残留的同步状态
|
|
Taro.removeStorageSync("isSyncHistory");
|
|
|
|
// 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;
|