Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_home
杨树明 5 years ago
commit bbd3177c26

@ -30,7 +30,13 @@ 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); try {
this.props.triggerRef(this);
}catch (e) {
}
console.log(this.props.bank_account);
//初始化值 //初始化值
if (this.props.bank_account) { if (this.props.bank_account) {
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
@ -38,6 +44,11 @@ class Bankcardnumberverification extends Component {
subbranch: this.props.bank_account.second_bank, subbranch: this.props.bank_account.second_bank,
subbranchs: this.props.bank_account.card_no, subbranchs: this.props.bank_account.card_no,
}) })
this.setState({
openingbank: this.props.bank_account.bank,
subbranch: this.props.bank_account.second_bank,
subbranchs: this.props.bank_account.card_no,
})
} }
} }
@ -50,7 +61,39 @@ class Bankcardnumberverification extends Component {
}) })
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if (prevProps.bank_account != this.props.bank_account) {
let url = `/competitions/${this.props.match.params.identifier}/prize.json`;
let query=this.props.location&&this.props.location.search;
const types = query.split('user_id=')
let userid;
if(types[1]===undefined){
userid=this.props.user&&this.props.user.user_id;
}else{
userid=types[1];
}
axios.get(url,{params:{
user_id:userid,
}
}).then((result) => {
if (result.data) {
try {
this.props.form.setFieldsValue({
openingbank: result.data.bank_account.bank,
subbranch: result.data.bank_account.second_bank,
subbranchs: result.data.bank_account.card_no,
});
this.setState({
openingbank: result.data.bank_account.bank,
subbranch: result.data.bank_account.second_bank,
subbranchs: result.data.bank_account.card_no,
})
}catch (e) {
}
}
}).catch((error) => {
console.log(error);
})
}
} }
yhBankstrue = () => { yhBankstrue = () => {
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
@ -64,13 +107,25 @@ class Bankcardnumberverification extends Component {
}) })
.then((result) => { .then((result) => {
try { try {
if (result.data.status == 0) { if (result.data.status === 0) {
// console.log(JSON.stringify(result)); try {
this.props.form.setFieldsValue({ // console.log(values.openingbank);
openingbank: values.openingbank, // console.log(values.subbranch);
subbranch: values.subbranch, // console.log(values.subbranchs);
subbranchs: values.subbranchs, this.props.form.setFieldsValue({
}) openingbank: values.openingbank,
subbranch: values.subbranch,
subbranchs: values.subbranchs,
});
this.setState({
openingbank: values.openingbank,
subbranch: values.subbranch,
subbranchs: values.subbranchs,
})
}catch (e) {
}
try { try {
this.props.showNotification(`提交成功,等待审核!`); this.props.showNotification(`提交成功,等待审核!`);
@ -103,24 +158,6 @@ 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">

Loading…
Cancel
Save