import React, { Component } from 'react'; import { Button,Radio ,message,Row,Col, Spin,Pagination} from 'antd'; import axios from 'axios'; import './collection.less'; class Collection extends Component { constructor(props) { super(props); this.state = { loading:false, current:1, nub:'1' }; } //服务 loadDataService(page){ this.setState({ loading:true, }) let url = globalConfig.context + '/api/user/portal/listInterestedInExpert' axios.get(url,{ params:{ pageNo:page||1, pageSize:8 } }) .then(data=>{ let theData=data.data.data, theArr = []; if (!data.data || !data.data.data.list) { if (data.data.error && data.data.error.length) { message.warning(data.data.error[0].message); }; } else { for (let i = 0; i < theData.list.length; i++) { let thisdata = theData.list[i]; theArr.push({ key: i, id: thisdata.uid, name:thisdata.username, introduce:thisdata.introduction&&thisdata.introduction.length>40?thisdata.introduction.substr(0,40)+'...':thisdata.introduction, img: thisdata.headPortraitUrl, //编号 }); }; }; this.setState({ loading:false, dataList:theArr, total:data.data.data.totalCount }) }) } componentWillMount(){ this.loadDataService(1) } tabFun(e){ this.setState({ nub: e.target.value }) switch(e.target.value){ case '1': this.loadDataService(1) break; } } //分页 onShowSizeChange(current, pageSize){ this.setState({ current:current, pageSize:pageSize }) } jump(item){ let url=''; switch(this.state.nub){ case '1': url = globalConfig.context+`/portal/subscriberDetail.html?uid=${item.id}&type=0`; break; } window.open(url); } render() { const dataList =this.state.dataList || []; return
智者,您困惑中的指明灯
{item.introduce}
{item.name?item.name:'佚名'}