import React, {Component} from 'react'; import {Button, Layout, Input, Form} from 'antd'; import axios from 'axios'; import {getImageUrl} from 'educoder'; import mycompetotionchild from './mycompetotionchild.css'; import {getHiddenName} from "../../../../user/account/AccountBasicEdit"; import '../../../../courses/css/Courses.css' export const identityMap = {"teacher": "教师", "student": "学生", "professional": "专业人士"} class Bankcardnumberverification extends Component { constructor(props) { super(props) this.state = { basicInfo: {}, updating: '', secondsFlag: false, seconds: 60, phonebool: false, emailbool: false, formationdata: [], bank_account_editable: false, leader: false, bank_account: undefined, certification: 1 } } componentDidMount() { window.document.title = '竞赛'; // console.log("3获取用户信息"); // console.log(this.props) try { this.props.triggerRef(this); }catch (e) { } console.log(this.props.bank_account); //初始化值 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, }) this.setState({ openingbank: this.props.bank_account.bank, subbranch: this.props.bank_account.second_bank, subbranchs: this.props.bank_account.card_no, }) } } setdata(bank,second_bank,card_no){ this.props.form.setFieldsValue({ openingbank: bank, subbranch: second_bank, subbranchs:card_no, }) } 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, }) } this.setState({ openingbank: this.props.bank_account.bank, subbranch: this.props.bank_account.second_bank, subbranchs: this.props.bank_account.card_no, }) }catch (e) { } } } yhBankstrue = () => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { let url = `/competitions/${this.props.match.params.identifier}/prize_leader_account.json`; axios.patch(url, { user_id:this.props.userdata.id, bank: values.openingbank, second_bank: values.subbranch , card_no: values.subbranchs }) .then((result) => { try { if (result.data.status === 0) { try { // console.log(values.openingbank); // console.log(values.subbranch); // console.log(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 { this.props.showNotification(`提交成功,等待审核!`); }catch (e) { } try { this.props.getdata(this.props.userdata.id); }catch (e) { } try { this.props.GetawardinformationAPI(); }catch (e) { } } } catch (e) { } }).catch((error) => { console.log(error); }) } }) } render() { const {getFieldDecorator} = this.props.form; const {updating, seconds, secondsFlag, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state return (
签/领/开户行及银行卡号
为保障奖金的及时发放,请队长如实填写你名下的银行卡信息
取消