WXL
3 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
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
361
362
<template>
  <view class="doctor-container">
    <!-- 医院信息 -->
    <view class="hospital-info card">
      <image :src="hospital.logo" mode="aspectFit" class="logo" />
      <view class="info">
        <text class="name">{{ hospital.name }}</text>
        <text class="address">{{ hospital.address }}</text>
        <view class="tags">
          <text v-for="(tag, idx) in hospital.tags" :key="idx">{{ tag }}</text>
        </view>
      </view>
    </view>
 
    <!-- 科室信息 -->
    <view class="department-info card">
      <view class="title-wrap">
        <image :src="department.icon" mode="aspectFit" class="icon" />
        <text class="title">{{ department.name }}</text>
      </view>
      <text class="desc">{{ department.description }}</text>
    </view>
    
    <!-- 医生列表 -->
    <view class="doctor-list">
      <view 
        class="doctor-item card"
        v-for="(doctor, index) in doctors"
        :key="index"
        @tap="selectDoctor(doctor)"
      >
        <view class="basic-info">
          <image :src="doctor.avatar" mode="aspectFill" class="avatar" />
          <view class="info">
            <view class="name-title">
              <text class="name">{{ doctor.name }}</text>
              <text class="title">{{ doctor.title }}</text>
            </view>
            <text class="hospital">{{ hospital.name }}</text>
            <text class="specialty">{{ doctor.specialty }}</text>
            <view class="tags">
              <text v-for="(tag, idx) in doctor.tags" :key="idx">{{ tag }}</text>
            </view>
          </view>
          <view class="rating">
            <text class="score">{{ doctor.rating }}</text>
            <text class="count">{{ doctor.ratingCount }}条评价</text>
          </view>
        </view>
        <view class="schedule-info">
          <view class="available-time">
            <text class="label">近期可约:</text>
            <view class="time-list">
              <view 
                class="time-item"
                v-for="(time, idx) in doctor.availableTimes"
                :key="idx"
              >
                <text class="date">{{ time.date }}</text>
                <text class="count">余{{ time.count }}个</text>
              </view>
            </view>
          </view>
          <view class="action">
            <view class="fee-info">
              <text class="label">挂号费</text>
              <text class="fee">¥{{ doctor.fee }}</text>
            </view>
            <button class="book-btn primary-btn">预约挂号</button>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
 
<script setup>
import { ref, onMounted } from 'vue'
 
// 医院信息
const hospital = ref({
  id: 1,
  name: '青岛镜湖医院',
  logo: '/static/hospital/kiang-wu.jpg',
  address: '青岛连胜马路33号',
  tags: ['综合医院', '24小时急诊', '特需门诊'],
  rating: 4.8,
  distance: 2.5
})
 
// 科室信息
const department = ref({
  name: '心内科',
  icon: '/static/department/cardiology.png',
  description: '主要诊治心血管疾病,包括冠心病、高血压等'
})
 
// 医生列表
const doctors = ref([
  {
    id: 1,
    name: '张医生',
    title: '主任医师',
    avatar: '/static/doctor/doctor1.jpg',
    specialty: '擅长:冠心病、心律失常、高血压等心血管疾病的诊治',
    tags: ['专家门诊', '手术专家'],
    rating: 4.9,
    ratingCount: 2381,
    fee: 100,
    availableTimes: [
      { date: '今天', count: 5 },
      { date: '明天', count: 8 },
      { date: '后天', count: 12 }
    ]
  },
  // ... 其他医生数据
])
 
// 选择医生
const selectDoctor = (doctor) => {
  uni.navigateTo({
    url: `/pages/appointment/schedule?doctorId=${doctor.id}`
  })
}
 
// 获取科室ID并加载数据
onMounted(() => {
  const pages = getCurrentPages()
  const page = pages[pages.length - 1]
  const departmentId = page.$page?.options?.departmentId
  const hospitalId = page.$page?.options?.hospitalId
  
  // 加载数据
  loadHospitalInfo(hospitalId)
  loadDepartmentInfo(departmentId)
  loadDoctors(departmentId)
})
 
