فهرست منبع

refactor(patient): 重构患者首页和健康页面功能模块

- 移除健康档案和用药管理的重复入口
- 更新首页功能项标题和描述文案
- 删除健康资讯模块及相关样式
- 调整页面导航逻辑和路由配置
- 清理无用的新闻列表数据和相关代码
- 优化页面结构和样式定义
mcbaiyun 1 ماه پیش
والد
کامیت
e0df4fedc8
2فایلهای تغییر یافته به همراه13 افزوده شده و 235 حذف شده
  1. 1 94
      src/pages/patient/health/index.vue
  2. 12 141
      src/pages/patient/index/index.vue

+ 1 - 94
src/pages/patient/health/index.vue

@@ -12,7 +12,7 @@
         <view class="menu-item" @click="openDetail('physical','weight')">
           <image src="/static/icons/remixicon/weight.svg" class="menu-icon" mode="widthFix" />
           <text class="menu-text">体重</text>
-          <text class="menu-value">80.0 公斤</text>
+          <text class="menu-value">--</text>
           <uni-icons class="menu-arrow" type="arrowright" size="20" color="#c0c0c0" />
         </view>
         <view class="menu-item" @click="openDetail('physical','bmi')">
@@ -40,19 +40,6 @@
       </view>
     </view>
 
-    <view class="health-record-card">
-      <view class="record-button" @click="openRecord">
-        <image src="/static/icons/remixicon/article-line.svg" class="record-icon" mode="widthFix" />
-        <text class="record-text">健康档案</text>
-        <uni-icons class="record-arrow" type="arrowright" size="20" color="#c0c0c0" />
-      </view>
-      <view class="medication-button" @click="openMedication">
-        <image src="/static/icons/remixicon/capsule-fill.svg" class="medication-icon" mode="widthFix" />
-        <text class="medication-text">用药管理</text>
-        <uni-icons class="medication-arrow" type="arrowright" size="20" color="#c0c0c0" />
-      </view>
-    </view>
-
     <view class="reminder-card">
       <view class="reminder-button" @click="openReminder">
         <image src="/static/icons/remixicon/alarm-line.svg" class="reminder-icon" mode="widthFix" />
@@ -77,17 +64,9 @@ const openDetail = (type: string, metric?: string) => {
   uni.navigateTo({ url })
 }
 
-const openRecord = () => {
-  uni.navigateTo({ url: '../profile/infos/patient-filing' })
-}
-
 const openReminder = () => {
   uni.navigateTo({ url: 'reminder' })
 }
-
-const openMedication = () => {
-  uni.navigateTo({ url: 'medication' })
-}
 </script>
 
 <style scoped>
@@ -159,42 +138,6 @@ const openMedication = () => {
   display: inline-block;
 }
 
