feat:认证接口接入

This commit is contained in:
Jafeng 2026-01-28 19:09:20 +08:00
parent cb49487f6e
commit f16e28c7f0

View File

@ -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>