Selaa lähdekoodia

feat(api): 移除复诊相关功能模块

- 删除复诊记录实体定义及所有相关接口
- 移除用户活动类型中的复诊相关常量
- 删除复诊管理页面及相关路由配置
- 移除医生端首页的复诊提醒逻辑
- 移除患者端我的医生页面的复诊记录展示
- 删除复诊申请和编辑页面
- 清理用户活动描述中的复诊相关文案
mcbaiyun 4 viikkoa sitten
vanhempi
commit
200120a6bc

+ 0 - 199
src/api/followUp.ts

@@ -1,199 +0,0 @@
-import request from './request'
-
-// 复诊记录实体
-export interface FollowUp {
-  id: string // Snowflake 64位ID 使用字符串保存以避免 JS Number 精度丢失
-  patientUserId: string
-  doctorUserId: string
-  appointmentTime: string // 预约时间
-  actualTime?: string // 实际就诊时间
-  status: 'PENDING' | 'CONFIRMED' | 'CANCELLED' | 'COMPLETED' // 状态
-  reason?: string // 复诊原因
-  notes?: string // 备注信息
-  createTime: string // 创建时间
-  updateTime: string // 更新时间
-  patientNickname?: string // 患者昵称
-  doctorNickname?: string // 医生昵称
-}
-
-// 分页查询参数
-export interface FollowUpQueryParams {
-  pageNum?: number
-  pageSize?: number
-  startTime?: string
-  endTime?: string
-}
-
-// 医生查询患者复诊记录参数
-export interface DoctorListByPatientParams extends FollowUpQueryParams {
-  patientUserId: string | number
-}
-
-// 创建复诊请求参数
-export interface CreateFollowUpRequest {
-  doctorUserId: string | number
-  appointmentTime: string
-  reason?: string
-}
-
-// 更新复诊请求参数
-export interface UpdateFollowUpRequest {
-  appointmentTime?: string
-  status?: 'PENDING' | 'CONFIRMED' | 'CANCELLED' | 'COMPLETED'
-  notes?: string
-  reason?: string
-}
-
-// 分页响应
-export interface FollowUpPageResponse {
-  records: FollowUp[]
-  total: number
-  size: number
-  current: number
-  orders: Array<{ column: string; asc: boolean }>
-  optimizeCountSql: boolean
-  searchCount: boolean
-  optimizeJoinOfCountSql: boolean
-  maxLimit: number
-  countId: string
-  pages: number
-}
-
-/**
- * 创建复诊请求
- * @param payload 创建复诊请求参数
- */
-export async function createFollowUp(payload: CreateFollowUpRequest) {
-  const res: any = await request({
-    url: 'https://wx.baiyun.work/follow-up/create',
-    method: 'POST',
-    header: { 'Content-Type': 'application/json' },
-    data: payload
-  })
-  
-  // 强制把 Snowflake ID 字段转换为字符串,避免后续使用 Number 导致精度丢失
-  try {
-    const parsed = res?.data as any
-    if (parsed && parsed.code === 200 && parsed.data) {
-      parsed.data = {
-        ...parsed.data,
-        id: String(parsed.data.id),
-        patientUserId: String(parsed.data.patientUserId),
-        doctorUserId: String(parsed.data.doctorUserId)
-      }
-      res.data = parsed
-    }
-  } catch (e) {
-    // ignore
-  }
-  
-  return res
-}
-
-/**
- * 更新复诊记录
- * @param id 复诊记录ID
- * @param payload 更新复诊请求参数
- */
-export async function updateFollowUp(id: string | number, payload: UpdateFollowUpRequest) {
-  const res: any = await request({
-    url: `https://wx.baiyun.work/follow-up/${encodeURIComponent(String(id))}`,
-    method: 'PUT',
-    header: { 'Content-Type': 'application/json' },
-    data: payload
-  })
-  
-  // 强制把 Snowflake ID 字段转换为字符串,避免后续使用 Number 导致精度丢失
-  try {
-    const parsed = res?.data as any
-    if (parsed && parsed.code === 200 && parsed.data) {
-      parsed.data = {
-        ...parsed.data,
-        id: String(parsed.data.id),
-        patientUserId: String(parsed.data.patientUserId),
-        doctorUserId: String(parsed.data.doctorUserId)
-      }
-      res.data = parsed
-    }
-  } catch (e) {
-    // ignore
-  }
-  
-  return res
-}
-
-/**
- * 分页查询复诊记录
- * @param query 查询参数
- */
-export async function getFollowUpList(query: FollowUpQueryParams) {
-  const res: any = await request({
-    url: 'https://wx.baiyun.work/follow-up/list',
-    method: 'POST',
-    header: { 'Content-Type': 'application/json' },
-    data: query
-  })
-  
-  // 强制把 Snowflake ID 字段转换为字符串,避免后续使用 Number 导致精度丢失
-  try {
-    const parsed = res?.data as any
-    if (parsed && parsed.code === 200 && parsed.data && Array.isArray(parsed.data.records)) {
-      parsed.data.records = parsed.data.records.map((r: any) => ({
-        ...r,
-        id: String(r.id),
-        patientUserId: String(r.patientUserId),
-        doctorUserId: String(r.doctorUserId)
-      }))
-      res.data = parsed
-    }
-  } catch (e) {
-    // ignore
-  }
-  
-  return res
-}
-
-/**
- * 医生分页查询患者复诊记录
- * @param params 查询参数,包含patientUserId
- * @param query 查询条件
- */
-export async function getFollowUpListByPatient(params: DoctorListByPatientParams, query: Omit<FollowUpQueryParams, 'patientUserId'>) {
-  const qs = `?patientUserId=${encodeURIComponent(String(params.patientUserId))}`
-  const res: any = await request({
-    url: 'https://wx.baiyun.work/follow-up/list-by-patient' + qs,
-    method: 'POST',
-    header: { 'Content-Type': 'application/json' },
-    data: query
-  })
-  
-  // 强制把 Snowflake ID 字段转换为字符串,避免后续使用 Number 导致精度丢失
-  try {
-    const parsed = res?.data as any
-    if (parsed && parsed.code === 200 && parsed.data && Array.isArray(parsed.data.records)) {
-      parsed.data.records = parsed.data.records.map((r: any) => ({
-        ...r,
-        id: String(r.id),
-        patientUserId: String(r.patientUserId),
-        doctorUserId: String(r.doctorUserId)
-      }))
-      res.data = parsed
-    }
-  } catch (e) {
-    // ignore
-  }
-  
-  return res
-}
-
-/**
- * 删除复诊记录
- * @param id 复诊记录ID
- */
-export async function deleteFollowUp(id: string | number) {
-  const res: any = await request({
-    url: `https://wx.baiyun.work/follow-up/${encodeURIComponent(String(id))}`,
-    method: 'DELETE'
-  })
-  return res
-}

