import React from 'react';
import { Icon, message, Row, Col, Select, Radio, Checkbox, Input, InputNumber, Button, Table, Spin, Pagination } from 'antd';
import '../portal.less';
import logoImg from '../../../../image/logo.png';
import searchImg from '../../../../image/search.png';
import { techFieldList, getTechField } from '../../DicTechFieldList';
import { provinceList, getProvince } from '../../NewDicProvinceList';
import { companySearch } from '../../tools';
import ajax from 'jquery/src/ajax/xhr.js';
import $ from 'jquery/src/ajax';
import avatarImg from '../../../../image/avatarImg.png';
const SubContent = React.createClass({
loadData(pageNo) {
this.setState({
loading: true
});
$.ajax({
method: "get",
dataType: "json",
url: globalConfig.context + "/portal/search/subscriberList",
data: {
"level": this.state.level, //认证状态 (0--未认证,1--认证)
"type": this.state.type, //用户类型 (0--个人用户,1--组织用户)
"field": this.state.firstField ? ((this.state.firstField || '') + (this.state.secondField ? (',' + this.state.secondField) : '') + (this.state.thirdField ? (',' + this.state.thirdField) : '')) : null,
"province": this.state.province,
"city": this.state.city,
"area": this.state.area,
"name": this.state.searchName,
"pageNo": pageNo || 1,
"pageSize": this.state.pagination.pageSize
},
success: function (data) {
let theArr = [];
if (!data.data || !data.data.list) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
};
} else {
for (let i = 0; i < data.data.list.length; i++) {
let thisdata = data.data.list[i];
theArr.push({
key: i,
uid: thisdata.uid, //用户ID
identityId: thisdata.identityId, //认证ID (详情接口传入ID)
username: thisdata.username,// 用户名称
unitName: thisdata.unitName,
type: this.state.type,
personPortraitUrl: thisdata.personPortraitUrl,//用户头像URL
logoUrl: thisdata.logoUrl,
achievementNum: thisdata.achievementNum, //科技成果数量
demandNum: thisdata.demandNum, //科技需求数量
province: thisdata.province
});
};
};
this.state.pagination.pageNo = data.data.pageNo;
this.state.pagination.total = data.data.totalCount;
this.setState({
dataSource: theArr,
pagination: this.state.pagination
});
}.bind(this),
}).done(function (data) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
};
this.setState({
loading: false
});
}.bind(this));
},
getInitialState() {
return {
loading: false,
type: 1,
fieldFirstOption: [],
fieldSecondOption: [],
fieldThirdOption: [],
pagination: {
pageNo: 1,
pageSize: 12,
total: 0
},
dataSource: []
};
},
componentWillMount() {
let theFieldArr = [], theProvinceArr = [];
theFieldArr.push(