소스 검색

feat(doctor): 更新复诊概览页面数据展示

- 将"数据概览"标题更改为"复诊概览"
- 修改待处理复诊为待确认复诊,并更新对应数量计算逻辑
- 修改异常患者为待完成复诊,并更新对应数量计算逻辑
- 调整接口请求地址和方法,从today_reminders改为follow-up/list
- 新增根据复诊状态(PENDING/CONFIRMED)统计数量的逻辑
- 添加reminder-label样式定义
mcbaiyun 1 개월 전
부모
커밋
307c58a13c
1개의 변경된 파일40개의 추가작업 그리고 14개의 파일을 삭제
  1. 40 14
      src/pages/doctor/index/index.vue

+ 40 - 14
src/pages/doctor/index/index.vue

@@ -44,7 +44,7 @@
 
       <view class="today-reminder-card">
         <view class="card-header">
-          <text class="card-title">数据概览</text>
+          <text class="card-title">复诊概览</text>
         </view>
         <view class="card-content">
           <view class="reminder-item" @click="onItemClick('复诊管理')">
@@ -52,17 +52,17 @@
               <image src="/static/icons/remixicon/time-line.svg" class="icon" />
             </view>
             <view class="reminder-text">
-              <text class="reminder-number">{{ todayReminders.followUpCount }}</text>
-              <text class="reminder-label">待处理复诊</text>
+              <text class="reminder-number">{{ todayReminders.pendingCount }}</text>
+              <text class="reminder-label">待确认复诊</text>
             </view>
           </view>
-          <view class="reminder-item" @click="onItemClick('我的病人')"> 
+          <view class="reminder-item" @click="onItemClick('复诊管理')"> 
             <view class="reminder-icon">
               <image src="/static/icons/remixicon/alert-line.svg" class="icon" />
             </view>
             <view class="reminder-text">
-              <text class="reminder-number">{{ todayReminders.abnormalCount }}</text>
-              <text class="reminder-label">异常患者</text>
+              <text class="reminder-number">{{ todayReminders.confirmedCount }}</text>
+              <text class="reminder-label">待完成复诊</text>
             </view>
           </view>
         </view>
@@ -124,8 +124,8 @@ const avatarSrc = computed(() => {
 })
 
 const todayReminders = ref({
-  followUpCount: 0,
-  abnormalCount: 0
+  pendingCount: 0,
+  confirmedCount: 0
 })
 
 const patientActivities = ref<Array<{
@@ -204,14 +204,34 @@ const fetchTodayReminders = async () => {
   try {
     const token = uni.getStorageSync('token')
     if (!token) return
-    const response = await request({
-      url: 'https://wx.baiyun.work/doctor/today_reminders',
-      method: 'GET',
+    
+    // 获取复诊数据
+    const followUpResponse = await request({
+      url: 'https://wx.baiyun.work/follow-up/list',
+      method: 'POST',
+      header: { 'Content-Type': 'application/json' },
+      data: {}
     })
+
+    let pendingCount = 0
+    let confirmedCount = 0
     
-    const resp = response.data as any
-    if (resp && resp.code === 200 && resp.data) {
-      todayReminders.value = resp.data
+    const followUpData = followUpResponse.data as any
+    if (followUpData && followUpData.code === 200 && followUpData.data) {
+      // 计算待确认复诊数量:状态为PENDING的复诊
+      pendingCount = followUpData.data.records.filter((item: any) => 
+        item.status === 'PENDING'
+      ).length
+      
+      // 计算待完成复诊数量:状态为CONFIRMED的复诊
+      confirmedCount = followUpData.data.records.filter((item: any) => 
+        item.status === 'CONFIRMED'
+      ).length
+    }
+
+    todayReminders.value = {
+      pendingCount,
+      confirmedCount
     }
   } catch (err) {
     console.error('Fetch today reminders error:', err)
@@ -636,6 +656,12 @@ const formatActivityDescription = (activity: any) => {
   color: #333;
 }
 
+.reminder-label {
+  font-size: 28rpx;
+  color: #666;
+  margin-top: 10rpx;
+}
+
 .activity-card-content {
   padding: 20rpx;
   display: block;