+ 2 - 8
src/api/userActivity.ts

@@ -18,12 +18,7 @@ export const ACTIVITY_TYPES = {
 
 
   // 健康档案相关
   // 健康档案相关
   HEALTH_RECORD_CREATE: 'HEALTH_RECORD_CREATE',
   HEALTH_RECORD_CREATE: 'HEALTH_RECORD_CREATE',
-  HEALTH_RECORD_UPDATE: 'HEALTH_RECORD_UPDATE',
-
-  // 复诊相关
-  FOLLOW_UP_CREATE: 'FOLLOW_UP_CREATE',
-  FOLLOW_UP_UPDATE: 'FOLLOW_UP_UPDATE',
-  FOLLOW_UP_CONFIRM: 'FOLLOW_UP_CONFIRM'
+  HEALTH_RECORD_UPDATE: 'HEALTH_RECORD_UPDATE'
 } as const
 } as const
 
 
 // 相关实体类型常量
 // 相关实体类型常量
@@ -32,8 +27,7 @@ export const RELATED_ENTITY_TYPES = {
   BLOOD_PRESSURE: 'BLOOD_PRESSURE',
   BLOOD_PRESSURE: 'BLOOD_PRESSURE',
   HEART_RATE: 'HEART_RATE',
   HEART_RATE: 'HEART_RATE',
   PHYSICAL_DATA: 'PHYSICAL_DATA',
   PHYSICAL_DATA: 'PHYSICAL_DATA',
-  HEALTH_RECORD: 'HEALTH_RECORD',
-  FOLLOW_UP: 'FOLLOW_UP'
+  HEALTH_RECORD: 'HEALTH_RECORD'
 } as const
 } as const
 
 
 // 查询患者动态的请求参数接口
 // 查询患者动态的请求参数接口

+ 0 - 18
src/pages.json

@@ -108,12 +108,6 @@
 				"navigationBarTitleText": "患者建档信息"
 				"navigationBarTitleText": "患者建档信息"
 			}
 			}
 		},
 		},
-		{
-			"path": "pages/patient/profile/infos/followup-edit",
-			"style": {
-				"navigationBarTitleText": "编辑复诊预约"
-			}
-		},
 		{
 		{
 			"path": "pages/patient/index/my-doctor",
 			"path": "pages/patient/index/my-doctor",
 			"style": {
 			"style": {
@@ -186,24 +180,12 @@
 				"navigationBarTitleText": "我的病人"
 				"navigationBarTitleText": "我的病人"
 			}
 			}
 		},
 		},
-		{
-			"path": "pages/doctor/manage/followup",
-			"style": {
-				"navigationBarTitleText": "复诊管理"
-			}
-		},
 		{
 		{
 			"path": "pages/doctor/manage/medicine",
 			"path": "pages/doctor/manage/medicine",
 			"style": {
 			"style": {
 				"navigationBarTitleText": "药品信息管理"
 				"navigationBarTitleText": "药品信息管理"
 			}
 			}
 		},
 		},
