upload
This commit is contained in:
@@ -17,6 +17,7 @@ import { IdentityModelState } from './model';
|
|||||||
|
|
||||||
import kycIdCover from '@/assets/kycIdCover.svg';
|
import kycIdCover from '@/assets/kycIdCover.svg';
|
||||||
import kycIdBack from '@/assets/kycIdBack.svg'
|
import kycIdBack from '@/assets/kycIdBack.svg'
|
||||||
|
import http from '@/utils/http';
|
||||||
|
|
||||||
const idtypes = [
|
const idtypes = [
|
||||||
{key:'idcard', value:'身份证'},
|
{key:'idcard', value:'身份证'},
|
||||||
@@ -40,6 +41,8 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
|||||||
const picBack = React.createRef();
|
const picBack = React.createRef();
|
||||||
const [idtypesVisible, setIdtypesVisible] = useState(false);
|
const [idtypesVisible, setIdtypesVisible] = useState(false);
|
||||||
const [nationVisible, setNationVisible] = useState(false);
|
const [nationVisible, setNationVisible] = useState(false);
|
||||||
|
const [realname, setRealname] = useState();
|
||||||
|
const [idNo, setIdNo] = useState();
|
||||||
|
|
||||||
const onPicCover = (key: any) => {
|
const onPicCover = (key: any) => {
|
||||||
console.log(key);
|
console.log(key);
|
||||||
@@ -79,7 +82,7 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
|||||||
title={formatMessage({ id: 'identity.chooseIdtype' })}
|
title={formatMessage({ id: 'identity.chooseIdtype' })}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
const submitHandler = () => {
|
const submitHandler = async () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const pic1 = picCover.current.files[0];
|
const pic1 = picCover.current.files[0];
|
||||||
const pic2 = picBack.current.files[0];
|
const pic2 = picBack.current.files[0];
|
||||||
@@ -87,10 +90,10 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
|||||||
// const p2 = new FileReader(pic2);
|
// const p2 = new FileReader(pic2);
|
||||||
formData.append('pic1', pic1);
|
formData.append('pic1', pic1);
|
||||||
formData.append('pic2', pic2);
|
formData.append('pic2', pic2);
|
||||||
/**
|
formData.append('realname', realname);
|
||||||
可以在这里直接
|
formData.append('idNo', idNo);
|
||||||
axios.post(url, formData)
|
const data = await http.post('/user/verify', formData);
|
||||||
*/
|
console.log(data);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
@@ -102,8 +105,8 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
|||||||
<input className={styles.myinput}
|
<input className={styles.myinput}
|
||||||
placeholder={formatMessage({ id: 'identity.idcode' })}
|
placeholder={formatMessage({ id: 'identity.idcode' })}
|
||||||
name="idcode"
|
name="idcode"
|
||||||
value={user.idcode}
|
value={idNo}
|
||||||
onChange={e => dispatch({ type: 'identity/onUpdateState', idcode: e.target.value })}
|
onChange={e => setIdNo(e.target.value)}
|
||||||
/>
|
/>
|
||||||
<div style={{'display': 'flex', 'position': 'relative'}}>
|
<div style={{'display': 'flex', 'position': 'relative'}}>
|
||||||
<div className={styles.uploadBox}>
|
<div className={styles.uploadBox}>
|
||||||
@@ -122,8 +125,8 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
|||||||
<input className={styles.myinput}
|
<input className={styles.myinput}
|
||||||
placeholder={formatMessage({ id: 'identity.realname' })}
|
placeholder={formatMessage({ id: 'identity.realname' })}
|
||||||
name="realname"
|
name="realname"
|
||||||
value={user.realname}
|
value={realname}
|
||||||
onChange={e => dispatch({ type: 'identity/onUpdateState', realname: e.target.value })}
|
onChange={e => setRealname(e.target.value)}
|
||||||
/>
|
/>
|
||||||
{/* <AccountItem
|
{/* <AccountItem
|
||||||
className="group"
|
className="group"
|
||||||
|
|||||||
Reference in New Issue
Block a user