110 lines
2.8 KiB
JavaScript
110 lines
2.8 KiB
JavaScript
export default OakComponent({
|
|
entity: 'user',
|
|
projection: {
|
|
id: 1,
|
|
name: 1,
|
|
idCardType: 1,
|
|
idNumber: 1,
|
|
idState: 1,
|
|
extraFile$entity: {
|
|
$entity: 'extraFile',
|
|
data: {
|
|
id: 1,
|
|
tag1: 1,
|
|
tag2: 1,
|
|
origin: 1,
|
|
bucket: 1,
|
|
objectId: 1,
|
|
filename: 1,
|
|
extra1: 1,
|
|
extension: 1,
|
|
type: 1,
|
|
entity: 1,
|
|
entityId: 1,
|
|
fileType: 1,
|
|
sort: 1,
|
|
isBridge: 1,
|
|
uploadState: 1,
|
|
},
|
|
filter: {
|
|
tag1: {
|
|
$in: ['ID-Card', 'passport', 'Mainland-passport'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
isList: false,
|
|
formData({ data: row, features }) {
|
|
return {
|
|
name: row?.name,
|
|
idNumber: row?.idNumber,
|
|
idCardType: row?.idCardType,
|
|
idState: row?.idState,
|
|
idStateStr: this.t(`user:v.idState.${row?.idState}`)
|
|
};
|
|
},
|
|
data: {
|
|
idCardTypeArr: [
|
|
{
|
|
value: 'ID-Card',
|
|
label: '身份证',
|
|
},
|
|
{
|
|
value: 'passport',
|
|
label: '护照',
|
|
},
|
|
{
|
|
value: 'Mainland-passport',
|
|
label: '港澳台通行证',
|
|
},
|
|
],
|
|
afterCommitMp(id) {
|
|
return this.afterCommit(id);
|
|
},
|
|
},
|
|
properties: {
|
|
origin: null,
|
|
autoUpload: false,
|
|
onFinish: undefined,
|
|
needUploadPhotos: false, //是否上传照片
|
|
},
|
|
methods: {
|
|
setNameMp(e) {
|
|
const { detail: { value }, } = e;
|
|
this.update({
|
|
name: value,
|
|
});
|
|
},
|
|
setIdCardTypeMp(e) {
|
|
const { detail: { value }, } = e;
|
|
const { idCardType } = this.state;
|
|
if (idCardType === value) {
|
|
return;
|
|
}
|
|
this.update({
|
|
idCardType: value,
|
|
idNumber: '',
|
|
});
|
|
},
|
|
setIdNumberMp(e) {
|
|
const { detail: { value }, } = e;
|
|
this.update({
|
|
idNumber: value,
|
|
});
|
|
},
|
|
afterCommit() {
|
|
const { onFinish } = this.props;
|
|
if (onFinish) {
|
|
onFinish();
|
|
}
|
|
else if (process.env.OAK_PLATFORM === 'wechatMp') {
|
|
this.triggerEvent('finish', {});
|
|
}
|
|
},
|
|
async onConfirm() {
|
|
await this.execute('verify', { type: 'success', content: '提交认证中' });
|
|
this.afterCommit();
|
|
},
|
|
},
|
|
});
|