连续复制
一键复制
一键打包

react 生命周期

  constructor(props) {
    super(props);
    console.log(this);
    this.state = {
      url: ''
    };
  }

  componentWillMount = async () => {
    const { uuid }: any = Taro.getCurrentInstance().router?.params;
    const where: any = {};
    if (uuid) {
      where.uuid = uuid
    }
    await api.index(where).then((res) => {
      // console.log(res.data.data.url);
      let data = JSON.parse(atob(res.data.data));
      this.setState({
        url: data.url
      })
    })
    // console.log(Taro.getCurrentPages()[0].$taroParams)
    console.log('componentWillMount')
  }

  componentDidMount() {
    console.log('componentDidMount')
  }

  componentWillUnmount() {
    console.log('componentWillUnmount')
  }

  componentDidShow() {
    console.log('componentDidShow')
  }

  componentDidHide() {
    console.log('componentDidHide')
  }

  render() {
    return (
      <View>
        {/* <Text>{this.state.url}</Text> */}
        <WebView src={this.state.url} />
      </View>
    );
  }