qnc-webview/src/views/Example.vue

354 lines
17 KiB
Vue
Raw Normal View History

2024-12-24 11:28:23 +08:00
<script setup>
2025-01-04 00:38:57 +08:00
const featureMap = {
G09SC02: {
name: '单人婚姻',
component: defineAsyncComponent(() => import('@/ui/CMarriage.vue')),
},
G27BJ05: {
name: '借贷意向',
component: defineAsyncComponent(() =>
import('@/ui/CBankLoanApplication.vue')
),
},
G28BJ05: {
name: '借贷行为',
component: defineAsyncComponent(() =>
import('@/ui/CBankLoanBehavior.vue')
),
},
G26BJ05: {
name: '特殊名单',
component: defineAsyncComponent(() =>
import('@/ui/CSpecialList.vue')
),
},
G34BJ03: {
name: '个人不良',
component: defineAsyncComponent(() => import('@/ui/CBad.vue')),
},
G35SC01: {
name: '个人诉讼',
component: defineAsyncComponent(() => import('@/ui/CLawsuit.vue')),
},
G05HZ01: {
name: '股东人企关系',
component: defineAsyncComponent(() => import('@/ui/CRelatedEnterprises.vue')),
},
Q23SC01: {
name: '企业涉诉',
component: defineAsyncComponent(() => import('@/ui/CLawsuit.vue')),
},
G15BJ02: {
name: '手机三要素',
component: defineAsyncComponent(() => import('@/ui/CPhoneThreeElements.vue')),
},
KZEYS: {
name: '身份证二要素',
component: defineAsyncComponent(() => import('@/ui/CIDCardTwoElements.vue')),
},
G17BJ02: {
name: '手机号二要素',
component: defineAsyncComponent(() => import('@/ui/CPhoneTwoElements.vue')),
},
G10SC02: {
name: '双人婚姻核验',
component: defineAsyncComponent(() => import('@/ui/CDualMarriage.vue')),
},
P_C_B332: {
name: '人车核验',
component: defineAsyncComponent(() => import('@/ui/CP_C_B332.vue')),
},
FIN019: {
name: '银行卡黑名单',
component: defineAsyncComponent(() => import('@/ui/CFIN019.vue')),
},
G20GZ01: {
name: '银行卡四要素核验',
component: defineAsyncComponent(() => import('@/ui/CG20GZ01.vue')),
},
G03HZ01: {
name: '手机号码风险',
component: defineAsyncComponent(() => import('@/ui/CG03HZ01.vue')),
},
G19BJ02: {
name: '手机二次卡',
component: defineAsyncComponent(() => import('@/ui/CG19BJ02.vue')),
},
G02BJ02: {
name: '手机在网时长',
component: defineAsyncComponent(() => import('@/ui/CG02BJ02.vue')),
},
CAR061: {
name: '名下车辆',
2025-01-29 12:58:31 +08:00
component: defineAsyncComponent(() => import('@/ui/CAR061.vue')),
},
CAR074: {
name: "车辆出险信息",
component: defineAsyncComponent(() => import("@/ui/CAR074.vue")),
},
CAR058: {
name: "车辆维保记录",
component: defineAsyncComponent(() => import("@/ui/CAR058.vue")),
},
CAR079: {
name: "车架号查车",
component: defineAsyncComponent(() => import("@/ui/CAR079.vue")),
},
CAR066: {
name: "车辆过户次数",
component: defineAsyncComponent(() => import("@/ui/CAR066.vue")),
},
CAR100: {
name: "车辆估值",
component: defineAsyncComponent(() => import("@/ui/CAR100.vue")),
},
2025-01-04 00:38:57 +08:00
};
2024-12-24 11:28:23 +08:00
2025-01-04 00:38:57 +08:00
import LEmpty from "@/components/LEmpty.vue";
2024-12-24 11:28:23 +08:00
const productId = ref(null);
const isDone = ref(true);
2025-01-04 00:38:57 +08:00
const reportData = ref([])
const reportParams = ref({})
const reportName = ref("")
const reportDateTime = ref(null)
const feature = ref("")
const isEmpty = ref(false)
2025-01-29 12:58:31 +08:00
const webviewEnv = localStorage.getItem('webview_env')
2024-12-24 11:28:23 +08:00
onMounted(() => {
const query = new URLSearchParams(window.location.search);
feature.value = query.get("feature");
2025-01-04 00:38:57 +08:00
console.log("feature", feature.value)
2024-12-24 11:28:23 +08:00
2025-01-04 00:38:57 +08:00
if (!feature.value) return;
getReport()
});
2024-12-24 11:28:23 +08:00
2025-01-04 00:38:57 +08:00
const getReport = async () => {
let queryUrl = `/query/example?feature=${feature.value}`
const { data, error } = await useApiFetch(queryUrl)
2024-12-24 11:28:23 +08:00
.get()
2025-01-04 00:38:57 +08:00
.json()
2024-12-24 11:28:23 +08:00
2025-01-04 00:38:57 +08:00
if (data.value && !error.value) {
2024-12-24 11:28:23 +08:00
if (data.value.code === 200) {
2025-01-04 00:38:57 +08:00
if (data.value.data.product_name === '婚姻评估') {
reportData.value = data.value.data.query_data.reverse()
} else {
reportData.value = data.value.data.query_data
}
2024-12-24 11:28:23 +08:00
productId.value = data.value.data.product_id;
2025-01-04 00:38:57 +08:00
reportParams.value = data.value.data.query_params
reportName.value = data.value.data.product_name
reportDateTime.value = data.value.data.create_time
} else if (data.value.code === 200003) {
isEmpty.value = true
}
}
}
const maskValue = computed(() => {
return (type, value) => {
if (!value) return value;
if (type === "name") {
// 姓名脱敏(保留首位)
if (value.length === 1) {
return "*"; // 只保留一个字,返回 "*"
} else if (value.length === 2) {
return value[0] + "*"; // 两个字,保留姓氏,第二个字用 "*" 替代
} else {
return value[0] + "*".repeat(value.length - 2) + value[value.length - 1]; // 两个字以上,保留第一个和最后一个字,其余的用 "*" 替代
}
} else if (type === "id_card") {
// 身份证号脱敏保留前6位和最后4位
return value.replace(/^(.{6})(?:\d+)(.{4})$/, "$1****$2");
} else if (type === 'mobile') {
if (value.length === 11) {
return value.substring(0, 3) + "****" + value.substring(7);
}
return value; // 如果手机号不合法或长度不为 11 位,直接返回原手机号
} else if (type === "bank_card") {
// 银行卡号脱敏保留前6位和后4位
return value.replace(/^(.{6})(?:\d+)(.{4})$/, "$1****$2");
} else if (type === "ent_name") {
// 企业名称脱敏保留前3个字符和后3个字符中间部分用 "*" 替代)
if (value.length <= 6) {
return value[0] + "*".repeat(value.length - 1); // 少于6个字符时只保留第一个字符其他用 * 替代
} else {
return value.slice(0, 3) + "*".repeat(value.length - 6) + value.slice(-3); // 多于6个字符时保留前3和后3
}
} else if (type === "ent_code") {
// 企业代码脱敏保留前4个字符和后4个字符中间部分用 "*" 替代)
if (value.length <= 8) {
return value.slice(0, 4) + "*".repeat(value.length - 4); // 长度不超过8时保留前4个字符其他用 * 替代
} else {
return value.slice(0, 4) + "*".repeat(value.length - 8) + value.slice(-4); // 长度超过8时保留前4个字符和后4个字符
}
} else if (type === "car_license") {
// 车牌号脱敏保留前2个字符后2个字符其他部分用 "*" 替代)
if (value.length <= 4) {
return value[0] + "*".repeat(value.length - 1); // 如果车牌号长度小于等于4只保留首字符
} else {
// 如果车牌号较长保留前2个字符后2个字符其余部分用 "*" 替代
return value.slice(0, 2) + "*".repeat(value.length - 4) + value.slice(-2);
}
2024-12-24 11:28:23 +08:00
}
2025-01-04 00:38:57 +08:00
return value;
}
2024-12-24 11:28:23 +08:00
});
</script>
<template>
<div class="min-h-full from-blue-100 to-white bg-gradient-to-b">
2025-01-29 12:58:31 +08:00
<van-notice-bar v-if="!webviewEnv" color="#e03131" background="#ecf9ff" left-icon="info-o"
text="由于全能查APP暂未上线建议将此网站加入收藏夹或书签或可以百度搜索全能查以及在微信全能查小程序复制链接打开更多功能敬请关注全能查公众号" />
2025-01-04 00:38:57 +08:00
<!-- <CTabs :tabs="sortedTabs" type="blue-green" /> -->
2024-12-24 11:28:23 +08:00
<template v-if="isDone">
2025-01-04 00:38:57 +08:00
<div class="flex flex-col gap-y-4 p-4">
2024-12-24 11:28:23 +08:00
<div id="overdiv" class="title">报告概述</div>
<div class="card">
<div class="flex flex-col gap-y-2">
2025-01-04 00:38:57 +08:00
<LTitle title="报告信息" type="blue-green"></LTitle>
<div class="flex flex-col gap-2 my-2">
<div class="flex justify-between border-b pb-2 pl-2">
<span class="text-gray-700 font-bold">报告时间</span>
<span class="text-gray-600">2025-1-1 12:00:00</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="!isEmpty">
<span class="text-gray-700 font-bold">报告项目</span>
<span class="text-gray-600">
{{ reportName }}</span>
2024-12-24 11:28:23 +08:00
</div>
</div>
2025-01-04 00:38:57 +08:00
<template v-if="Object.keys(reportParams).length != 0">
<LTitle title="报告对象" type="blue-green"></LTitle>
<div class="flex flex-col gap-2 my-2">
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.name">
<span class="text-gray-700 font-bold">姓名</span>
<span class="text-gray-600">{{ maskValue("name", reportParams?.name) }}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.id_card">
<span class="text-gray-700 font-bold">身份证号</span>
<span class="text-gray-600">
{{ maskValue("id_card", reportParams?.id_card) }}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.nameMan">
<span class="text-gray-700 font-bold">男方姓名</span>
<span class="text-gray-600">{{ maskValue("name", reportParams?.nameMan) }}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.idCardMan">
<span class="text-gray-700 font-bold">男方身份证号</span>
<span class="text-gray-600">{{ maskValue("id_card", reportParams?.idCardMan)
}}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.nameWoman">
<span class="text-gray-700 font-bold">女方姓名</span>
<span class="text-gray-600">{{ maskValue("name", reportParams?.nameWoman) }}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.idCardWoman">
<span class="text-gray-700 font-bold">女方身份证号</span>
<span class="text-gray-600">{{ maskValue("id_card", reportParams?.idCardWoman)
}}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.bank_card">
<span class="text-gray-700 font-bold">银行卡号</span>
<span class="text-gray-600">{{ maskValue("bank_card", reportParams?.bank_card)
}}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.mobile">
<span class="text-gray-700 font-bold">手机号</span>
<span class="text-gray-600">{{ maskValue("mobile", reportParams?.mobile) }}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2"
v-if="reportParams?.verification_code">
<span class="text-gray-700 font-bold">验证码</span>
<span class="text-gray-600">{{ maskValue("code", reportParams?.verification_code)
}}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.car_license">
<span class="text-gray-700 font-bold">车牌号</span>
<span class="text-gray-600">{{ maskValue("car_license", reportParams?.car_license)
}}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.ent_name">
<span class="text-gray-700 font-bold">企业名称</span>
<span class="text-gray-600">{{ maskValue("ent_name", reportParams?.ent_name)
}}</span>
</div>
<div class="flex justify-between border-b pb-2 pl-2" v-if="reportParams?.ent_code">
<span class="text-gray-700 font-bold">企业代码</span>
<span class="text-gray-600">{{ maskValue("ent_code", reportParams?.ent_code)
}}</span>
</div>
</div>
</template>
2024-12-24 11:28:23 +08:00
</div>
</div>
2025-01-04 00:38:57 +08:00
<LEmpty v-if="isEmpty" />
<template v-for="(item, index) in reportData" :key="index">
<div id="lawsuit" class="title">{{ featureMap[item.apiID].name }}</div>
<component :is="featureMap[item.apiID].component" :data="item.data" :params="reportParams">
</component>
2024-12-24 11:28:23 +08:00
</template>
<div class="card">
<div>
<div class="text-bold text-blue-500 mb-2">报告说明</div>
<div>
2025-01-04 00:38:57 +08:00
&nbsp; &nbsp;本报告的数据由用户本人明确授权后我们才向相关合法存有用户个人数据的机构调取本报告相关内容本平台只做大数据的获取与分析仅向用户个人展示参考
2024-12-24 11:28:23 +08:00
</div>
<p>
2025-01-29 12:58:31 +08:00
&nbsp; &nbsp; 报告有效期<strong class="text-red-500">{{ webviewEnv ? '7' : '30'
}}</strong>过期自动删除
2024-12-24 11:28:23 +08:00
</p>
<p>
&nbsp; &nbsp;
若您的数据不全面可能是数据具有延迟性或者合作信息机构未获取到您的数据若数据有错误请联系客服
</p>
2025-01-04 00:38:57 +08:00
<p> &nbsp;
&nbsp;本产品所有数据均来自第三方可能部分数据未公开数据更新延迟或信息受到限制贵司不对数据的准确性真实性完整性做任何承诺用户需根据实际情况结合报告内容自行判断与决策
</p>
2024-12-24 11:28:23 +08:00
</div>
</div>
</div>
</template>
</div>
2025-01-29 12:58:31 +08:00
<div class="disclaimer" v-if="!webviewEnv">
2025-01-04 00:38:57 +08:00
<div class="flex flex-col items-center">
<div class="flex items-center">
<img class="w-4 h-4 mr-2" src="@/assets/images/public_security_record_icon.png" alt="公安备案" />
<text>琼公网安备46010002000443号</text>
</div>
<div>
<a class="text-blue-500" href="https://beian.miit.gov.cn">
琼ICP备2024038584号-2
</a>
</div>
</div>
<div>
海南省学宇思网络科技有限公司版权所有
</div>
</div>
2025-01-13 17:13:57 +08:00
2024-12-24 11:28:23 +08:00
</template>
<style lang="scss" scoped>
.title {
@apply mx-auto mt-2 w-64 border rounded-3xl bg-gradient-to-r from-blue-400 via-green-500 to-teal-500 py-2 text-center text-white font-bold;
}
2025-01-04 00:38:57 +08:00
.disclaimer {
/* margin-top: 24px; */
padding: 10px;
font-size: 12px;
color: #999;
text-align: center;
border-top: 1px solid #e0e0e0;
padding-bottom: 60px;
background: #ffffff;
}
2024-12-24 11:28:23 +08:00
</style>