import React from 'react'; import { Icon, Button, Input, Select, Spin, message, Col, Row } from 'antd'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import './userList.less'; const CustomerSearch = React.createClass({ loadData(pageNo) { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/supervise/findUser", data: { "name": this.state.searchName || undefined, "mobile": this.state.searchMobile || undefined, "type": Number(this.state.searchType) }, success: function (data) { if (data.error && data.error.length) { message.warning(data.error[0].message); } this.setState({ searchResult: data.data ? 名称为[ {data.data} ]的 {Number(this.state.searchType) ? '[团体]' : '[个人]'} 用户存在 : 未查找到该用户! }) }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, getInitialState() { return { loading: false, searchType: '0' }; }, search() { this.loadData(); }, render() { return (
客户查询
用户名称 { this.setState({ searchName: e.target.value }) }} /> 用户登录名 { this.setState({ searchMobile: e.target.value }) }} /> 查询结果 {this.state.searchResult}
); } }); export default CustomerSearch;