调整实名认证页面外观css
This commit is contained in:
@@ -176,14 +176,15 @@ export default {
|
||||
'identity.realname': 'Real Name',
|
||||
'identity.nationality': 'Nationality',
|
||||
'identity.idtype': 'ID Type',
|
||||
'identity.idcode': 'ID Code',
|
||||
'identity.idNo': 'ID Number',
|
||||
'identity.idphoto': 'ID Photo',
|
||||
'identity.idtypes': {idcard:'id card', passport:'passport'},
|
||||
'identity.chooseIdtype': 'Type of id cards',
|
||||
'identity.chooseNation': 'Choose Nation',
|
||||
'identity.kyc1btn': 'Submit',
|
||||
'identity.kyc1btn2': 'Go to 2nd level of KYC',
|
||||
'identity.kyc2btc': 'Submit',
|
||||
|
||||
|
||||
'system.title': 'Settings',
|
||||
'system.language': 'Language',
|
||||
'system.currency': 'Currency',
|
||||
|
||||
@@ -176,10 +176,11 @@ export default {
|
||||
'identity.realname': '实名',
|
||||
'identity.nationality': '国籍',
|
||||
'identity.idtype': '证件类型',
|
||||
'identity.idcode': '证件编号',
|
||||
'identity.idNo': '证件编号',
|
||||
'identity.idphoto': '证件照片',
|
||||
'identity.idtypes': {idcard:'身份证', passport:'护照'},
|
||||
'identity.chooseIdtype': '选择证件类型',
|
||||
'identity.chooseNation': '选择国籍',
|
||||
'identity.kyc1btn': '提交',
|
||||
'identity.kyc1btn2': '进入二级实名认证',
|
||||
'identity.kyc2btn': '提交',
|
||||
|
||||
@@ -43,7 +43,7 @@ function getObjectURL(file) {
|
||||
const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState> = ({
|
||||
dispatch,
|
||||
user,
|
||||
kyc1success,
|
||||
kyc1status,
|
||||
nameInput,
|
||||
kyc1Submitting
|
||||
}) => {
|
||||
@@ -74,7 +74,7 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
||||
dispatch({ type: 'user/onUpdateState', payload: key });
|
||||
};
|
||||
const onNationSelected = (key: string) => {
|
||||
setIdtypesVisible(false);
|
||||
setNationVisible(false);
|
||||
dispatch({ type: 'user/onUpdateState', payload: key });
|
||||
};
|
||||
|
||||
@@ -97,7 +97,7 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
||||
onItemSelected={onNationSelected}
|
||||
visible={nationVisible}
|
||||
onCancel={() => setNationVisible(false)}
|
||||
title={formatMessage({ id: 'identity.chooseIdtype' })}
|
||||
title={formatMessage({ id: 'identity.chooseNation' })}
|
||||
/>
|
||||
);
|
||||
const submitHandler = async () => {
|
||||
@@ -110,8 +110,13 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
||||
formData.append('pic2', pic2);
|
||||
formData.append('realname', realname);
|
||||
formData.append('idNo', idNo);
|
||||
// const data = await http.post('/user/verify', formData);
|
||||
// console.log(data);
|
||||
if (!realname || !idNo) {
|
||||
alert('缺少必要信息,请继续填写')
|
||||
return
|
||||
}
|
||||
const data = await http.post('/user/verify', formData);
|
||||
alert(data.msg)
|
||||
// console.log(data)
|
||||
}
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
@@ -121,8 +126,14 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
||||
/>
|
||||
{user && <div className={styles.content}>
|
||||
<input className={styles.myinput}
|
||||
placeholder={formatMessage({ id: 'identity.idcode' })}
|
||||
name="idcode"
|
||||
placeholder={formatMessage({ id: 'identity.realname' })}
|
||||
name="realname"
|
||||
value={realname}
|
||||
onChange={e => setRealname(e.target.value)}
|
||||
/>
|
||||
<input className={styles.myinput}
|
||||
placeholder={formatMessage({ id: 'identity.idNo' })}
|
||||
name="idNo"
|
||||
value={idNo}
|
||||
onChange={e => setIdNo(e.target.value)}
|
||||
/>
|
||||
@@ -140,12 +151,6 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
||||
<input type="file" className={styles.input} ref={picBack} onChange={e => preview(2)}/>
|
||||
</div>
|
||||
</div>
|
||||
<input className={styles.myinput}
|
||||
placeholder={formatMessage({ id: 'identity.realname' })}
|
||||
name="realname"
|
||||
value={realname}
|
||||
onChange={e => setRealname(e.target.value)}
|
||||
/>
|
||||
{/* <AccountItem
|
||||
className="group"
|
||||
title="identity.nationality"
|
||||
@@ -161,11 +166,12 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
||||
onClick={() => setIdtypesVisible(true)}
|
||||
/> */}
|
||||
|
||||
<div className={styles.prompt}>
|
||||
{/* <div className={styles.prompt}>
|
||||
<div>一级认证未能通过审核,原因为:</div>
|
||||
<div>后台返回的理由</div>
|
||||
<div>请重新提交。</div>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
<Button
|
||||
className={styles.myinput}
|
||||
type="primary"
|
||||
@@ -173,7 +179,7 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
|
||||
loading={kyc1Submitting}
|
||||
// onClick={() => dispatch({ type: 'identity/kyc1submit' })}
|
||||
onClick={e => submitHandler(e)}
|
||||
>{formatMessage({ id: user.kyc1success ? 'identity.kyc1btn2' : 'identity.kyc1btn' })}</Button>
|
||||
>{formatMessage({ id: (user.kyc1status==='verifying'||user.kyc1status==='verified') ? 'identity.kyc1btn2' : 'identity.kyc1btn' })}</Button>
|
||||
</div>}
|
||||
{idtypeModal}
|
||||
{nationModal}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { kyc1 } from './service';
|
||||
import { message } from 'antd';
|
||||
|
||||
export interface IdentityModelState {
|
||||
kyc1success: boolean;
|
||||
kyc1status: string;
|
||||
nameInput: string;
|
||||
kyc1Submitting: boolean;
|
||||
formData: any;
|
||||
@@ -13,7 +13,7 @@ const model: Model = {
|
||||
namespace: 'identity',
|
||||
|
||||
state: {
|
||||
kyc1success: false,
|
||||
kyc1status: 'none',
|
||||
nameInput: '',
|
||||
kyc1Submitting: false,
|
||||
formData: ''
|
||||
@@ -21,11 +21,11 @@ const model: Model = {
|
||||
|
||||
effects: {
|
||||
*kyc1submit(_, { put, all, call, select }) {
|
||||
const { realname, idcode } = yield select((state:any) => state.identity)
|
||||
if (!idcode || !realname) return
|
||||
const { realname, idNo } = yield select((state:any) => state.identity)
|
||||
if (!idNo || !realname) return
|
||||
yield put({ type: 'onUpdateState', kyc1Submitting: true })
|
||||
try {
|
||||
yield call(kyc1, {idcode:idcode, realname:realname})
|
||||
yield call(kyc1, {idNo:idNo, realname:realname})
|
||||
|
||||
/* yield all([
|
||||
put({ type: 'onUpdateState', nameInput: '', nameEditable: false }),
|
||||
|
||||
@@ -3,7 +3,7 @@ import http from '@/utils/http';
|
||||
export async function kyc1(kyc1info: object) {
|
||||
// console.info('进入了 service.ts 调用 kyc1......')
|
||||
|
||||
const { ok, msg } = await http.post('/user/kyc1', kyc1info);
|
||||
const { ok, msg } = await http.post('/user/verify', kyc1info);
|
||||
if (ok) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
max-height: 200px;
|
||||
}
|
||||
.uploadBox {
|
||||
box-sizing:border-box;
|
||||
width:50%;
|
||||
padding: 8px;
|
||||
flex: 1 0 auto;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
|
||||
@@ -14,10 +14,10 @@ export interface User {
|
||||
inviteCode: string;
|
||||
inviter: string;
|
||||
realname?: string;
|
||||
idcode?: string;
|
||||
idNo?: string;
|
||||
idtype?: string;
|
||||
nationality?: string;
|
||||
kyc1success?: boolean;
|
||||
kyc1status?: boolean;
|
||||
}
|
||||
|
||||
export enum SendCodeType {
|
||||
|
||||
Reference in New Issue
Block a user