-		{
-			"path": "pages/patient/profile/infos/followup-request",
-			"style": {
-				"navigationBarTitleText": "申请复诊"
-			}
-		},
 		{
 		{
 			"path": "pages/patient/index/family",
 			"path": "pages/patient/index/family",
 			"style": {
 			"style": {

+ 3 - 43
src/pages/doctor/index/index.vue

@@ -205,33 +205,10 @@ const fetchTodayReminders = async () => {
     const token = uni.getStorageSync('token')
     const token = uni.getStorageSync('token')
     if (!token) return
     if (!token) return
     
     
-    // 获取复诊数据
-    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 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 = {
     todayReminders.value = {
-      pendingCount,
-      confirmedCount
+      pendingCount: 0,
+      confirmedCount: 0
     }
     }
   } catch (err) {
   } catch (err) {
     console.error('Fetch today reminders error:', err)
     console.error('Fetch today reminders error:', err)
@@ -356,8 +333,6 @@ function handleScan(res: any) {
 function onItemClick(type: string) {
 function onItemClick(type: string) {
   if (type === '我的病人') {
   if (type === '我的病人') {
     uni.navigateTo({ url: '/pages/doctor/index/my-patients' })
     uni.navigateTo({ url: '/pages/doctor/index/my-patients' })
-  } else if (type === '复诊管理') {
-    uni.navigateTo({ url: '/pages/doctor/manage/followup' })
   } else {
   } else {
     uni.showToast({ title: '功能正在开发中', icon: 'none' })
     uni.showToast({ title: '功能正在开发中', icon: 'none' })
   }
   }
@@ -412,21 +387,6 @@ const formatActivityDescription = (activity: any) => {
     case 'MEDICATION_UPDATE':
     case 'MEDICATION_UPDATE':
       baseDescription = '更新了用药记录'
       baseDescription = '更新了用药记录'
       break
       break
-    case 'FOLLOW_UP_CREATE':
-      baseDescription = '提交了复诊申请'
-      break
-    case 'FOLLOW_UP_UPDATE':
-      baseDescription = '更新了复诊信息'
-      break
-    case 'FOLLOW_UP_CONFIRM':
-      baseDescription = '医生已确认复诊'
-      break
-    case 'FOLLOW_UP_CANCEL':
-      baseDescription = '医生已取消复诊'
-      break
-    case 'FOLLOW_UP_COMPLETE':
-      baseDescription = '医生已完成复诊'
-      break
     case 'USER_BINDING_CREATE':
     case 'USER_BINDING_CREATE':
       baseDescription = '绑定了新患者'
       baseDescription = '绑定了新患者'
       break
       break

+ 0 - 432
src/pages/doctor/manage/followup.vue

@@ -1,432 +0,0 @@
-<template>
-  <CustomNav title="复诊管理" leftType="back" />
-  <view class="page-container">
-    <view class="tabs">
-      <view 
-        class="tab" 
-        :class="{ active: activeTab === 'pending' }" 
-        @click="activeTab = 'pending'"
-      >
-        待处理({{ pendingCount }})
-      </view>
-      <view 
-        class="tab" 
-        :class="{ active: activeTab === 'confirmed' }" 
-        @click="activeTab = 'confirmed'"
-      >
-        已确认({{ confirmedCount }})
-      </view>
-      <view 
-        class="tab" 
-        :class="{ active: activeTab === 'completed' }" 
-        @click="activeTab = 'completed'"
-      >
-        已完成({{ completedCount }})
-      </view>
-      <view 
-        class="tab" 
-        :class="{ active: activeTab === 'cancelled' }" 
-        @click="activeTab = 'cancelled'"
-      >
-        已取消({{ cancelledCount }})
-      </view>
-    </view>
-
-    <view class="followup-list" v-if="filteredFollowups.length > 0">
-      <view 
-        class="followup-card" 
-        v-for="followup in filteredFollowups" 
-        :key="followup.id"
-      >
-        <view class="card-header">
-          <view class="patient-info">
-            <text class="patient-name">{{ followup.patientNickname || '未知患者' }}</text>
-            <text class="request-time">{{ formattedFollowups[followup.id]?.requestTime }}</text>
-          </view>
-          <view class="status-badge" :class="followup.status">
-            {{ getStatusText(followup.status) }}
-          </view>
-        </view>
-        
-        <view class="card-body">
-          <view class="info-row">
-            <text class="label">预约时间:</text>
-            <text class="value">{{ formattedFollowups[followup.id]?.scheduledTime }}</text>
-          </view>
-          <view class="info-row">
-            <text class="label">复诊原因:</text>
-            <text class="value">{{ followup.reason || '无' }}</text>
-          </view>
-        </view>
-        
-        <view class="card-footer" v-if="followup.status === 'PENDING'">
-          <button class="action-btn cancel" @click="cancelFollowup(followup.id)">取消</button>
-          <button class="action-btn confirm" @click="confirmFollowup(followup.id)">确认</button>
-        </view>
-        
-        <view class="card-footer" v-else-if="followup.status === 'CONFIRMED'">
-          <button class="action-btn cancel" @click="cancelFollowup(followup.id)">取消</button>
-          <button class="action-btn complete" @click="completeFollowup(followup.id)">标记为完成</button>
-        </view>
-      </view>
-    </view>
-    
-    <view class="empty-state" v-else>
-      <image class="empty-icon" src="/static/icons/remixicon/article-line.svg" />
-      <text class="empty-text">暂无复诊请求</text>
-    </view>
-  </view>
-</template>
-
-<script setup lang="ts">
-import { ref, computed, onMounted } from 'vue'
-import CustomNav from '@/components/custom-nav.vue'
-import { formatDate } from '@/utils/date'
-import { getFollowUpList, updateFollowUp } from '@/api/followUp'
-import type { FollowUp } from '@/api/followUp'
-
-type FollowupRequest = FollowUp
-
-const activeTab = ref<'pending' | 'confirmed' | 'completed' | 'cancelled'>('pending')
-const followups = ref<FollowupRequest[]>([])
-
-// 统计各状态数量
-const pendingCount = computed(() => followups.value.filter(f => f.status === 'PENDING').length)
-const confirmedCount = computed(() => followups.value.filter(f => f.status === 'CONFIRMED').length)
-const completedCount = computed(() => followups.value.filter(f => f.status === 'COMPLETED').length)
-const cancelledCount = computed(() => followups.value.filter(f => f.status === 'CANCELLED').length)
-
-// 根据标签页过滤的复诊数据
-const filteredFollowups = computed(() => {
-  switch (activeTab.value) {
-    case 'pending':
-      return followups.value.filter(f => f.status === 'PENDING')
-    case 'confirmed':
-      return followups.value.filter(f => f.status === 'CONFIRMED')
-    case 'completed':
-      return followups.value.filter(f => f.status === 'COMPLETED')
-    case 'cancelled':
-      return followups.value.filter(f => f.status === 'CANCELLED')
-    default:
-      return followups.value
-  }
-})
-
-// 格式化后的复诊数据
-const formattedFollowups = computed(() => {
-  const formatted: Record<string, { requestTime: string; scheduledTime: string }> = {}
-  followups.value.forEach(followup => {
-    formatted[followup.id] = {
-      requestTime: formatDate(followup.createTime),
-      scheduledTime: formatDate(followup.appointmentTime)
-    }
-  })
-  return formatted
-})
-
-// 获取状态文本
-const getStatusText = (status: string) => {
-  switch (status) {
-    case 'PENDING': return '待处理'
-    case 'CONFIRMED': return '已确认'
-    case 'COMPLETED': return '已完成'
-    case 'CANCELLED': return '已取消'
-    default: return status
-  }
-}
-
-// 获取复诊请求数据
-const fetchFollowups = async () => {
-  uni.showLoading({ title: '加载中...' })
-  
-  try {
-    const token = uni.getStorageSync('token')
-    if (!token) {
-      uni.hideLoading()
-      uni.showToast({
-        title: '未登录',
-        icon: 'none'
-      })
-      return
-    }
-    
-    // 获取当前医生ID
-    const userInfo = uni.getStorageSync('user_info')
-    const doctorUserId = userInfo?.id
-    
-    if (!doctorUserId) {
-      uni.hideLoading()
-      uni.showToast({
-        title: '获取医生信息失败',
-        icon: 'none'
-      })
-      return
-    }
-    
-    // 调用API获取复诊列表
-    const response: any = await getFollowUpList({})
-    
-    uni.hideLoading()
-    
-    if (response && response.data && response.data.code === 200) {
-      // 修复:使用records的实际长度而不是total字段
-      followups.value = response.data.data.records || []
-    } else {
-      uni.showToast({
-        title: '获取复诊数据失败',
-        icon: 'none'
-      })
-    }
-  } catch (error) {
-    uni.hideLoading()
-    console.error('获取复诊数据失败:', error)
-    uni.showToast({
-      title: '获取复诊数据失败',
-      icon: 'none'
-    })
-  }
-}
-
-// 取消复诊请求
-const cancelFollowup = (id: string) => {
-  uni.showModal({
-    title: '确认取消',
-    content: '确定要取消这个复诊请求吗?',
-    success: (res) => {
-      if (res.confirm) {
-        // 调用API更新复诊请求状态
-        updateFollowUpStatus(id, 'CANCELLED')
-      }
-    }
-  })
-}
-
-// 确认复诊请求
-const confirmFollowup = (id: string) => {
-  uni.showModal({
-    title: '确认复诊',
-    content: '确定要确认这个复诊请求吗?',
-    success: (res) => {
-      if (res.confirm) {
-        // 调用API更新复诊请求状态
-        updateFollowUpStatus(id, 'CONFIRMED')
-      }
-    }
-  })
-}
-
-// 完成复诊
-const completeFollowup = (id: string) => {
-  uni.showModal({
-    title: '完成复诊',
-    content: '确定已完成本次复诊吗?',
-    success: (res) => {
-      if (res.confirm) {
-        // 调用API更新复诊请求状态
-        updateFollowUpStatus(id, 'COMPLETED')
-      }
-    }
-  })
-}
-
-// 更新复诊请求状态
-const updateFollowUpStatus = async (id: string, status: 'PENDING' | 'CONFIRMED' | 'CANCELLED' | 'COMPLETED') => {
-  uni.showLoading({ title: '处理中...' })
-  
-  try {
-    const response: any = await updateFollowUp(id, { status })
-    
-    uni.hideLoading()
-    
-    if (response && response.data && response.data.code === 200) {
-      // 更新本地数据
-      const index = followups.value.findIndex(f => f.id === id)
-      if (index !== -1) {
-        followups.value[index].status = status
-      }
-      uni.showToast({ title: '操作成功', icon: 'success' })
-    } else {
-      uni.showToast({
-        title: '操作失败',
-        icon: 'none'
-      })
-    }
-  } catch (error) {
-    uni.hideLoading()
-    console.error('更新复诊状态失败:', error)
-    uni.showToast({
-      title: '操作失败',
-      icon: 'none'
-    })
-  }
-}
-
-onMounted(() => {
-  fetchFollowups()
-})
-</script>
-
-<style scoped>
-.page-container {
-  min-height: 100vh;
-  background-color: #f5f5f5;
-  padding-top: calc(var(--status-bar-height) + 44px);
-  padding-bottom: 40rpx;
-}
-
-.tabs {
-  display: flex;
-  background-color: #fff;
-  border-bottom: 1rpx solid #eee;
-}
-
-.tab {
-  flex: 1;
-  text-align: center;
-  padding: 30rpx 0;
-  font-size: 28rpx;
-  color: #666;
-}
-
-.tab.active {
-  color: #3742fa;
-  border-bottom: 4rpx solid #3742fa;
-}
-
-.followup-list {
-  padding: 20rpx;
-}
-
-.followup-card {
-  background-color: #fff;
-  border-radius: 20rpx;
-  margin-bottom: 20rpx;
-  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
-  overflow: hidden;
-}
-
-.card-header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  padding: 30rpx;
-  border-bottom: 1rpx solid #eee;
-}
-
-.patient-info {
-  display: flex;
-  flex-direction: column;
-}
-
-.patient-name {
-  font-size: 32rpx;
-  font-weight: bold;
-  color: #333;
-  margin-bottom: 10rpx;
-}
-
-.request-time {
-  font-size: 24rpx;
-  color: #999;
-}
-
-.status-badge {
-  padding: 8rpx 16rpx;
-  border-radius: 10rpx;
-  font-size: 24rpx;
-  color: #fff;
-}
-
-.status-badge.PENDING {
-  background-color: #ffa502;
-}
-
-.status-badge.CONFIRMED {
-  background-color: #3742fa;
-}
-
-.status-badge.COMPLETED {
-  background-color: #2ed573;
-}
-
-.status-badge.CANCELLED {
-  background-color: #ccc;
-}
-
-.card-body {
-  padding: 30rpx;
-  border-bottom: 1rpx solid #eee;
-}
-
-.info-row {
-  display: flex;
-  margin-bottom: 20rpx;
-}
-
-.info-row:last-child {
-  margin-bottom: 0;
-}
-
-.label {
-  font-size: 28rpx;
-  color: #666;
-  width: 180rpx;
-}
-
-.value {
-  flex: 1;
-  font-size: 28rpx;
-  color: #333;
-}
-
-.card-footer {
-  display: flex;
-  padding: 30rpx;
-  justify-content: flex-end;
-}
-
-.action-btn {
-  padding: 0 30rpx;
-  height: 60rpx;
-  line-height: 60rpx;
-  border-radius: 10rpx;
-  font-size: 28rpx;
-  margin-left: 20rpx;
-}
-
-.cancel {
-  background-color: #fff;
-  color: #ff4757;
-  border: 1rpx solid #ff4757;
-}
-
-.confirm {
-  background-color: #3742fa;
-  color: #fff;
-}
-
-.complete {
-  background-color: #2ed573;
-  color: #fff;
-}
-
-.empty-state {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  padding: 100rpx 40rpx;
-}
-
-.empty-icon {
-  width: 120rpx;
-  height: 120rpx;
-  margin-bottom: 30rpx;
-  opacity: 0.5;
-}
-
-.empty-text {
-  font-size: 32rpx;
-  color: #666;
-}
-</style>

+ 0 - 15
src/pages/patient-family/index/index.vue

@@ -326,21 +326,6 @@ const formatActivityDescription = (activity: any) => {
     case 'MEDICATION_UPDATE':
     case 'MEDICATION_UPDATE':
       baseDescription = '更新了用药记录'
       baseDescription = '更新了用药记录'
       break
       break
-    case 'FOLLOW_UP_CREATE':
-      baseDescription = '提交了复诊申请'
-      break
-    case 'FOLLOW_UP_UPDATE':
-      baseDescription = '更新了复诊信息'
-      break
-    case 'FOLLOW_UP_CONFIRM':
-      baseDescription = '医生已确认复诊'
-      break
-    case 'FOLLOW_UP_CANCEL':
-      baseDescription = '医生已取消复诊'
-      break
-    case 'FOLLOW_UP_COMPLETE':
-      baseDescription = '医生已完成复诊'
-      break
     case 'USER_BINDING_CREATE':
     case 'USER_BINDING_CREATE':
       baseDescription = '绑定了新家人'
       baseDescription = '绑定了新家人'
       break
       break

+ 2 - 320
src/pages/patient/index/my-doctor.vue

@@ -18,41 +18,6 @@
 
 
 
 
 
 
-      <!-- 复诊记录 -->
-      <view class="followup-section" v-show="followUps.length > 0">
-        <view class="section-title">我的复诊记录</view>
-        <view class="followup-list">
-          <view class="followup-card" v-for="followUp in followUps" :key="followUp.id">
-            <view class="card-header">
-              <view class="status-badge" :class="followUp.status">
-                {{ getFollowUpStatusText(followUp.status) }}
-              </view>
-            </view>
-
-            <view class="card-content">
-              <view class="info-row">
-                <text class="info-label">预约时间:</text>
-                <text class="info-value">{{ formatDate(followUp.appointmentTime) }}</text>
-              </view>
-
-              <view class="info-row" v-if="followUp.reason">
-                <text class="info-label">复诊原因:</text>
-                <text class="info-value reason-text">{{ followUp.reason }}</text>
-              </view>
-
-              <!-- 操作按钮:仅对PENDING和CONFIRMED状态显示 -->
-              <view class="action-row" v-if="followUp.status === 'PENDING' || followUp.status === 'CONFIRMED'">
-                <button class="action-btn secondary" @click="editFollowUp(followUp)">编辑</button>
-                <button class="action-btn cancel" @click="cancelFollowUp(followUp.id)">取消</button>
-              </view>
-            </view>
-          </view>
-        </view>
-      </view>
-
-      <view class="action-buttons" v-if="!hasPendingOrConfirmedFollowUp">
-        <button class="action-btn primary" @click="makeAppointment">预约复诊</button>
-      </view>
     </view>
     </view>
 
 
     <view class="empty-state" v-else>
     <view class="empty-state" v-else>
@@ -69,8 +34,6 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
 import CustomNav from '@/components/custom-nav.vue'
 import CustomNav from '@/components/custom-nav.vue'
 import { listUserBindingsByPatient, type UserBindingResponse, type UserBindingPageResponse } from '@/api/userBinding'
 import { listUserBindingsByPatient, type UserBindingResponse, type UserBindingPageResponse } from '@/api/userBinding'
 import { downloadAvatar } from '@/api/user'
 import { downloadAvatar } from '@/api/user'
-import { getFollowUpList, updateFollowUp, deleteFollowUp } from '@/api/followUp'
-import type { FollowUp } from '@/api/followUp'
 import { formatDate } from '@/utils/date'
 import { formatDate } from '@/utils/date'
 import { avatarCache } from '@/utils/avatarCache'
 import { avatarCache } from '@/utils/avatarCache'
 
 
@@ -91,16 +54,6 @@ const pageData = ref({
   pages: 0
   pages: 0
 })
 })
 
 
-// 复诊记录相关
-const followUps = ref<FollowUp[]>([])
-
-// 计算是否有待处理或已确认的复诊请求
-const hasPendingOrConfirmedFollowUp = computed(() => {
-  return followUps.value.some(followUp => 
-    followUp.status === 'PENDING' || followUp.status === 'CONFIRMED'
-  )
-})
-
 // 调试信息
 // 调试信息
 const debugInfo = ref('')
 const debugInfo = ref('')
 
 
@@ -216,76 +169,6 @@ const fetchDoctorInfo = async () => {
   }
   }
 }
 }
 
 
-// 获取复诊记录
-const fetchFollowUpRecords = async () => {
-  try {
-    const followUpResponse: any = await getFollowUpList({
-      pageNum: 1,
-      pageSize: 10
-    })
-
-    // 检查响应结构
-    if (!followUpResponse) {
-      return
-    }
-
-    if (!followUpResponse.data) {
-      return
-    }
-
-    // 注意:这里需要访问 followUpResponse.data.data 才是真正的数据
-    const apiResponse = followUpResponse.data
-
-    if (apiResponse.code !== 200) {
-      return
-    }
-
-    // 检查实际数据字段
-    const data = apiResponse.data
-
-    if (!data) {
-      return
-    }
-
-    if (!data.records) {
-      return
-    }
-
-    if (!Array.isArray(data.records)) {
-      return
-    }
-
-    // 正常处理records
-    followUps.value = data.records || []
-
-    // 隐藏加载提示(如果有)
-    uni.hideLoading()
-  } catch (error) {
-    console.error('获取复诊记录失败:', error)
-    uni.showToast({
-      title: '获取复诊记录失败',
-      icon: 'none'
-    })
-
-    // 隐藏加载提示(如果有)
-    uni.hideLoading()
-  }
-}
-
-const makeAppointment = () => {
-  // 跳转到复诊申请页面,传递医生信息
-  if (doctorInfo.value) {
-    uni.navigateTo({
-      url: `/pages/patient/profile/infos/followup-request?doctorId=${doctorInfo.value.id}&doctorName=${encodeURIComponent(doctorInfo.value.name)}&boundUserId=${userBindings.value[0]?.boundUserId || ''}`
-    })
-  } else {
-    uni.showToast({
-      title: '未获取到医生信息',
-      icon: 'none'
-    })
-  }
-}
-
 const bindDoctor = () => {
 const bindDoctor = () => {
   uni.showToast({
   uni.showToast({
     title: '绑定医生功能开发中',
     title: '绑定医生功能开发中',
@@ -293,72 +176,15 @@ const bindDoctor = () => {
   })
   })
 }
 }
 
 
-// 编辑复诊记录
-const editFollowUp = (followUp: FollowUp) => {
-  // 跳转到复诊编辑页面,传递复诊记录信息
-  uni.navigateTo({
-    url: `/pages/patient/profile/infos/followup-edit?id=${followUp.id}&doctorId=${doctorInfo.value?.id}&doctorName=${encodeURIComponent(doctorInfo.value?.name || '')}&appointmentTime=${encodeURIComponent(followUp.appointmentTime)}&reason=${encodeURIComponent(followUp.reason || '')}&boundUserId=${userBindings.value[0]?.boundUserId || ''}`
-  })
-}
-
-// 取消复诊记录
-const cancelFollowUp = (id: string) => {
-  uni.showModal({
-    title: '确认取消',
-    content: '确定要取消这个复诊预约吗?',
-    success: (res) => {
-      if (res.confirm) {
-        // 调用接口取消复诊记录
-        updateFollowUp(id, { status: 'CANCELLED' })
-          .then((res: any) => {
-            if (res && res.data && res.data.code === 200) {
-              uni.showToast({
-                title: '取消成功',
-                icon: 'success'
-              })
-              // 重新获取复诊记录列表
-              fetchFollowUpRecords()
-            } else {
-              uni.showToast({
-                title: '取消失败',
-                icon: 'none'
-              })
-            }
-          })
-          .catch((error) => {
-            console.error('取消复诊记录失败:', error)
-            uni.showToast({
-              title: '取消失败',
-              icon: 'none'
-            })
-          })
-      }
-    }
-  })
-}
-
 onLoad(() => {
 onLoad(() => {
   fetchDoctorInfo()
   fetchDoctorInfo()
-  fetchFollowUpRecords()
 })
 })
 
 
 onShow(() => {
 onShow(() => {
-  // 页面每次显示时都刷新复诊记录列表
-  // 这样从创建或编辑页面返回时能获取最新数据
-  fetchFollowUpRecords()
+  // 页面每次显示时都刷新医生信息
+  fetchDoctorInfo()
 })
 })
 
 
-// 获取复诊状态文本
-const getFollowUpStatusText = (status: string) => {
-  switch (status) {
-    case 'PENDING': return '待处理'
-    case 'CONFIRMED': return '已确认'
-    case 'CANCELLED': return '已取消'
-    case 'COMPLETED': return '已完成'
-    default: return status
-  }
-}
-
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
@@ -473,148 +299,4 @@ const getFollowUpStatusText = (status: string) => {
   line-height: 80rpx;
   line-height: 80rpx;
   width: 80%;
   width: 80%;
 }
 }
-
-.followup-section {
-  margin: 0 20rpx 20rpx;
-  background-color: #fff;
-  border-radius: 16rpx;
-  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
-  overflow: hidden;
-  border: 1rpx solid #eee;
-}
-
-.section-title {
-  padding: 24rpx 30rpx;
-  font-size: 32rpx;
-  font-weight: 500;
-  color: #333;
-  border-bottom: 1rpx solid #eee;
-}
-
-.followup-list {
-  padding: 20rpx;
-}
-
-.followup-card {
-  background: #fff;
-  border-radius: 12rpx;
-  box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.05);
-  margin-bottom: 20rpx;
-  overflow: hidden;
-  border: 1rpx solid #eee;
-}
-
-.followup-card:last-child {
-  margin-bottom: 0;
-}
-
-.card-header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  padding: 20rpx 24rpx;
-  background-color: #f8f9fa;
-  border-bottom: 1rpx solid #eee;
-}
-
-.status-badge {
-  font-size: 24rpx;
-  padding: 6rpx 20rpx;
-  border-radius: 30rpx;
-  color: #fff;
-  font-weight: normal;
-}
-
-.status-badge.PENDING {
-  background-color: #ff9500;
-}
-
-.status-badge.CONFIRMED {
-  background-color: #007aff;
-}
-
-.status-badge.COMPLETED {
-  background-color: #34c759;
-}
-
-.status-badge.CANCELLED {
-  background-color: #8e8e93;
-}
-
-.appointment-time {
-  font-size: 24rpx;
-  color: #666;
-}
-
-.card-content {
-  padding: 24rpx;
-}
-
-.info-row {
-  display: flex;
-  margin-bottom: 16rpx;
-  align-items: flex-start;
-}
-
-.info-row:last-child {
-  margin-bottom: 0;
-}
-
-.info-label {
-  color: #888;
-  font-size: 26rpx;
-  width: 140rpx;
-  flex-shrink: 0;
-}
-
-.info-value {
-  flex: 1;
-  color: #333;
-  font-size: 26rpx;
-  line-height: 1.5;
-}
-
-.reason-text {
-  color: #555;
-}
-
-.action-row {
-  display: flex;
-  gap: 20rpx;
-  margin-top: 20rpx;
-  padding-top: 20rpx;
-  border-top: 1rpx solid #eee;
-}
-
-.action-btn {
-  flex: 1;
-  border-radius: 10rpx;
-  font-size: 28rpx;
-  line-height: 70rpx;
-}
-
-.primary {
-  background-color: #3742fa;
-  color: #fff;
-}
-
-.secondary {
-  background-color: #f0f0f0;
-  color: #333;
-}
-
-.cancel {
-  background-color: #ff4757;
-  color: #fff;
-}
-
-.debug-info {
-  padding: 20rpx;
-  background-color: #ffeb3b;
-  color: #333;
-  font-size: 28rpx;
-  margin: 20rpx;
-  border-radius: 10rpx;
-  white-space: pre-wrap;
-}
 </style>
 </style>

+ 0 - 212
src/pages/patient/profile/infos/followup-edit.vue

@@ -1,212 +0,0 @@
-<template>
-  <CustomNav title="编辑复诊预约" leftType="back" />
-  <view class="page-container">
-    <view class="form-container">
-      <view class="form-item">
-        <text class="form-label">预约医生</text>
-        <input class="form-input" disabled :value="doctorName" />
-      </view>
-      
-      <view class="form-item">
-        <text class="form-label">预约时间</text>
-        <picker mode="date" :value="formData.date" @change="onDateChange" start="2020-01-01" end="2030-12-31">
-          <view class="picker">
-            {{ formData.date || '请选择日期' }}
-          </view>
-        </picker>
-      </view>
-      
-      <view class="form-item">
-        <picker mode="time" :value="formData.time" @change="onTimeChange">
-          <view class="picker">
-            {{ formData.time || '请选择时间' }}
-          </view>
-        </picker>
-      </view>
-      
-      <view class="form-item">
-        <text class="form-label">复诊原因</text>
-        <textarea class="form-textarea" placeholder="请输入复诊原因(可选)" v-model="formData.reason" />
-      </view>
-      
-      <button class="submit-btn" @click="submitForm">保存修改</button>
-    </view>
-  </view>
-</template>
-
-<script setup lang="ts">
-import { ref, reactive } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
-import CustomNav from '@/components/custom-nav.vue'
-import { updateFollowUp } from '@/api/followUp'
-import { formatDate } from '@/utils/date'
-
-const doctorName = ref('')
-const doctorId = ref('')
-const followUpId = ref('')
-
-const formData = reactive({
-  date: '',
-  time: '',
-  reason: ''
-})
-
-onLoad((options) => {
-  if (options) {
-    // 获取传递的参数
-    doctorName.value = decodeURIComponent(options.doctorName || '')
-    doctorId.value = options.doctorId || ''
-    followUpId.value = options.id || ''
-    
-    // 解析预约时间
-    if (options.appointmentTime) {
-      const timeStr = decodeURIComponent(options.appointmentTime)
-      const dateObj = new Date(timeStr)
-      formData.date = formatDisplayDate(dateObj)
-      formData.time = `${String(dateObj.getHours()).padStart(2, '0')}:${String(dateObj.getMinutes()).padStart(2, '0')}`
-    }
-    
-    // 获取复诊原因
-    formData.reason = decodeURIComponent(options.reason || '')
-  }
-})
-
-const onDateChange = (e: any) => {
-  formData.date = e.detail.value
-}
-
-const onTimeChange = (e: any) => {
-  formData.time = e.detail.value
-}
-
-const formatDisplayDate = (d: Date) => {
-  const x = new Date(d)
-  const y = x.getFullYear()
-  const m = String(x.getMonth() + 1).padStart(2, '0')
-  const day = String(x.getDate()).padStart(2, '0')
-  return `${y}-${m}-${day}`
-}
-
-const submitForm = async () => {
-  if (!formData.date) {
-    uni.showToast({
-      title: '请选择预约日期',
-      icon: 'none'
-    })
-    return
-  }
-  
-  if (!formData.time) {
-    uni.showToast({
-      title: '请选择预约时间',
-      icon: 'none'
-    })
-    return
-  }
-  
-  // 构造完整的预约时间
-  const appointmentTime = `${formData.date}T${formData.time}:00`
-  
-  uni.showLoading({
-    title: '保存中...'
-  })
-  
-  try {
-    const res: any = await updateFollowUp(followUpId.value, {
-      appointmentTime,
-      reason: formData.reason || undefined
-    })
-    
-    uni.hideLoading()
-    
-    if (res && res.data && res.data.code === 200) {
-      uni.showToast({
-        title: '保存成功',
-        icon: 'success'
-      })
-      
-      // 返回上一页并刷新数据
-      setTimeout(() => {
-        uni.navigateBack()
-      }, 1000)
-    } else {
-      uni.showToast({
-        title: res.data?.message || '保存失败',
-        icon: 'none'
-      })
-    }
-  } catch (error) {
-    uni.hideLoading()
-    console.error('编辑复诊预约失败:', error)
-    uni.showToast({
-      title: '保存失败',
-      icon: 'none'
-    })
-  }
-}
-</script>
-
-<style scoped>
-.page-container {
-  min-height: 100vh;
-  background-color: #f5f5f5;
-  padding-top: calc(var(--status-bar-height) + 44px);
-  padding-bottom: 40rpx;
-}
-
-.form-container {
-  padding: 20rpx;
-  background-color: #fff;
-  margin: 20rpx;
-  border-radius: 20rpx;
-}
-
-.form-item {
-  padding: 30rpx 0;
-  border-bottom: 1rpx solid #eee;
-}
-
-.form-item:last-child {
-  border-bottom: none;
-}
-
-.form-label {
-  display: block;
-  font-size: 30rpx;
-  color: #333;
-  margin-bottom: 20rpx;
-  font-weight: 500;
-}
-
-.form-input {
-  font-size: 28rpx;
-  color: #333;
-  padding: 10rpx 0;
-}
-
-.picker {
-  font-size: 28rpx;
-  color: #333;
-  padding: 10rpx 0;
-}
-
-.form-textarea {
-  width: 100%;
-  height: 150rpx;
-  font-size: 28rpx;
-  color: #333;
-  padding: 10rpx 0;
-  border: 1rpx solid #eee;
-  border-radius: 10rpx;
-  box-sizing: border-box;
-}
-
-.submit-btn {
-  background-color: #3742fa;
-  color: #fff;
-  border-radius: 10rpx;
-  font-size: 32rpx;
-  line-height: 80rpx;
-  margin-top: 50rpx;
-}
-</style>

+ 0 - 254
src/pages/patient/profile/infos/followup-request.vue

@@ -1,254 +0,0 @@
-<template>
-  <CustomNav title="申请复诊" leftType="back" />
-  <view class="page-container">
-    <view class="form-container">
-      <view class="form-item">
-        <text class="label">就诊医生</text>
-        <view class="value">{{ doctorInfo?.name || '暂无绑定医生' }}</view>
-      </view>
-      
-      <view class="form-item">
-        <text class="label">预约时间</text>
-        <picker mode="date" :value="scheduledDate" @change="onDateChange">
-          <view class="picker">
-            {{ scheduledDate ? formatDate(scheduledDate) : '请选择预约日期' }}
-          </view>
-        </picker>
-      </view>
-      
-      <view class="form-item">
-        <picker mode="time" :value="scheduledTime" @change="onTimeChange">
-          <view class="picker">
-            {{ scheduledTime || '请选择预约时间' }}
-          </view>
-        </picker>
-      </view>
-      
-      <view class="form-item textarea-item">
-        <text class="label">复诊原因</text>
-        <textarea 
-          placeholder="请输入复诊原因..." 
-          v-model="reason"
-          maxlength="200"
-        />
-        <text class="char-count">{{ reason.length }}/200</text>
-      </view>
-      
-      <button class="submit-btn" @click="submitRequest" :disabled="!canSubmit">
-        提交申请
-      </button>
-    </view>
-  </view>
-</template>
-
-<script setup lang="ts">
-import { ref, computed, onMounted } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
-import CustomNav from '@/components/custom-nav.vue'
-import { formatDate } from '@/utils/date'
-import { createFollowUp } from '@/api/followUp'
-import type { CreateFollowUpRequest } from '@/api/followUp'
-
-interface DoctorInfo {
-  id: string
-  name: string
-}
-
-const doctorInfo = ref<DoctorInfo | null>(null)
-const scheduledDate = ref('')
-const scheduledTime = ref('')
-const reason = ref('')
-
-// 是否可以提交
-const canSubmit = computed(() => {
-  return doctorInfo.value && scheduledDate.value && scheduledTime.value && reason.value.trim()
-})
-
-// 日期选择
-const onDateChange = (e: any) => {
-  scheduledDate.value = e.detail.value
-}
-
-// 时间选择
-const onTimeChange = (e: any) => {
-  scheduledTime.value = e.detail.value
-}
-
-// 页面加载时获取传递的参数
-onLoad((options) => {
-  if (options && options.doctorId && options.doctorName) {
-    doctorInfo.value = {
-      id: options.boundUserId || options.doctorId,  // 优先使用医生用户ID
-      name: decodeURIComponent(options.doctorName)
-    }
-  } else {
-    // 如果没有传递参数,尝试获取绑定的医生信息
-    fetchDoctorInfo()
-  }
-})
-
-// 获取绑定的医生信息
-const fetchDoctorInfo = () => {
-  // 这里应该调用实际的 API 获取绑定的医生信息
-  // 示例数据
-  doctorInfo.value = {
-    id: '1',
-    name: '张医生'
-  }
-}
-
-// 提交复诊申请
-const submitRequest = async () => {
-  if (!canSubmit.value) return
-  
-  uni.showLoading({ title: '提交中...' })
-  
-  try {
-    const token = uni.getStorageSync('token')
-    if (!token) {
-      uni.hideLoading()
-      uni.showToast({
-        title: '未登录',
-        icon: 'none'
-      })
-      return
-    }
-    
-    // 获取当前患者ID
-    const userInfo = uni.getStorageSync('user_info')
-    const patientUserId = userInfo?.id
-    
-    if (!patientUserId) {
-      uni.hideLoading()
-      uni.showToast({
-        title: '获取患者信息失败',
-        icon: 'none'
-      })
-      return
-    }
-    
-    // 构造预约时间,使用 ISO 8601 标准格式
-    const appointmentTime = new Date(`${scheduledDate.value}T${scheduledTime.value}:00`).toISOString()
-    
-    // 构造创建复诊请求的参数
-    const payload: CreateFollowUpRequest = {
-      doctorUserId: doctorInfo.value!.id,
-      appointmentTime,
-      reason: reason.value.trim()
-    }
-    
-    // 调用API提交复诊申请
-    const response: any = await createFollowUp(payload)
-    
-    uni.hideLoading()
-    
-    if (response && response.data && response.data.code === 200) {
-      uni.showModal({
-        title: '提交成功',
-        content: '复诊申请已提交,请等待医生确认',
-        showCancel: false,
-        confirmText: '知道了',
-        success: () => {
-          uni.navigateBack()
-        }
-      })
-    } else {
-      uni.showToast({
-        title: '提交失败',
-        icon: 'none'
-      })
-    }
-  } catch (error) {
-    uni.hideLoading()
-    console.error('提交复诊申请失败:', error)
-    uni.showToast({
-      title: '提交失败',
-      icon: 'none'
-    })
-  }
-}
-
-onMounted(() => {
-  // 如果onLoad没有设置医生信息,再尝试获取
-  if (!doctorInfo.value) {
-    fetchDoctorInfo()
-  }
-})
-</script>
-
-<style scoped>
-.page-container {
-  min-height: 100vh;
-  background-color: #f5f5f5;
-  padding-top: calc(var(--status-bar-height) + 44px);
-  padding-bottom: 40rpx;
-}
-
-.form-container {
-  padding: 20rpx;
-}
-
-.form-item {
-  background-color: #fff;
-  border-radius: 20rpx;
-  padding: 30rpx;
-  margin-bottom: 20rpx;
-  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
-}
-
-.label {
-  font-size: 32rpx;
-  color: #333;
-  display: block;
-  margin-bottom: 20rpx;
-  font-weight: bold;
-}
-
-.value {
-  font-size: 28rpx;
-  color: #666;
-}
-
-.picker {
-  font-size: 28rpx;
-  color: #666;
-  padding: 20rpx 0;
-}
-
-.textarea-item {
-  position: relative;
-}
-
-.textarea-item textarea {
-  width: 100%;
-  height: 200rpx;
-  font-size: 28rpx;
-  color: #333;
-  border: 1rpx solid #eee;
-  border-radius: 10rpx;
-  padding: 20rpx;
-  box-sizing: border-box;
-}
-
-.char-count {
-  position: absolute;
-  right: 20rpx;
-  bottom: 20rpx;
-  font-size: 24rpx;
-  color: #999;
-}
-
-.submit-btn {
-  background-color: #3742fa;
-  color: #fff;
-  border-radius: 10rpx;
-  font-size: 32rpx;
-  height: 80rpx;
-  line-height: 80rpx;
-  margin-top: 40rpx;
-}
-
-.submit-btn[disabled] {
-  background-color: #ccc;
-}
-</style>