import React, { Component } from "react"; import { Alert } from 'antd'; import { connect } from 'dva'; import { BhAccountSendVerifyCode, getComWalletAccountAmount, comWalletAccountExtract, getWalletRechargeToken, taskComBhAccountGetComBhAccountAmount, taskComBhAccountWithdrawa } from '../../../../services/api'; import $modal from '../../../../utils/modal'; import $nModal from '../../../../utils/modal/nModal'; import { SMS_OP_WITHDRAW } from '../../../../common/shortMessage'; import { Tooltip, Icon, Button, Modal, notification, Radio, Form, Input } from 'antd'; import WalletModal from './WalletModal'; import UpdateMobileModal from './UpdateMobileModal'; import { formItemLayout1, commanFormItemLayout } from '../../../../constants/formItemLayout'; import yl from '../../../../assets/images/wallet/yl.png'; import cq from '../../../../assets/images/wallet/cq.png'; @connect(state => ({ companyInfo: state.global.companyInfo })) @Form.create() export default class StepFive extends Component { constructor(props, context) { super(props, context); if (this.props.companyInfo) { window.sessionStorage.setItem('companyInfo', JSON.stringify(this.props.companyInfo)); } this.state = { companyInfo: this.props.companyInfo, // 公司信息 rechargeVisbale: false, rechargeTime: 0, // 充值倒计时时间 rechargeTimer: null, //充值倒计时定时器 rechargeBtnName: '获取验证码', //充值发送验证码按钮名字 codeValue: '', //提现短信验证码 moneyReg: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, //金额正则 cashOutVisbale: false, // 提现对话框 accountInfo: {}, // 资金信息 accountInfo: {}, //账户信息 payUrl: '', //充值表单提交url time: 0, // 可发送验证码剩余时间 btnName: '获取验证码', // 发送验证码按钮名字 timer: null, // 验证码定时器 orderId: '',//提现的时候短信验证码发送后返回的orderid 在提现接口中要用到 editModalVisble: false, // 修改对公账户模态框 updateMobileModal:false,//修改手机号 accountStatusValue: { 0: '正常', 7: '客户绑卡未激活', 8: "平台客户开户处理中", 9: '普通客户开户处理中', } }; } componentDidMount() { if (window.sessionStorage.getItem('companyInfo')) { this.setState({ companyInfo: JSON.parse(window.sessionStorage.getItem('companyInfo')) }); } } componentDidUpdate() { this.__initPage(); } static getDerivedStateFromProps(nextProps, prevState) { let props = { bankInfo: nextProps.bankInfo }; return props; } //提现 _cashOutSubmit = e => { e.preventDefault(); this.props.form.validateFields((err, values) => { if (!err) { const POST_DATA = { ...values, }; taskComBhAccountWithdrawa(POST_DATA).then(res => { $modal('提交提现成功!', '到账时间:根据人行处理转账情况决定,一般为实时到账。', [{ text: '确定', type: 'primary', onPress: () => { // this.__initPage(); taskComBhAccountGetComBhAccountAmount().then(res => { this.setState({ accountInfo: res.data }); }); this.setState({ cashOutVisbale: false }); } }], 'success'); }); } }); } __initPage() { const { bankInfo } = this.props; if (!this.state.hasLoad) { if (bankInfo) { this.setState({ hasLoad: true }); taskComBhAccountGetComBhAccountAmount().then(res => { this.setState({ accountInfo: res.data }); }); } } } render() { const { getFieldDecorator, getFieldValue } = this.props.form; const { rechargeVisbale, cashOutVisbale, bankInfo } = this.state; return (
{this.state.accountInfo.totalAmount}
:{this.state.accountInfo.availableAmount}
:{this.state.accountInfo.frozenAmount}
:注:钱包提现服务,由中国银联提供技术支持与资金数据处理服务,确保您的资金安全到账!
{(() => { const { getFieldDecorator } = this.props.form; return ({this.state.bankInfo.mobilePhone}