|
@@ -25,40 +25,41 @@ const UserForm = Form.create()(React.createClass({
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + "/api/admin/userDetail",
|
|
|
data: {
|
|
|
- uid: this.props.uid
|
|
|
+ uid: this.state.uid
|
|
|
},
|
|
|
success: function (data) {
|
|
|
- if (!data.data) {
|
|
|
+ let thisData = data.data;
|
|
|
+ if (!thisData) {
|
|
|
if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
};
|
|
|
- return;
|
|
|
+ thisData = {};
|
|
|
};
|
|
|
let d = new Date()
|
|
|
- if (data.data.dateOfBirthMonth && data.data.dateOfBirthYear) {
|
|
|
- d.setMonth(data.data.dateOfBirthMonth - 1);
|
|
|
- d.setYear(parseInt(data.data.dateOfBirthYear));
|
|
|
+ if (thisData && thisData.dateOfBirthMonth && thisData.dateOfBirthYear) {
|
|
|
+ d.setMonth(thisData.dateOfBirthMonth - 1);
|
|
|
+ d.setYear(parseInt(thisData.dateOfBirthYear));
|
|
|
};
|
|
|
addressInit('cmbProvince', 'cmbCity', 'cmbArea',
|
|
|
- data.data.province, data.data.city, data.data.area);
|
|
|
+ thisData.province, thisData.city, thisData.area);
|
|
|
this.setState({
|
|
|
- username: data.data.username,
|
|
|
- sex: data.data.sex,
|
|
|
- id: data.data.id,
|
|
|
+ username: thisData.username,
|
|
|
+ sex: thisData.sex,
|
|
|
+ id: thisData.id,
|
|
|
birth: d,
|
|
|
- idNumber: data.data.idNumber,
|
|
|
- positiveIdUrl: data.data.positiveIdUrl,
|
|
|
- oppositeIdUrl: data.data.oppositeIdUrl,
|
|
|
- aftUsername: data.data.aftUsername,
|
|
|
- contactMobile: data.data.contactMobile,
|
|
|
- bankName: data.data.bankName,
|
|
|
- bankAccount: data.data.bankAccount,
|
|
|
- bankCardNumber: data.data.bankCardNumber,
|
|
|
- amountMoney: data.data.amountMoney,
|
|
|
- auditStatus: String(data.data.auditStatus),
|
|
|
- process: data.data.process,
|
|
|
- paymentDateFormattedDate: data.data.paymentDateFormattedDate,
|
|
|
- paymentDate: data.data.paymentDate
|
|
|
+ idNumber: thisData.idNumber,
|
|
|
+ positiveIdUrl: thisData.positiveIdUrl,
|
|
|
+ oppositeIdUrl: thisData.oppositeIdUrl,
|
|
|
+ aftUsername: thisData.aftUsername,
|
|
|
+ contactMobile: thisData.contactMobile,
|
|
|
+ bankName: thisData.bankName,
|
|
|
+ bankAccount: thisData.bankAccount,
|
|
|
+ bankCardNumber: thisData.bankCardNumber,
|
|
|
+ amountMoney: thisData.amountMoney,
|
|
|
+ auditStatus: thisData.auditStatus,
|
|
|
+ process: thisData.process,
|
|
|
+ paymentDateFormattedDate: thisData.paymentDateFormattedDate,
|
|
|
+ paymentDate: thisData.paymentDate
|
|
|
});
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
@@ -120,10 +121,12 @@ const UserForm = Form.create()(React.createClass({
|
|
|
},
|
|
|
componentDidMount() {
|
|
|
addressInit('cmbProvince', 'cmbCity', 'cmbArea');
|
|
|
+ this.state.uid = this.props.uid;
|
|
|
this.loadData();
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
if (!this.props.visible && nextProps.visible) {
|
|
|
+ this.state.uid = nextProps.uid;
|
|
|
this.loadData();
|
|
|
};
|
|
|
},
|
|
@@ -142,7 +145,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="用户名"
|
|
|
>
|
|
|
{getFieldDecorator('username', {
|
|
|
- initialValue: this.state.username || null
|
|
|
+ initialValue: this.state.username
|
|
|
})(
|
|
|
<Input />
|
|
|
)}
|
|
@@ -152,7 +155,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="性别"
|
|
|
>
|
|
|
{getFieldDecorator('sex', {
|
|
|
- initialValue: this.state.sex || null
|
|
|
+ initialValue: this.state.sex
|
|
|
})(
|
|
|
<Radio.Group>
|
|
|
<Radio value="男">男</Radio>
|
|
@@ -175,7 +178,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="身份证号"
|
|
|
>
|
|
|
{getFieldDecorator('idNumber', {
|
|
|
- initialValue: this.state.idNumber || null
|
|
|
+ initialValue: this.state.idNumber
|
|
|
})(
|
|
|
<Input />
|
|
|
)}
|
|
@@ -205,7 +208,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="认证姓名"
|
|
|
>
|
|
|
{getFieldDecorator('aftUsername', {
|
|
|
- initialValue: this.state.aftUsername || null
|
|
|
+ initialValue: this.state.aftUsername
|
|
|
})(
|
|
|
<Input />
|
|
|
)}
|
|
@@ -215,7 +218,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="联系电话"
|
|
|
>
|
|
|
{getFieldDecorator('contactMobile', {
|
|
|
- initialValue: this.state.contactMobile || null
|
|
|
+ initialValue: this.state.contactMobile
|
|
|
})(
|
|
|
<Input />
|
|
|
)}
|
|
@@ -238,7 +241,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="开户银行"
|
|
|
>
|
|
|
{getFieldDecorator('bankAccount', {
|
|
|
- initialValue: this.state.bankAccount || null
|
|
|
+ initialValue: this.state.bankAccount
|
|
|
})(
|
|
|
<Input />
|
|
|
)}
|
|
@@ -248,7 +251,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="银行卡号"
|
|
|
>
|
|
|
{getFieldDecorator('bankCardNumber', {
|
|
|
- initialValue: this.state.bankCardNumber || null
|
|
|
+ initialValue: this.state.bankCardNumber
|
|
|
})(
|
|
|
<Input />
|
|
|
)}
|
|
@@ -258,7 +261,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="打款金额"
|
|
|
>
|
|
|
{getFieldDecorator('amountMoney', {
|
|
|
- initialValue: this.state.amountMoney || null
|
|
|
+ initialValue: this.state.amountMoney
|
|
|
})(
|
|
|
<Input />
|
|
|
)}
|
|
@@ -278,7 +281,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="认证状态"
|
|
|
>
|
|
|
{getFieldDecorator('auditStatus', {
|
|
|
- initialValue: this.state.auditStatus || null
|
|
|
+ initialValue: this.state.auditStatus
|
|
|
})(
|
|
|
<Select placeholder="选择认证状态" style={{ width: 200 }}
|
|
|
onChange={(e) => { this.state.auditStatus = e }}>
|
|
@@ -295,7 +298,7 @@ const UserForm = Form.create()(React.createClass({
|
|
|
label="认证步骤"
|
|
|
>
|
|
|
{getFieldDecorator('process', {
|
|
|
- initialValue: this.state.process || null
|
|
|
+ initialValue: this.state.process
|
|
|
})(
|
|
|
<Input />
|
|
|
)}
|