WXL
昨天 888f941ae16c850c0f1a844ec9436058840920bd
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
<template>
  <view class="featured-all">
    <!-- 顶部搜索 -->
    <view class="search-bar">
      <view class="search-box">
        <text class="iconfont icon-search"></text>
        <input 
          type="text"
          v-model="keyword"
          placeholder="搜索特色医疗项目"
          @input="onSearch"
        />
      </view>
      <view class="filter-btn" @tap="showFilter">
        <text class="iconfont icon-filter"></text>
        筛选
      </view>
    </view>
    
    <!-- 分类标签 -->
    <scroll-view 
      scroll-x 
      class="category-bar"
      :show-scrollbar="false"
    >
      <view 
        class="category-item"
        v-for="(item, index) in categories"
        :key="index"
        :class="{ active: currentCategory === item.id }"
        @tap="selectCategory(item)"
      >
        <text>{{ item.name }}</text>
      </view>
    </scroll-view>
    
    <!-- 特色医疗列表 -->
    <scroll-view 
      scroll-y 
      class="featured-list"
      refresher-enabled
      :refresher-triggered="refreshing"
      @refresherrefresh="onRefresh"
      @scrolltolower="loadMore"
    >
      <view 
        class="featured-item"
        v-for="(item, index) in featuredList"
        :key="index"
        @tap="viewDetail(item)"
      >
        <image :src="item.image" mode="aspectFill" class="cover-image" />
        <view class="content">
          <view class="info">
            <text class="name">{{ item.name }}</text>
            <text class="desc">{{ item.desc }}</text>
            <view class="tags">
              <text v-for="(tag, idx) in item.tags" :key="idx">{{ tag }}</text>
            </view>
          </view>
          <view class="stats">
            <view class="stat-item">
              <text class="value">{{ item.doctors }}+</text>
              <text class="label">专家医生</text>
            </view>
            <view class="stat-item">
              <text class="value">{{ item.cases }}+</text>
              <text class="label">成功案例</text>
            </view>
            <view class="stat-item">
              <text class="value">{{ item.rating }}</text>
              <text class="label">用户评分</text>
            </view>
          </view>
        </view>
      </view>
      
      <!-- 加载更多 -->
      <uni-load-more 
        :status="loadMoreStatus"
        :content-text="{
          contentdown: '上拉加载更多',
          contentrefresh: '加载中...',
          contentnomore: '没有更多了'
        }"
      />
    </scroll-view>
    
    <!-- 筛选抽屉 -->
    <uni-drawer ref="filterDrawer" mode="right">
      <view class="filter-drawer">
        <view class="drawer-header">
          <text class="title">筛选条件</text>
          <text class="reset" @tap="resetFilter">重置</text>
        </view>
        
        <!-- 医院 -->
        <view class="filter-section">
          <text class="section-title">医院</text>
          <view class="tag-list">
            <text 
              v-for="(item, index) in hospitals"
              :key="index"
              :class="{ active: filter.hospital === item.value }"
              @tap="selectHospital(item.value)"
            >{{ item.label }}</text>
          </view>
        </view>
        
        <!-- 价格区间 -->
        <view class="filter-section">
          <text class="section-title">价格区间</text>
          <view class="tag-list">
            <text 
              v-for="(item, index) in priceRanges"
              :key="index"
              :class="{ active: filter.priceRange === item.value }"
              @tap="selectPriceRange(item.value)"
            >{{ item.label }}</text>
          </view>
        </view>
        
        <!-- 排序方式 -->
        <view class="filter-section">
          <text class="section-title">排序方式</text>
          <view class="sort-list">
            <view 
              class="sort-item"
              v-for="(item, index) in sortOptions"
              :key="index"
              :class="{ active: filter.sort === item.value }"
              @tap="selectSort(item.value)"
            >
              <text>{{ item.label }}</text>
              <text class="iconfont icon-check"></text>
            </view>
          </view>
        </view>
        
        <!-- 底部按钮 -->
        <view class="drawer-footer">
          <button 
            class="confirm-btn primary-btn"
            @tap="applyFilter"
          >确定</button>
        </view>
      </view>
    </uni-drawer>
  </view>
