WXL
2025-12-19 da459f4addc08dede5b91f1f4e87e6c1c6d3c88e
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
<template>
  <view class="report-detail">
    <!-- 报告基本信息 -->
    <view class="info-card">
      <view class="header">
        <text class="title">{{ report.name }}</text>
        <text class="status" :class="report.status">{{ report.statusText }}</text>
      </view>
      <view class="info-list">
        <view class="info-item">
          <text class="label">检查时间</text>
          <text class="value">{{ report.checkTime }}</text>
        </view>
        <view class="info-item">
          <text class="label">报告时间</text>
          <text class="value">{{ report.reportTime }}</text>
        </view>
        <view class="info-item">
          <text class="label">检查科室</text>
          <text class="value">{{ report.department }}</text>
        </view>
        <view class="info-item">
          <text class="label">检查医生</text>
          <text class="value">{{ report.doctor }}</text>
        </view>
      </view>
    </view>
    
    <!-- 检查结果 -->
    <view class="result-card">
      <view class="section-title">检查结果</view>
      <view class="result-content">
        <text>{{ report.result }}</text>
      </view>
      
      <!-- 检查图片 -->
      <block v-if="report.images?.length">
        <view class="section-title">检查图片</view>
        <view class="image-list">
          <image 
            v-for="(image, index) in report.images"
            :key="index"
            :src="image"
            mode="aspectFill"
            @tap="previewImage(index)"
          />
        </view>
      </block>
    </view>
    
    <!-- 医生建议 -->
    <view class="advice-card">
      <view class="section-title">医生建议</view>
      <view class="advice-content">
        <text>{{ report.advice }}</text>
      </view>
    </view>
    
    <!-- 底部按钮 -->
    <view class="bottom-buttons">
      <button class="action-btn outline" @tap="downloadReport">下载报告</button>
      <button class="action-btn primary" @tap="shareReport">分享报告</button>
    </view>
  </view>
</template>
 
<script setup>
import { ref, onMounted } from 'vue'
 
// 报告数据
const report = ref({
  id: 1,
  name: '心电图检查报告',
  status: 'normal', // normal-正常 abnormal-异常
  statusText: '正常',
  checkTime: '2024-03-25 09:30',
  reportTime: '2024-03-25 10:30',
  department: '心内科',
  doctor: '张医生',
  result: '窦性心律,心率75次/分,各导联ST-T未见明显异常。',
  images: [
    '/static/report/ecg1.jpg',
    '/static/report/ecg2.jpg'
  ],
  advice: '建议定期复查,保持良好的生活习惯,适量运动。'
})
 
// 预览图片
const previewImage = (index) => {
  uni.previewImage({
    urls: report.value.images,
    current: index
  })
}
 
// 下载报告
const downloadReport = () => {
  uni.showLoading({
    title: '下载中...'
  })
  
  // 这里调用下载API
  setTimeout(() => {
    uni.hideLoading()
    uni.showToast({
      title: '下载成功',
      icon: 'success'
    })
  }, 1500)
}
 
// 分享报告
const shareReport = () => {
  uni.share({
    provider: 'weixin',
    scene: 'WXSceneSession',
    type: 1,
    summary: `${report.value.name} - ${report.value.statusText}`,
    success: (res) => {
      console.log('分享成功:', res)
    },
    fail: (err) => {
      console.error('分享失败:', err)
    }
  })
}
 
onMounted(() => {
  const pages = getCurrentPages()
  const page = pages[pages.length - 1]
  const id = page.$page?.options?.id
  
  // 加载报告数据
  loadReport(id)
})
 
// 加载报告数据
const loadReport = (id) => {
  // 这里调用API获取数据
  console.log('加载报告:', id)
}
</script>
 
<style lang="scss">
.report-detail {
  min-height: 100vh;
  background: $bg-color;
  padding: 20rpx 20rpx 120rpx;
  
  .info-card {
    background: #fff;
    border-radius: $radius-lg;
    padding: 30rpx;
    margin-bottom: 20rpx;
    
    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20rpx;
      
      .title {
        font-size: 32rpx;
        color: $text-primary;
        font-weight: bold;
      }
      
      .status {
        font-size: 24rpx;
        padding: 4rpx 12rpx;
        border-radius: $radius-sm;
        
        &.normal {
          color: $success;
          background: rgba($success, 0.1);
        }
        
        &.abnormal {
          color: $warning;
          background: rgba($warning, 0.1);
        }
      }
    }
    
    .info-list {
      .info-item {
        display: flex;
        justify-content: space-between;
        margin-bottom: 16rpx;
        
        &:last-child {
          margin-bottom: 0;
        }
        
        .label {
          font-size: 26rpx;
          color: $text-regular;
        }
        
        .value {
          font-size: 26rpx;
          color: $text-primary;
        }
      }
    }
  }
  
  .result-card,
  .advice-card {
    background: #fff;
    border-radius: $radius-lg;
    padding: 30rpx;
    margin-bottom: 20rpx;
    
    .section-title {
      font-size: 30rpx;
      color: $text-primary;
      font-weight: bold;
      margin-bottom: 20rpx;
    }
    
    .result-content,
    .advice-content {
      text {
        font-size: 28rpx;
        color: $text-regular;
        line-height: 1.6;
      }
    }
    
    .image-list {
      display: flex;
      flex-wrap: wrap;
      gap: 20rpx;
      
      image {
        width: 220rpx;
        height: 220rpx;
        border-radius: $radius-sm;
      }
    }
  }
  
  .bottom-buttons {
    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>