From f16e28c7f0645d4cd5092e90ceba9638b160949d Mon Sep 17 00:00:00 2001 From: Jafeng <2998840497@qq.com> Date: Wed, 28 Jan 2026 19:09:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=AE=A4=E8=AF=81=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/case/case.vue | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/pages/case/case.vue b/pages/case/case.vue index 2ca2d57..4802e5b 100644 --- a/pages/case/case.vue +++ b/pages/case/case.vue @@ -163,11 +163,12 @@ const tabs = computed(() => { const isBatchMode = ref(false); const selectedItems = ref([]); // Stores patient phone or unique ID -// 新增流程所需状态(后续接接口替换) +// 新增流程所需状态(认证相关) const managedArchiveCountAllTeams = ref(0); // 在管档案数(所有团队) -const isVerified = ref(true); // 是否已认证 +const verifyStatus = ref(''); // unverified | verifying | verified | failed +const isVerified = ref(false); // 是否已认证 const hasVerifyFailedHistory = ref(false); // 是否有历史认证失败 -const verifyFailedReason = ref('资料不完整,请补充营业执照/资质证明后重新提交。'); +const verifyFailedReason = ref(''); const DETAIL_STORAGE_KEY = 'ykt_case_archive_detail'; const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team'; @@ -220,6 +221,29 @@ function getTeamId() { 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) { const { orderList, corpList, restList } = (Array.isArray(list) ? list : []).reduce( (p, c) => { @@ -574,6 +598,10 @@ const handleCreate = () => { // 未认证 + 达到10上限:提示去认证 if (!isVerified.value && managedArchiveCountAllTeams.value >= 10) { + if (verifyStatus.value === 'verifying') { + toast('信息认证中,请耐心等待!'); + return; + } uni.showModal({ title: '提示', content: '当前管理档案数已达上限 10 个,完成认证即可升级至 100 个。', @@ -603,6 +631,10 @@ const handleCreate = () => { // 新增流程:认证分支 const startVerifyFlow = () => { + if (verifyStatus.value === 'verifying') { + toast('信息认证中,请耐心等待!'); + return; + } // 有历史失败记录 -> 展示失败原因 & 重新认证 if (hasVerifyFailedHistory.value) { uni.showModal({ @@ -625,7 +657,7 @@ const startVerifyFlow = () => { // ===== 预留入口(后续对接真实页面/接口) ===== const openVerifyEntry = () => { - uni.showToast({ title: '认证功能待接入', icon: 'none' }); + uni.navigateTo({ url: '/pages/work/profile?type=cert' }); }; const openAddCustomerServiceEntry = () => { @@ -717,6 +749,7 @@ onLoad(async () => { await loadGroups(); await reload(true); } + await refreshVerifyStatus(); }); onShow(async () => { @@ -737,6 +770,7 @@ onShow(async () => { } else { await loadGroups(); } + await refreshVerifyStatus(); });