</template>
 
<script setup>
import { ref } from 'vue'
 
// 搜索关键词
const keyword = ref('')
 
// 当前分类
const currentCategory = ref(0)
 
// 分类列表
const categories = ref([
  { id: 0, name: '全部' },
  { id: 1, name: '中医特色' },
  { id: 2, name: '跨境医疗' },
  { id: 3, name: '专家门诊' },
  { id: 4, name: '特色科室' }
])
 
// 特色医疗列表
const featuredList = ref([
  {
    id: 1,
    name: '中医特色诊疗',
    desc: '传承千年中医精华,守护您的健康',
    image: '/static/featured/tcm.jpg',
    tags: ['针灸推拿', '中药调理', '艾灸养生'],
    doctors: 20,
    cases: 1000,
    rating: 4.9
  },
  {
    id: 2,
    name: '跨境医疗服务',
    desc: '连接全球优质医疗资源',
    image: '/static/featured/cross-border.jpg',
    tags: ['专家会诊', '转诊服务', '康复护理'],
    doctors: 30,
    cases: 500,
    rating: 4.8
  },
  {
    id: 3,
    name: '专家门诊',
    desc: '汇聚顶尖医疗专家',
    image: '/static/featured/expert.jpg',
    tags: ['名医问诊', '远程会诊', '特需门诊'],
    doctors: 50,
    cases: 2000,
    rating: 4.9
  }
])
 
// 筛选条件
const filter = ref({
  hospital: '',
  priceRange: '',
  sort: 'default'
})
 
// 医院选项
const hospitals = [
  { value: 'jh', label: '镜湖医院' },
  { value: 'kd', label: '科大医院' }
]
 
// 价格区间
const priceRanges = [
  { value: '0-500', label: '500以下' },
  { value: '500-1000', label: '500-1000' },
  { value: '1000-2000', label: '1000-2000' },
  { value: '2000+', label: '2000以上' }
]
 
// 排序选项
const sortOptions = [
  { value: 'default', label: '综合排序' },
  { value: 'rating', label: '评分最高' },
  { value: 'cases', label: '案例最多' }
]
 
// 加载状态
const refreshing = ref(false)
const loadMoreStatus = ref('more')
 
// 搜索
const onSearch = (e) => {
  const value = e.detail.value.trim()
  // 这里处理搜索逻辑
}
 
// 选择分类
const selectCategory = (category) => {
  currentCategory.value = category.id
  // 这里加载对应分类的列表
}
 
// 查看详情
const viewDetail = (item) => {
  const routes = {
    1: '/pages/featured/tcm',
    2: '/pages/featured/cross-border',
    3: '/pages/featured/expert'
  }
  
  uni.navigateTo({
    url: routes[item.id] || '/pages/featured/project'
  })
}
 
// 显示筛选抽屉
const filterDrawer = ref(null)
const showFilter = () => {
  filterDrawer.value.open()
}
 
// 重置筛选
const resetFilter = () => {
  filter.value = {
    hospital: '',
    priceRange: '',
    sort: 'default'
  }
}
 
// 选择医院
const selectHospital = (value) => {
  filter.value.hospital = value
}
 
// 选择价格区间
const selectPriceRange = (value) => {
  filter.value.priceRange = value
}
 
// 选择排序方式
const selectSort = (value) => {
  filter.value.sort = value
}
 
// 应用筛选
const applyFilter = () => {
  filterDrawer.value.close()
  // 这里处理筛选逻辑
}
 
// 下拉刷新
const onRefresh = () => {
  // 这里处理刷新逻辑
  setTimeout(() => {
    refreshing.value = false
  }, 1000)
}
 
// 加载更多
const loadMore = () => {
  if (loadMoreStatus.value !== 'more') return
  loadMoreStatus.value = 'loading'
  
  // 这里处理加载更多逻辑
  setTimeout(() => {
    loadMoreStatus.value = 'noMore'
  }, 1000)
}
</script>
 
