import React, { Component } from 'react'
import { connect } from 'dva';
import { SearchBar, Modal, Menu, Toast } from 'antd-mobile';
import router from 'umi/router';
import styles from './index.less';

class ClassPage extends Component {
  constructor(props) {
    super(props)
    this.state = {
        id:""
    }
  }
  componentDidMount() {
    this.setState({
      Id:this.props.location.query.Id,
    },()=>{
        this.requsetData();
    })
  }
  requsetData=()=>{
    let id = this.state.id
    request({
      url: WXMpAPI + '/wx/content/article/queryArticleByArticleId/'+id,
      method: "post",
  }).then(function (getListRes) {
      if (getListRes.success == 1) {
        self .setState({
          data:getListRes.result
        })
        console.log(getListRes.items);
      }
  });
  }
  render() {
    return (
      // <div className='detailIndex'>
      //   <h2>鲁抗  参鹿扶正胶囊 0.35g*48粒</h2>
      //   <div className="Subtitle"><span className="author">李某某</span><span className="date">2020-4-17  10:39:30</span></div>
      //   <div className="detailcontent">
      //     主要成分:人参、鹿角胶、熟地黄、枸杞子、肉苁蓉、巴戟天、葫芦巴、茯苓、沙棘、五味子、五加皮、半枝莲等20味。 适应症/功能主治
      //   </div>
      //   <div className="footer">阅读 1000</div>
      // </div>
      <div className='detailIndex'>
        <h2>{this.state.data.articleTitle}</h2>
    <div className="Subtitle"><span className="author">{this.state.data.articleAuthor}</span><span className="date">{this.state.data.articleCreatedate}</span></div>
        <div className="detailcontent">{
          this.state.data.articleContent
        }
        </div>
      <div className="footer">阅读 {this.state.data.articleCardinalnumber}</div>
      </div>
    )
  }
}


export default ClassPage;
