修复实名资料提交成功后无法自动关闭提交窗口的问题并优化实名资料提交窗口
This commit is contained in:
parent
b7ad258efd
commit
d863ade893
@ -42,9 +42,6 @@
|
|||||||
@click="showUploadRealName"
|
@click="showUploadRealName"
|
||||||
class="inline-flex items-center px-3 py-1.5 text-sm font-medium text-white bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 rounded-lg transition-all duration-200 shadow-sm hover:shadow-md"
|
class="inline-flex items-center px-3 py-1.5 text-sm font-medium text-white bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 rounded-lg transition-all duration-200 shadow-sm hover:shadow-md"
|
||||||
>
|
>
|
||||||
<svg class="mr-1.5 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path>
|
|
||||||
</svg>
|
|
||||||
上传实名资料
|
上传实名资料
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium text-gray-700 mb-2">域名所有者</label>
|
<label class="block text-sm font-medium text-gray-700 mb-2">域名所有者</label>
|
||||||
<div class="text-sm text-gray-900">
|
<div class="text-sm text-gray-900">
|
||||||
(个人) 旷蓓娟
|
{{ ownerType ? `(${ownerType === 'I' ? '个人' : '企业'})` : '' }} {{ domainDoc?.owner_name || '未知' }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -37,15 +37,13 @@
|
|||||||
v-model="formData.idType"
|
v-model="formData.idType"
|
||||||
class="px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white text-sm"
|
class="px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white text-sm"
|
||||||
>
|
>
|
||||||
<option value="SFZ">身份证</option>
|
<option
|
||||||
<option value="HZ">护照</option>
|
v-for="option in idTypeOptions"
|
||||||
<option value="GAJMTX">港澳居民来往内地通行证</option>
|
:key="option.value"
|
||||||
<option value="TWJMTX">台湾居民来往大陆通行证</option>
|
:value="option.value"
|
||||||
<option value="WJLSFZ">外国人永久居留身份证</option>
|
>
|
||||||
<option value="GAJZZ">港澳台居民居住证</option>
|
{{ option.label }}
|
||||||
<option value="ORG">组织机构代码证</option>
|
</option>
|
||||||
<option value="YYZZ">工商营业执照</option>
|
|
||||||
<option value="TYDM">统一社会信用代码证书</option>
|
|
||||||
</select>
|
</select>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@ -131,7 +129,7 @@
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none"
|
class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none"
|
||||||
@click="$emit('close')"
|
@click="show = false"
|
||||||
>
|
>
|
||||||
重置
|
重置
|
||||||
</button>
|
</button>
|
||||||
@ -159,15 +157,17 @@ export default {
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
domain: String,
|
domain: String,
|
||||||
domainDoc: Object
|
domainDoc: Object,
|
||||||
|
onSuccess: Function
|
||||||
},
|
},
|
||||||
emits: ['success', 'close'],
|
emits: ['success', 'close'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: true,
|
show: true,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
ownerType: null, // 初始为空,等待从所有者信息获取
|
||||||
formData: {
|
formData: {
|
||||||
idType: 'SFZ',
|
idType: '',
|
||||||
idNumber: ''
|
idNumber: ''
|
||||||
},
|
},
|
||||||
uploadedFiles: []
|
uploadedFiles: []
|
||||||
@ -175,7 +175,32 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isValid() {
|
isValid() {
|
||||||
return this.formData.idNumber.trim() && this.uploadedFiles.length > 0;
|
return this.formData.idNumber.trim() && this.formData.idType && this.uploadedFiles.length > 0;
|
||||||
|
},
|
||||||
|
idTypeOptions() {
|
||||||
|
if (!this.ownerType) {
|
||||||
|
// 如果还没有获取到所有者类型,返回空数组
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.ownerType === 'I') {
|
||||||
|
// 个人证件类型
|
||||||
|
return [
|
||||||
|
{ value: 'SFZ', label: '身份证' },
|
||||||
|
{ value: 'HZ', label: '护照' },
|
||||||
|
{ value: 'GAJMTX', label: '港澳居民来往内地通行证' },
|
||||||
|
{ value: 'TWJMTX', label: '台湾居民来往大陆通行证' },
|
||||||
|
{ value: 'WJLSFZ', label: '外国人永久居留身份证' },
|
||||||
|
{ value: 'GAJZZ', label: '港澳台居民居住证' }
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
// 企业证件类型
|
||||||
|
return [
|
||||||
|
{ value: 'ORG', label: '组织机构代码证' },
|
||||||
|
{ value: 'YYZZ', label: '工商营业执照' },
|
||||||
|
{ value: 'TYDM', label: '统一社会信用代码证书' }
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resources: {
|
resources: {
|
||||||
@ -281,9 +306,12 @@ export default {
|
|||||||
|
|
||||||
// Jingrow 响应格式:{message: {...}}
|
// Jingrow 响应格式:{message: {...}}
|
||||||
if (response && response.message && response.message.status === "success") {
|
if (response && response.message && response.message.status === "success") {
|
||||||
// 直接关闭弹窗,不显示 toast
|
// 调用父组件的成功回调
|
||||||
this.$emit('success');
|
if (this.onSuccess) {
|
||||||
this.$emit('close');
|
this.onSuccess();
|
||||||
|
}
|
||||||
|
// 关闭弹窗
|
||||||
|
this.show = false;
|
||||||
} else {
|
} else {
|
||||||
const errorMessage = response?.message?.message || response?.message || '上传失败,请重试';
|
const errorMessage = response?.message?.message || response?.message || '上传失败,请重试';
|
||||||
console.error('上传失败:', errorMessage);
|
console.error('上传失败:', errorMessage);
|
||||||
@ -323,6 +351,11 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.formData.idType) {
|
||||||
|
alert('请选择证件类型');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.uploadedFiles.length === 0) {
|
if (this.uploadedFiles.length === 0) {
|
||||||
alert('请上传证件材料');
|
alert('请上传证件材料');
|
||||||
return false;
|
return false;
|
||||||
@ -339,6 +372,9 @@ export default {
|
|||||||
if (response && response.status === 'Success' && response.data) {
|
if (response && response.status === 'Success' && response.data) {
|
||||||
const owner = response.data;
|
const owner = response.data;
|
||||||
|
|
||||||
|
// 优先从所有者信息获取类型
|
||||||
|
this.ownerType = owner.c_regtype;
|
||||||
|
|
||||||
// 填充身份证号码
|
// 填充身份证号码
|
||||||
if (owner.c_idnum_gswl) {
|
if (owner.c_idnum_gswl) {
|
||||||
this.formData.idNumber = owner.c_idnum_gswl;
|
this.formData.idNumber = owner.c_idnum_gswl;
|
||||||
@ -346,6 +382,9 @@ export default {
|
|||||||
// 填充证件类型
|
// 填充证件类型
|
||||||
if (owner.c_idtype_gswl) {
|
if (owner.c_idtype_gswl) {
|
||||||
this.formData.idType = owner.c_idtype_gswl;
|
this.formData.idType = owner.c_idtype_gswl;
|
||||||
|
} else if (this.ownerType) {
|
||||||
|
// 根据所有者类型设置默认证件类型
|
||||||
|
this.formData.idType = this.ownerType === 'I' ? 'SFZ' : 'ORG';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user