feat:认证接口接入
This commit is contained in:
parent
cb49487f6e
commit
f16e28c7f0
@ -163,11 +163,12 @@ const tabs = computed(() => {
|
|||||||
const isBatchMode = ref(false);
|
const isBatchMode = ref(false);
|
||||||
const selectedItems = ref([]); // Stores patient phone or unique ID
|
const selectedItems = ref([]); // Stores patient phone or unique ID
|
||||||
|
|
||||||
// 新增流程所需状态(后续接接口替换)
|
// 新增流程所需状态(认证相关)
|
||||||
const managedArchiveCountAllTeams = ref(0); // 在管档案数(所有团队)
|
const managedArchiveCountAllTeams = ref(0); // 在管档案数(所有团队)
|
||||||
const isVerified = ref(true); // 是否已认证
|
const verifyStatus = ref(''); // unverified | verifying | verified | failed
|
||||||
|
const isVerified = ref(false); // 是否已认证
|
||||||
const hasVerifyFailedHistory = ref(false); // 是否有历史认证失败
|
const hasVerifyFailedHistory = ref(false); // 是否有历史认证失败
|
||||||
const verifyFailedReason = ref('资料不完整,请补充营业执照/资质证明后重新提交。');
|
const verifyFailedReason = ref('');
|
||||||
|
|
||||||
const DETAIL_STORAGE_KEY = 'ykt_case_archive_detail';
|
const DETAIL_STORAGE_KEY = 'ykt_case_archive_detail';
|
||||||
const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team';
|
const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team';
|
||||||
@ -220,6 +221,29 @@ function getTeamId() {
|
|||||||
return String(currentTeam.value?.teamId || '') || '';
|
return String(currentTeam.value?.teamId || '') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function applyVerifyStatus(status, reason) {
|
||||||
|
verifyStatus.value = status || '';
|
||||||
|
isVerified.value = verifyStatus.value === 'verified';
|
||||||
|
hasVerifyFailedHistory.value = verifyStatus.value === 'failed';
|
||||||
|
verifyFailedReason.value = hasVerifyFailedHistory.value ? (reason || '') : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
async function refreshVerifyStatus() {
|
||||||
|
const corpId = String(account.value?.corpId || doctorInfo.value?.corpId || getCorpId() || '');
|
||||||
|
const weChatOpenId = String(account.value?.openid || account.value?.openId || '');
|
||||||
|
const id = String(doctorInfo.value?._id || doctorInfo.value?.id || '');
|
||||||
|
if (!corpId || !weChatOpenId || !id) {
|
||||||
|
applyVerifyStatus(String(doctorInfo.value?.verifyStatus || ''), '');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const res = await api('getMemberVerifyStatus', { corpId, weChatOpenId, id });
|
||||||
|
if (res && res.success) {
|
||||||
|
applyVerifyStatus(String(res.data?.verifyStatus || ''), String(res.data?.reason || ''));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
applyVerifyStatus(String(doctorInfo.value?.verifyStatus || ''), '');
|
||||||
|
}
|
||||||
|
|
||||||
function sortGroupList(list) {
|
function sortGroupList(list) {
|
||||||
const { orderList, corpList, restList } = (Array.isArray(list) ? list : []).reduce(
|
const { orderList, corpList, restList } = (Array.isArray(list) ? list : []).reduce(
|
||||||
(p, c) => {
|
(p, c) => {
|
||||||
@ -574,6 +598,10 @@ const handleCreate = () => {
|
|||||||
|
|
||||||
// 未认证 + 达到10上限:提示去认证
|
// 未认证 + 达到10上限:提示去认证
|
||||||
if (!isVerified.value && managedArchiveCountAllTeams.value >= 10) {
|
if (!isVerified.value && managedArchiveCountAllTeams.value >= 10) {
|
||||||
|
if (verifyStatus.value === 'verifying') {
|
||||||
|
toast('信息认证中,请耐心等待!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '当前管理档案数已达上限 10 个,完成认证即可升级至 100 个。',
|
content: '当前管理档案数已达上限 10 个,完成认证即可升级至 100 个。',
|
||||||
@ -603,6 +631,10 @@ const handleCreate = () => {
|
|||||||
|
|
||||||
// 新增流程:认证分支
|
// 新增流程:认证分支
|
||||||
const startVerifyFlow = () => {
|
const startVerifyFlow = () => {
|
||||||
|
if (verifyStatus.value === 'verifying') {
|
||||||
|
toast('信息认证中,请耐心等待!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 有历史失败记录 -> 展示失败原因 & 重新认证
|
// 有历史失败记录 -> 展示失败原因 & 重新认证
|
||||||
if (hasVerifyFailedHistory.value) {
|
if (hasVerifyFailedHistory.value) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@ -625,7 +657,7 @@ const startVerifyFlow = () => {
|
|||||||
|
|
||||||
// ===== 预留入口(后续对接真实页面/接口) =====
|
// ===== 预留入口(后续对接真实页面/接口) =====
|
||||||
const openVerifyEntry = () => {
|
const openVerifyEntry = () => {
|
||||||
uni.showToast({ title: '认证功能待接入', icon: 'none' });
|
uni.navigateTo({ url: '/pages/work/profile?type=cert' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const openAddCustomerServiceEntry = () => {
|
const openAddCustomerServiceEntry = () => {
|
||||||
@ -717,6 +749,7 @@ onLoad(async () => {
|
|||||||
await loadGroups();
|
await loadGroups();
|
||||||
await reload(true);
|
await reload(true);
|
||||||
}
|
}
|
||||||
|
await refreshVerifyStatus();
|
||||||
});
|
});
|
||||||
|
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
@ -737,6 +770,7 @@ onShow(async () => {
|
|||||||
} else {
|
} else {
|
||||||
await loadGroups();
|
await loadGroups();
|
||||||
}
|
}
|
||||||
|
await refreshVerifyStatus();
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user