<style lang="scss">
.featured-all {
  min-height: 100vh;
  background: $bg-color;
  
  .search-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 20rpx;
    background: #fff;
    
    .search-box {
      flex: 1;
      height: 72rpx;
      background: $bg-color;
      border-radius: $radius-xl;
      display: flex;
      align-items: center;
      padding: 0 20rpx;
      margin-right: 20rpx;
      
      .iconfont {
        font-size: 32rpx;
        color: $text-secondary;
        margin-right: 12rpx;
      }
      
      input {
        flex: 1;
        height: 100%;
        font-size: 28rpx;
      }
    }
    
    .filter-btn {
      display: flex;
      align-items: center;
      font-size: 28rpx;
      color: $text-regular;
      
      .iconfont {
        font-size: 32rpx;
        margin-right: 4rpx;
      }
    }
  }
  
  .category-bar {
    background: #fff;
    white-space: nowrap;
    padding: 20rpx;
    
    .category-item {
      display: inline-block;
      padding: 12rpx 30rpx;
      margin-right: 20rpx;
      font-size: 28rpx;
      color: $text-regular;
      background: $bg-color;
      border-radius: $radius-lg;
      
      &.active {
        color: #fff;
        background: $primary-gradient;
      }
      
      &:last-child {
        margin-right: 0;
      }
    }
  }
  
  .featured-list {
    height: calc(100vh - 184rpx);
    padding: 20rpx;
    
    .featured-item {
      background: #fff;
      border-radius: $radius-lg;
      margin-bottom: 20rpx;
      overflow: hidden;
      
      .cover-image {
        width: 100%;
        height: 300rpx;
      }
      
      .content {
        padding: 20rpx;
        
        .info {
          margin-bottom: 20rpx;
          
          .name {
            font-size: 32rpx;
            color: $text-primary;
            font-weight: bold;
            margin-bottom: 8rpx;
            display: block;
          }
          
          .desc {
            font-size: 26rpx;
            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: 12rpx;
            }
          }
        }
        
        .stats {
          display: flex;
          border-top: 1rpx solid $border-color;
          padding-top: 20rpx;
          
          .stat-item {
            flex: 1;
            text-align: center;
            
            .value {
              font-size: 32rpx;
              color: $primary-color;
              font-weight: bold;
              margin-bottom: 4rpx;
              display: block;
            }
            
            .label {
              font-size: 24rpx;
              color: $text-secondary;
            }
          }
        }
      }
      
      &:active {
        transform: scale(0.99);
      }
    }
  }
  
  .filter-drawer {
    height: 100%;
    background: #fff;
    padding: 30rpx;
    
    .drawer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 30rpx;
      
      .title {
        font-size: 32rpx;
        color: $text-primary;
        font-weight: bold;
      }
      
      .reset {
        font-size: 28rpx;
        color: $text-secondary;
      }
    }
    
    .filter-section {
      margin-bottom: 30rpx;
      
      .section-title {
        font-size: 30rpx;
        color: $text-primary;
        font-weight: bold;
        margin-bottom: 20rpx;
      }
      
      .tag-list {
        display: flex;
        flex-wrap: wrap;
        gap: 20rpx;
        
        text {
          font-size: 26rpx;
          color: $text-regular;
          background: $bg-color;
          padding: 12rpx 30rpx;
          border-radius: $radius-lg;
          
          &.active {
            color: #fff;
            background: $primary-gradient;
          }
        }
      }
      
      .sort-list {
        .sort-item {
          display: flex;
          justify-content: space-between;
          align-items: center;
          height: 88rpx;
          padding: 0 20rpx;
          font-size: 28rpx;
          color: $text-regular;
          
          .iconfont {
            font-size: 32rpx;
            color: $primary-color;
            opacity: 0;
          }
          
          &.active {
            color: $primary-color;
            
            .iconfont {
              opacity: 1;
            }
          }
        }
      }
    }
    
    .drawer-footer {
      position: absolute;
      left: 30rpx;
      right: 30rpx;
      bottom: 30rpx;
      
      .confirm-btn {
        width: 100%;
        height: 88rpx;
        line-height: 88rpx;
        font-size: 30rpx;
        color: #fff;
        background: $primary-gradient;
        border-radius: $radius-xl;
        
        &:active {
          transform: scale(0.98);
        }
      }
    }
  }
}
</style>