// 加载医院信息
const loadHospitalInfo = (hospitalId) => {
  // 这里应该是从API获取医院信息
  console.log('加载医院信息:', hospitalId)
}
</script>
 
<style lang="scss">
.doctor-container {
  min-height: 100vh;
  background: $bg-color;
  padding: 20rpx;
  
  .hospital-info {
    margin-bottom: 20rpx;
    display: flex;
    align-items: center;
    
    .logo {
      width: 100rpx;
      height: 100rpx;
      border-radius: $radius-md;
      margin-right: 20rpx;
    }
    
    .info {
      flex: 1;
      
      .name {
        font-size: 32rpx;
        color: $text-primary;
        font-weight: bold;
        margin-bottom: 8rpx;
        display: block;
      }
      
      .address {
        font-size: 26rpx;
        color: $text-regular;
        margin-bottom: 12rpx;
        display: block;
      }
      
      .tags {
        text {
          display: inline-block;
          font-size: 22rpx;
          color: $primary-color;
          background: $primary-light;
          padding: 4rpx 12rpx;
          border-radius: $radius-sm;
          margin-right: 10rpx;
          margin-bottom: 10rpx;
        }
      }
    }
  }
  
  .department-info {
    margin-bottom: 20rpx;
    
    .title-wrap {
      display: flex;
      align-items: center;
      margin-bottom: 16rpx;
      
      .icon {
        width: 40rpx;
        height: 40rpx;
        margin-right: 10rpx;
      }
      
      .title {
        font-size: 32rpx;
        color: $text-primary;
        font-weight: bold;
      }
    }
    
    .desc {
      font-size: 26rpx;
      color: $text-regular;
      line-height: 1.6;
    }
  }
  
  .doctor-list {
    .doctor-item {
      margin-bottom: 20rpx;
      
      .basic-info {
        display: flex;
        margin-bottom: 20rpx;
        
        .avatar {
          width: 120rpx;
          height: 120rpx;
          border-radius: 60rpx;
          margin-right: 20rpx;
        }
        
        .info {
          flex: 1;
          
          .name-title {
            margin-bottom: 8rpx;
            
            .name {
              font-size: 32rpx;
              color: $text-primary;
              font-weight: bold;
              margin-right: 16rpx;
            }
            
            .title {
              font-size: 26rpx;
              color: $text-regular;
            }
          }
          
          .specialty {
            font-size: 26rpx;
            color: $text-regular;
            margin-bottom: 12rpx;
            display: block;
          }
          
          .tags {
            text {
              @extend .tag;
            }
          }
          
          .hospital {
            font-size: 26rpx;
            color: $primary-color;
            margin-bottom: 8rpx;
            display: block;
          }
        }
        
        .rating {
          text-align: right;
          
          .score {
            font-size: 36rpx;
            color: $primary-color;
            font-weight: bold;
            margin-bottom: 4rpx;
            display: block;
          }
          
          .count {
            font-size: 22rpx;
            color: $text-secondary;
          }
        }
      }
      
      .schedule-info {
        padding-top: 20rpx;
        border-top: 1rpx solid #eee;
        
        .available-time {
          margin-bottom: 20rpx;
          
          .label {
            font-size: 26rpx;
            color: $text-regular;
            margin-bottom: 12rpx;
            display: block;
          }
          
          .time-list {
            display: flex;
            
            .time-item {
              margin-right: 30rpx;
              
              .date {
                font-size: 26rpx;
                color: $primary-color;
                margin-right: 8rpx;
              }
              
              .count {
                font-size: 24rpx;
                color: $text-secondary;
              }
            }
          }
        }
        
        .action {
          display: flex;
          justify-content: space-between;
          align-items: center;
          
          .fee-info {
            .label {
              font-size: 26rpx;
              color: $text-regular;
              margin-right: 8rpx;
            }
            
            .fee {
              font-size: 32rpx;
              color: $danger;
              font-weight: bold;
            }
          }
          
          .book-btn {
            width: 160rpx;
            height: 60rpx;
            line-height: 60rpx;
            font-size: 26rpx;
          }
        }
      }
    }
  }
}
</style>