import React from 'react'; import { Radio, Select, Input, Upload, Button , Checkbox } from 'antd'; import { UploadOutlined } from '@ant-design/icons'; import axios from "axios"; // import { $Axios } from '../../common/publish'; import select_data from '../../common/ssq'; import '../center-w/centerW.scss' export default class centerW extends React.Component { constructor(props) { super(props) this.state = { selectData : select_data, fileList : [[],[],[],[],[],[],[],[],[],[],[],[]], fileList_t : null, headerProps : { action: 'http://paytest.zhongsou.com/payment/file.upload.groovy', multiple: false, }, imgType : null, Params : this.props.arr, tradingScenarios : [], datas : {}, } } componentDidMount() { this.props.onRef(this) } toParent = (data) => { this.props.parent.getParams_w(this, data) } InputWdata(e){ let Params = { legalPersonName : document.getElementById("legalPersonName").value,//法人姓名 profession : this.state.Params.profession, //法人职业 legalPersonIdType : this.state.Params.legalPersonIdType,//法人证件类型 legalPersonIdNo : document.getElementById("legalPersonIdNo").value, //证件号码 idEffectiveDateStart : '',//法人证件有效期开始日期 idEffectiveDateEnd : '',//法人证件有效期结束日期 cerNoType : this.state.Params.cerNoType,//企业证件类型 cerNo : document.getElementById("cerNo").value,//企业资质证书编号 sellingArea : document.getElementById("sellingArea").value,//营业面积 staffSize : document.getElementById("staffSize").value,//公司员工规模 tradingScenarios : this.state.Params.tradingScenarios,//交易场景说明 webSite : document.getElementById("webSite").value,//网站网址 webSiteName : document.getElementById("webSiteName").value,//网站名称 icp : document.getElementById("icp").value,//ICP备案号 appName : document.getElementById("appName").value,//APP名称 wechatAppletName : document.getElementById("wechatAppletName").value,//公众号/小程序/生活号 testAccountInfo : '',//测试账户信息 businessLicensePath : '',//营业执照照片路径 openAccountPath : '',//开户许可证照片路径 legalIdCardProsPath : '',//法人证件人像面路径 legalIdCardConsPath : '',//法人证件国徽面路径 desireAuthPath : '',//确认入网意愿视频路径 holdingIdCardPath : '',//法人手持证件影印件路径 webSitePath : '',//商户网址截图影印件路径 wechatAppletPath : '',//公众号/小程序/生活号业务流程截图影印件路径 appPath : '',//APP首页截图影印件路径 legalPersonBankCardPath : '',//法人银行卡图影印件路径 desireAuthOtherPath : '',//确认入网意愿其他验证方式路径 otherCerPath : '',//其他资质文件路径 } return Params } childMethod () { //暴露给父组件的方法,集合当前页面拿到的参数存入缓存 let data = this.InputWdata(); // console.log(data) this.toParent(data) } btnClick(e){ //区分上传图片类型 this.setState({ imgType : e }) } selectChange_1(value) { //法人职业类型选择 console.log(value) this.state.Params.profession = value; } selectChange_2(value) { //法人证件类型选择 this.state.Params.legalPersonIdType = value; } selectChange_3(value) { // 企业证件类型选择 this.state.Params.cerNoType = value; } CheckChange(e){ this.state.Params.tradingScenarios = e.toString() console.log(e) } onChangeUpload(info){ let fileList = [...info.fileList]; this.state.fileList = fileList } UploadImgstate(){ //修改上传图片状态 let fileList = this.state.fileList; let imgType = this.state.imgType; //当前上传图片点击的Index fileList[0].status = 'done' //上传成功之后的状态 自动修改 fileList[0].response = fileList[0].name //图片上传成功之后展示的TIP let arr = this.state.fileList; arr[imgType] = fileList console.log(arr) this.setState({ fileList : arr }) } handleChange(e){ let file = e.file; let that_ = this; console.log(file) const formData = new FormData(); formData.append('file', file) formData.append('merchantSerialNumber', 'MCT_202106262257460929210') let config = { method: 'post', headers: { 'Content-Type': 'multipart/form-data' } } axios.post('http://paytest.zhongsou.com/payment/file.upload.groovy',formData, config).then((res) => { let status = res.data.status; let fileList = that_.state.fileList; that_.setState({ fileList_t : fileList }) if(status == 200){ // that_.UploadImgstate() } }).catch((error) => { //上传失败后设置回之前的上前数量与状态 // let fileList_t = that_.state.fileList_t; // that_.setState({ // fileList : fileList_t // }) console.log(error); }) } // defaultValue={Params.signedName} render() { const { selectData, headerProps, fileList ,Params , } = this.state; const { Option } = Select; return(
法人姓名*
法人职业 :
法人证件类型*
法人证件号码*
企业证件类型 :
资质证书编号 :
营业面积 :
公司员工规模 :
交易场景说明 :
网站网址 :
网站名称 :
ICP备案号 :
APP名称 :
公众号/小程序/生活号 :
{selectData.rightArray.map((item,index) => (
{item.txt} :
{fileList[index].length === 0 &&
格式限制为{item.type},最大不超过50M
}
))}
) } }