-.health-record-card {
-  margin-top: 20rpx;
-  padding: 50rpx 0rpx;
-}
-
-.record-button {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-  padding: 30rpx 40rpx;
-  background-color: #fff;
-  border-radius: 12rpx;
-}
-
-.record-text {
-  font-size: 32rpx;
-  color: #000000;
-  flex: 1;
-  letter-spacing: 1rpx;
-}
-
-.record-arrow {
-  display: inline-flex;
-  align-items: center;
-  justify-content: center;
-  width: 44rpx;
-  height: 44rpx;
-}
-
-.record-icon {
-  width: 40rpx;
-  height: 40rpx;
-  margin-right: 30rpx;
-  display: inline-block;
-}
-
 .reminder-card {
   margin-top: 20rpx;
   padding: 50rpx 0rpx;
@@ -230,40 +173,4 @@ const openMedication = () => {
   margin-right: 30rpx;
   display: inline-block;
 }
-
-.medication-card {
-  margin-top: 20rpx;
-  padding: 50rpx 0rpx;
-}
-
-.medication-button {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-  padding: 30rpx 40rpx;
-  background-color: #fff;
-  border-radius: 12rpx;
-}
-
-.medication-text {
-  font-size: 32rpx;
-  color: #000000;
-  flex: 1;
-  letter-spacing: 1rpx;
-}
-
-.medication-arrow {
-  display: inline-flex;
-  align-items: center;
-  justify-content: center;
-  width: 44rpx;
-  height: 44rpx;
-}
-
-.medication-icon {
-  width: 40rpx;
-  height: 40rpx;
-  margin-right: 30rpx;
-  display: inline-block;
-}
 </style>

+ 12 - 141
src/pages/patient/index/index.vue

@@ -30,13 +30,13 @@
               <text class="item-desc">一键预约复诊</text>
             </view>
           </view>
-          <view class="function-item blue" @click="onItemClick('疑问解答')">
+          <view class="function-item blue" @click="onItemClick('用药管理')">
             <view class="item-content">
               <view class="title-row">
                 <view class="item-line"></view>
-                <text class="item-title">疑问解答</text>
+                <text class="item-title">用药管理</text>
               </view>
-              <text class="item-desc">解答您的健康疑问</text>
+              <text class="item-desc">管理您的用药记录</text>
             </view>
           </view>
 
@@ -51,11 +51,11 @@
               <text class="item-desc">管理您的健康提醒</text>
             </view>
           </view>
-          <view class="function-item purple" @click="onItemClick('个人中心')">
+          <view class="function-item purple" @click="onItemClick('健康档案')">
             <view class="item-content">
               <view class="title-row">
                 <view class="item-line"></view>
-                <text class="item-title">个人中心</text>
+                <text class="item-title">健康档案</text>
               </view>
               <text class="item-desc">管理您的个人健康档案</text>
             </view>
@@ -63,26 +63,6 @@
         </view>
       </view>
 
-      <view class="health-news-card">
-        <view class="card-header">
-          <text class="card-title">健康资讯</text>
-        </view>
-        <view class="card-content">
-          <view class="news-item" v-for="(news, index) in newsList" :key="index">
-            <view v-if="news.image" class="news-image-container">
-              <image class="news-image" :src="news.image" mode="aspectFill" />
-            </view>
-            <view v-else class="news-placeholder">
-              <image class="placeholder-icon" src="/static/icons/remixicon/image-line.svg" />
-            </view>
-            <view class="news-text">
-              <text class="news-title">{{ news.title }}</text>
-              <text class="news-desc">{{ news.desc }}</text>
-            </view>
-          </view>
-        </view>
-      </view>
-
     </view>
   </view>
   <TabBar />
@@ -116,30 +96,6 @@ const avatarSrc = computed(() => {
   return defaultAvatarUrl
 })
 
-const newsList = ref([
-  {
-    title: '健康饮食指南',
-    desc: '了解均衡饮食的重要性,掌握健康饮食的基本原则。',
-    image: '/static/carousel/BHFIIABBCDJII-5kCEkD6zh9.jpg'
-  },
-  {
-    title: '运动与健康',
-    desc: '定期运动对身体的好处,以及如何制定适合自己的运动计划。'
-  },
-  {
-    title: '心理健康维护',
-    desc: '保持良好的心理状态,应对日常生活中的压力和挑战。'
-  },
-  {
-    title: '运动与健康',
-    desc: '定期运动对身体的好处,以及如何制定适合自己的运动计划。'
-  },
-  {
-    title: '心理健康维护',
-    desc: '保持良好的心理状态,应对日常生活中的压力和挑战。'
-  }
-])
-
 const loadUser = () => {
   try {
     const u = uni.getStorageSync('user_info')
@@ -218,12 +174,14 @@ function handleScan(res: any) {
 }
 
 function onItemClick(type: string) {
-  if (type === '个人中心') {
-    uni.switchTab({ url: '/pages/patient/profile/index' })
+  if (type === '健康档案') {
+    uni.navigateTo({ url: '/pages/patient/profile/infos/patient-filing' })
   } else if (type === '提醒管理') {
     uni.navigateTo({ url: '/pages/patient/health/reminder' })
   } else if (type === '我的医生') {
     uni.navigateTo({ url: '/pages/patient/index/my-doctor' })
+  } else if (type === '用药管理') {
+    uni.navigateTo({ url: '/pages/patient/health/medication' })
   } else {
     uni.showToast({ title: '功能正在开发中', icon: 'none' })
   }
@@ -231,7 +189,8 @@ function onItemClick(type: string) {
 
 function onQrClick() {
   uni.navigateTo({ url: '/pages/public/profile/qr/index' })
-}</script>
+}
+</script>
 
 <style>
 .page-container {
@@ -399,92 +358,4 @@ function onQrClick() {
   font-size: 28rpx;
   color: #666;
 }
-
-.health-news-card {
-  background-color: #fff;
-  border-radius: 20rpx;
-  margin: 20rpx;
-  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
-  overflow: hidden;
-}
-
-.card-header {
-  padding: 20rpx;
-  border-bottom: 1rpx solid #eee;
-}
-
-.card-title {
-  font-size: 36rpx;
-  font-weight: bold;
-  color: #333;
-}
-
-.card-content {
-  padding: 20rpx;
-  display: flex;
-  flex-direction: column;
-}
-
-.news-item {
-  display: flex;
-  align-items: center;
-  margin-bottom: 20rpx;
-  padding-bottom: 20rpx;
-  border-bottom: 1rpx solid #eee;
-}
-
-.news-item:last-child {
-  margin-bottom: 0;
-  padding-bottom: 0;
-  border-bottom: none;
-}
-
-.news-image-container {
-  width: 180rpx;
-  height: 130rpx;
-  border-radius: 10rpx;
-  margin-right: 20rpx;
-  overflow: hidden;
-}
-
-.news-image {
-  width: 100%;
-  height: 100%;
-  object-fit: cover;
-}
-
-.news-placeholder {
-  width: 180rpx;
-  height: 130rpx;
-  background-color: #f0f0f0;
-  border-radius: 10rpx;
-  margin-right: 20rpx;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-}
-
-.placeholder-icon {
-  width: 40rpx;
-  height: 40rpx;
-  opacity: 0.5;
-}
-
-.news-text {
-  flex: 1;
-}
-
-.news-title {
-  font-size: 32rpx;
-  font-weight: bold;
-  color: #333;
-  display: block;
-  margin-bottom: 10rpx;
-}
-
-.news-desc {
-  font-size: 28rpx;
-  color: #666;
-  line-height: 1.4;
-}
-</style>
+</style>