Merge branches 'dev_aliyun' and 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_home
杨树明 6 years ago
commit 1e70c9c245

@ -30,6 +30,7 @@ class Bankcardnumberverification extends Component {
window.document.title = '竞赛'; window.document.title = '竞赛';
// console.log("3获取用户信息"); // console.log("3获取用户信息");
// console.log(this.props) // console.log(this.props)
this.props.triggerRef(this);
//初始化值 //初始化值
if (this.props.bank_account) { if (this.props.bank_account) {
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
@ -40,40 +41,15 @@ class Bankcardnumberverification extends Component {
} }
} }
componentDidUpdate = (prevProps) => {
if (prevProps.bank_account != this.props.bank_account) {
console.log("componentDidUpdate");
console.log(this.props);
console.log(prevProps);
////console.log("Registration");
////console.log("componentDidUpdate");
////console.log(this.props.user.admin);
try {
if(this.props.bank_account){
this.props.form.setFieldsValue({
openingbank: this.props.bank_account.bank,
subbranch: this.props.bank_account.second_bank,
subbranchs: this.props.bank_account.card_no,
})
}
}catch (e) {
}
try {
if(prevProps.bank_account){
this.props.form.setFieldsValue({
openingbank:prevProps.bank_account.bank,
subbranch: prevProps.bank_account.second_bank,
subbranchs: prevProps.bank_account.card_no,
})
}
}catch (e) {
} setdata(bank,second_bank,card_no){
this.props.form.setFieldsValue({
openingbank: bank,
} subbranch: second_bank,
subbranchs:card_no,
})
}
componentDidUpdate = (prevProps) => {
} }
yhBankstrue = () => { yhBankstrue = () => {
@ -83,16 +59,34 @@ class Bankcardnumberverification extends Component {
axios.patch(url, { axios.patch(url, {
user_id:this.props.userdata.id, user_id:this.props.userdata.id,
bank: values.openingbank, bank: values.openingbank,
second_bank: values.subbranchs, second_bank: values.subbranch ,
card_no: values.subbranch card_no: values.subbranchs
}) })
.then((result) => { .then((result) => {
try { try {
if (result.data.status == 0) { if (result.data.status == 0) {
// console.log(JSON.stringify(result)); // console.log(JSON.stringify(result));
this.props.showNotification(`提交成功,等待审核!`); this.props.form.setFieldsValue({
this.props.getdata(this.props.userdata.id); openingbank: values.openingbank,
this.props.GetawardinformationAPI(); subbranch: values.subbranch,
subbranchs: values.subbranchs,
})
try {
this.props.showNotification(`提交成功,等待审核!`);
}catch (e) {
}
try {
this.props.getdata(this.props.userdata.id);
}catch (e) {
}
try {
this.props.GetawardinformationAPI();
}catch (e) {
}
} }
} catch (e) { } catch (e) {
@ -109,6 +103,24 @@ class Bankcardnumberverification extends Component {
render() { render() {
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
const {updating, seconds, secondsFlag, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state const {updating, seconds, secondsFlag, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state
var bank="";
if(this.props.bank_account){
if(this.props.bank_account.bank){
bank=this.props.bank_account.bank;
}
}
var second_bank ="";
if(this.props.bank_account){
if(this.props.bank_account.second_bank){
second_bank=this.props.bank_account.second_bank;
}
}
var card_no="";
if(this.props.bank_account){
if(this.props.bank_account.card_no){
card_no=this.props.bank_account.card_no;
}
}
return ( return (
<div> <div>
<div className="flexdirections mt36"> <div className="flexdirections mt36">
@ -188,7 +200,7 @@ class Bankcardnumberverification extends Component {
> >
{getFieldDecorator('openingbank', { {getFieldDecorator('openingbank', {
rules: [{ rules: [{
initialValue: this.state.openingbank&&this.state.openingbank, initialValue:this.state.openingbank,
required: true, required: true,
message: '请输入开户行', message: '请输入开户行',
}], }],
@ -203,7 +215,7 @@ class Bankcardnumberverification extends Component {
> >
{getFieldDecorator('subbranch', { {getFieldDecorator('subbranch', {
rules: [{ rules: [{
initialValue: this.props.subbranch&&this.props.subbranch, initialValue: this.state.subbranch,
required: true, required: true,
message: '请输入支行', message: '请输入支行',
}], }],
@ -218,7 +230,7 @@ class Bankcardnumberverification extends Component {
> >
{getFieldDecorator('subbranchs', { {getFieldDecorator('subbranchs', {
rules: [{ rules: [{
initialValue: this.props.subbranchs&&this.props.subbranchs, initialValue: this.state.subbranchs,
required: true, required: true,
message: '请输入账号', message: '请输入账号',
}], }],

@ -319,7 +319,7 @@ class CompetitionContentspdfpeopledata extends Component {
} }
bindRef = ref => { this.child = ref }
//撤销认证 //撤销认证
Cancellationofapplication = (index) => { Cancellationofapplication = (index) => {
let userid; let userid;
@ -529,7 +529,7 @@ class CompetitionContentspdfpeopledata extends Component {
{ {
bank_account_editable === true ? bank_account_editable === true ?
<Bankcardnumberverifications {...this.props} {...this.state} basicInfo={userdata} <Bankcardnumberverifications triggerRef={this.bindRef} {...this.props} {...this.state} basicInfo={userdata}
hideUpdating={(i) => this.hideUpdating(i)} hideUpdating={(i) => this.hideUpdating(i)}
getdata={(id) => this.getdata(id)} getdata={(id) => this.getdata(id)}
GetawardinformationAPI={() => this.GetawardinformationAPI()} GetawardinformationAPI={() => this.GetawardinformationAPI()}
@ -570,7 +570,7 @@ class CompetitionContentspdfpeopledata extends Component {
<div> <div>
{ {
admins===true? admins===true?
<Bankcardnumberverifications {...this.props} {...this.state} basicInfo={userdata} <Bankcardnumberverifications triggerRef={this.bindRef} {...this.props} {...this.state} basicInfo={userdata}
hideUpdating={(i) => this.hideUpdating(i)} hideUpdating={(i) => this.hideUpdating(i)}
getdata={(id) => this.getdata(id)} getdata={(id) => this.getdata(id)}
GetawardinformationAPI={() => this.GetawardinformationAPI()} GetawardinformationAPI={() => this.GetawardinformationAPI()}

Loading…
Cancel
Save