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