import { Component } from 'react'
import { View, RichText } from '@tarojs/components'
import './index.less'
import { getUserAgreement } from '../../../service'
export default class Index extends Component {
  state = {
    agreement: ''
  }
  componentDidMount () { 
    this.getUserAgreement()
  }
  // 获取用户协议
  getUserAgreement = async () => {
    const res = await getUserAgreement()
    this.setState({
      agreement: res.content
    })
  }
  render () {
    return (
      <View className='index'>
        {this.state.agreement && <RichText nodes={this.state.agreement} />}
      </View>
    )
  }
}
