feat(xumu): 完善认证材料页面并优化相关功能

- 新增认证材料页面,支持查看和审核用户提交的认证信息- 优化 axios 配置,修复 URL 替换逻辑
- 更新表格操作按钮,根据认证状态显示不同选项
- 重构页面布局组件,增加返回按钮和内容字符串属性
This commit is contained in:
aixianling
2024-12-19 18:04:12 +08:00
parent 4c72bd2ac9
commit 045449331f
5 changed files with 102 additions and 27 deletions

View File

@@ -1,13 +1,59 @@
<script>
import AiUploader from "dui/packages/basic/AiUploader.vue";
const certificates = [
{label: "身份证(正面)", prop: "frontCard"},
{label: "身份证(反面)", prop: "reverseCard"},
{label: "营业执照", prop: "businessPic", permit: ["breed"]},
{label: "畜禽经营许可证", prop: "breedPic", permit: ["breed"]},
{label: "动物防疫条件许可证", prop: "prevention", permit: ["breed"]},
{label: "组织机构证明", prop: "orgPic", permit: ["bank", "insurance"]},
]
export default {
name: "authAdd"
name: "authAdd",
components: {AiUploader},
props: {
instance: Function,
permissions: Function
},
data() {
return {
certificates,
detail: {},
}
},
methods: {
getDetail() {
const {id} = this.$route.query
this.instance.post("/user/auth/page", null, {params: {id}}).then(res => {
if (res?.data) {
this.detail = res.data|| {}
}
})
},
getNeedCerts(type) {
return certificates.filter(e => !e.permit || e.permit.includes(type))
},
},
created() {
this.getDetail()
}
}
</script>
<template>
<section class="authAdd">
</section>
<ai-page title="认证材料" class="authAdd" showBack content-string="detail">
<el-form size="small">
<ai-card title="认证材料">
<div class="grid">
<el-form-item v-for="(op,i) in getNeedCerts(detail.type)" :key="i" v-bind="op" :rules="{required:true,message:`请上传${op.label}`,trigger:'change'}">
<el-image v-model="detail[op.prop]" :preview-src-list="[detail[op.prop]]"/>
</el-form-item>
</div>
</ai-card>
<ai-card title="审核意见"></ai-card>
</el-form>
</ai-page>
</template>
<style scoped lang="scss">