WXL
4 天以前 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
<template>
  <view class="disease-detail">
    <!-- 基本信息 -->
    <view class="info-card">
      <text class="name">{{ disease.name }}</text>
      <text class="department">{{ disease.department }}</text>
      <view class="tags">
        <text 
          v-for="(tag, index) in disease.tags"
          :key="index"
        >{{ tag }}</text>
      </view>
    </view>
    
    <!-- 疾病介绍 -->
    <view class="section-card">
      <view class="section-title">疾病介绍</view>
      <text class="content">{{ disease.introduction }}</text>
    </view>
    
    <!-- 病因 -->
    <view class="section-card">
      <view class="section-title">病因</view>
      <view class="cause-list">
        <view 
          class="cause-item"
          v-for="(item, index) in disease.causes"
          :key="index"
        >
          <text class="dot"></text>
          <text class="content">{{ item }}</text>
        </view>
      </view>
    </view>
    
    <!-- 症状表现 -->
    <view class="section-card">
      <view class="section-title">症状表现</view>
      <view class="symptom-list">
        <view 
          class="symptom-item"
          v-for="(item, index) in disease.symptoms"
          :key="index"
        >
          <text class="dot"></text>
          <text class="content">{{ item }}</text>
        </view>
      </view>
    </view>
    
    <!-- 治疗方案 -->
    <view class="section-card">
      <view class="section-title">治疗方案</view>
      <text class="content">{{ disease.treatment }}</text>
    </view>
    
    <!-- 注意事项 -->
    <view class="section-card">
      <view class="section-title">注意事项</view>
      <view class="notice-list">
        <view 
          class="notice-item"
          v-for="(item, index) in disease.notices"
          :key="index"
        >
          <text class="dot"></text>
          <text class="content">{{ item }}</text>
        </view>
      </view>
    </view>
    
    <!-- 相关医生 -->
    <view class="section-card">
      <view class="section-header">
        <text class="title">相关医生</text>
        <text class="more">查看全部</text>
      </view>
      <scroll-view 
        scroll-x 
        class="doctor-list"
        :show-scrollbar="false"
      >
        <view 
          class="doctor-item"
          v-for="(item, index) in disease.doctors"
          :key="index"
          @tap="viewDoctor(item)"
        >
          <image :src="item.avatar" mode="aspectFill" class="avatar" />
          <text class="name">{{ item.name }}</text>
          <text class="title">{{ item.title }}</text>
        </view>
      </scroll-view>
    </view>
    
    <!-- 底部按钮 -->
    <view class="bottom-bar">
      <button class="action-btn outline" @tap="showConsult">在线咨询</button>
      <button class="action-btn primary" @tap="makeAppointment">立即预约</button>
    </view>
  </view>
</template>
 
<script setup>
import { ref, onMounted } from 'vue'
 
// 疾病信息
const disease = ref({
  id: 1,
  name: '冠心病',
  department: '心内科',
  tags: ['常见病', '慢性病', '心血管疾病'],
  introduction: '冠心病是指冠状动脉血管发生动脉粥样硬化病变而引起血管腔狭窄或阻塞,导致心肌缺血、缺氧或坏死而引起的心脏病。',
  causes: [
    '高血压、高血脂、糖尿病等基础疾病',
    '吸烟、饮酒等不良生活习惯',
    '精神压力过大',
    '年龄、性别、遗传因素等'
  ],
  symptoms: [
    '胸痛、胸闷',
    '心悸、气短',
    '乏力、疲劳',
    '出汗、恶心'
  ],
  treatment: '冠心病的治疗包括药物治疗、介入治疗和手术治疗。药物治疗主要包括抗血小板、他汀类调脂、β受体阻滞剂等;介入治疗主要是冠状动脉支架植入术;手术治疗主要是冠状动脉搭桥术。',
  notices: [
    '保持良好的生活习惯,戒烟限酒',
    '合理饮食,控制高盐高脂饮食',
    '适量运动,避免剧烈运动',
    '保持心情愉快,避免情绪波动'
  ],
  doctors: [
    {
      id: 1,
      name: '张医生',
      title: '主任医师',
      avatar: '/static/doctor/avatar1.jpg'
    },
    {
      id: 2,
      name: '李医生',
      title: '副主任医师',
      avatar: '/static/doctor/avatar2.jpg'
    }
  ]
})
 
// 查看医生详情
const viewDoctor = (doctor) => {
  uni.navigateTo({
    url: `/pages/doctor/detail?id=${doctor.id}`
  })
}
 
// 在线咨询
const showConsult = () => {
  uni.showModal({
    title: '提示',
    content: '是否开始在线咨询?',
    success: (res) => {
      if (res.confirm) {
        // 这里处理在线咨询逻辑
      }
    }
  })
}
 
// 立即预约
const makeAppointment = () => {
  uni.navigateTo({
    url: `/pages/appointment/department?disease=${disease.value.name}`
  })
}
 
onMounted(() => {
  const pages = getCurrentPages()
  const page = pages[pages.length - 1]
  const { id } = page.$page?.options || {}
  
  // 这里根据ID加载疾病详情
  console.log('加载疾病详情:', id)
})
</script>
 
<style lang="scss">
.disease-detail {
  min-height: 100vh;
  background: $bg-color;
  padding-bottom: 120rpx;
  
  .info-card {
    background: #fff;
    padding: 30rpx;
    margin-bottom: 20rpx;
    
    .name {
      font-size: 36rpx;
      color: $text-primary;
      font-weight: bold;
      margin-bottom: 12rpx;
      display: block;
    }
    
    .department {
      font-size: 28rpx;
      color: $text-regular;
      margin-bottom: 16rpx;
      display: block;
    }
    
    .tags {
      text {
        display: inline-block;
        font-size: 24rpx;
        color: $primary-color;
        background: $primary-light;
        padding: 4rpx 16rpx;
        border-radius: $radius-sm;
        margin-right: 16rpx;
      }
    }
  }
  
  .section-card {
    background: #fff;
    padding: 30rpx;
    margin-bottom: 20rpx;
    
    .section-title {
      font-size: 32rpx;
      color: $text-primary;
      font-weight: bold;
      margin-bottom: 20rpx;
    }
    
    .section-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20rpx;
      
      .title {
        font-size: 32rpx;
        color: $text-primary;
        font-weight: bold;
      }
      
      .more {
        font-size: 28rpx;
        color: $text-secondary;
      }
    }
    
    .content {
      font-size: 28rpx;
      color: $text-regular;
      line-height: 1.6;
    }
    
    .cause-list,
    .symptom-list,
    .notice-list {
      .cause-item,
      .symptom-item,
      .notice-item {
        display: flex;
        align-items: flex-start;
        margin-bottom: 16rpx;
        
        &:last-child {
          margin-bottom: 0;
        }
        
        .dot {
          width: 12rpx;
          height: 12rpx;
          background: $primary-color;
          border-radius: 50%;
          margin-top: 12rpx;
          margin-right: 12rpx;
          flex-shrink: 0;
        }
        
        .content {
          flex: 1;
          font-size: 28rpx;
          color: $text-regular;
          line-height: 1.6;
        }
      }
    }
    
    .doctor-list {
      white-space: nowrap;
      
      .doctor-item {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        width: 160rpx;
        margin-right: 30rpx;
        
        .avatar {
          width: 120rpx;
          height: 120rpx;
          border-radius: 50%;
          margin-bottom: 12rpx;
        }
        
        .name {
          font-size: 28rpx;
          color: $text-primary;
          margin-bottom: 4rpx;
        }
        
        .title {
          font-size: 24rpx;
          color: $text-secondary;
        }
      }
    }
  }
  
  .bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20rpx 30rpx;
    background: #fff;
    box-shadow: $shadow-lg;
    display: flex;
    gap: 20rpx;
    
    .action-btn {
      flex: 1;
      height: 88rpx;
      line-height: 88rpx;
      font-size: 30rpx;
      border-radius: $radius-xl;
      
      &.outline {
        color: $primary-color;
        background: #fff;
        border: 2rpx solid $primary-color;
      }
      
      &.primary {
        color: #fff;
        background: $primary-gradient;
      }
      
      &:active {
        transform: scale(0.98);
      }
    }
  }
}
</style>