hh-doctor-sdk 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/consultation/detail/behaviors/consultation-chat-behaviors.js +26 -18
- package/components/consultation/detail/behaviors/consultation-header-media-behaviors.js +60 -39
- package/components/consultation/detail/widget/case-image-filter.js +68 -7
- package/components/consultation/reply/consultation-reply-page.wxss +4 -1
- package/components/uikit/media-preview-page/media-preview-page.js +7 -0
- package/components/video-chat-page/behaviors/chat-files-behaviors.js +56 -55
- package/components/video-chat-page/case-group-view/case-group-view.js +6 -1
- package/components/video-chat-page/video-chat-page.js +62 -19
- package/components/video-chat-page/video-chat-page.wxml +1 -0
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ module.exports = Behavior({
|
|
|
48
48
|
data: {
|
|
49
49
|
messageDatas: [], // 原始信息流数据
|
|
50
50
|
messages: [], // 构建信息流数据
|
|
51
|
-
messageMediaFiles: [], // 图片和视频数据
|
|
51
|
+
// messageMediaFiles: [], // 图片和视频数据
|
|
52
52
|
scrollTo: null,
|
|
53
53
|
dateTimeArray: null,
|
|
54
54
|
dateTime: null,
|
|
@@ -180,18 +180,18 @@ module.exports = Behavior({
|
|
|
180
180
|
|
|
181
181
|
if (caseImageList && caseImageList.length > 0) {
|
|
182
182
|
const isVideo = caseImageList[0].imageurl.includes('.mp4')
|
|
183
|
-
message.type = MessageTypes.image
|
|
183
|
+
message.type = isVideo ? MessageTypes.video : MessageTypes.image
|
|
184
184
|
message.images = caseImageList
|
|
185
185
|
message.isVideo = isVideo
|
|
186
186
|
message.cover = isVideo ? caseImageList[0].imageurl + '?x-oss-process=video/snapshot,t_0,f_jpg' : caseImageList[0].smallImage
|
|
187
187
|
message.number = `共${caseImageList.length}${isVideo ? '个' : '张'}`
|
|
188
188
|
message.template = MessageTemplates.image
|
|
189
189
|
|
|
190
|
-
const imageList = caseImageFilter.imageList(caseImageList)
|
|
191
|
-
const messageMediaFiles = this.data.messageMediaFiles.concat(imageList)
|
|
192
|
-
this.setData({
|
|
193
|
-
|
|
194
|
-
})
|
|
190
|
+
// const imageList = caseImageFilter.imageList(caseImageList)
|
|
191
|
+
// const messageMediaFiles = this.data.messageMediaFiles.concat(imageList)
|
|
192
|
+
// this.setData({
|
|
193
|
+
// messageMediaFiles: messageMediaFiles
|
|
194
|
+
// })
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
if (contentType == 'dicom') {
|
|
@@ -279,6 +279,9 @@ module.exports = Behavior({
|
|
|
279
279
|
case MessageTypes.image:
|
|
280
280
|
this.clickMessageImage(messageItem)
|
|
281
281
|
break
|
|
282
|
+
case MessageTypes.video:
|
|
283
|
+
this.clickMessageImage(messageItem, true)
|
|
284
|
+
break
|
|
282
285
|
}
|
|
283
286
|
},
|
|
284
287
|
|
|
@@ -286,20 +289,25 @@ module.exports = Behavior({
|
|
|
286
289
|
* 点击消息
|
|
287
290
|
* @param {*} messageItem
|
|
288
291
|
*/
|
|
289
|
-
clickMessageImage(messageItem) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
292
|
+
clickMessageImage(messageItem, isVideo = false) {
|
|
293
|
+
if (isVideo) {
|
|
294
|
+
const videoList = caseImageFilter.videoList(messageItem.images)
|
|
295
|
+
if (deviceUtils.isPC()) {
|
|
296
|
+
hhNavigation.mediaPreview(videoList, 0)
|
|
297
|
+
} else {
|
|
298
|
+
wx.previewMedia({
|
|
299
|
+
sources: videoList,
|
|
300
|
+
})
|
|
301
|
+
}
|
|
297
302
|
} else {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
303
|
+
let urls = messageItem.images.map(image => {
|
|
304
|
+
return image.imageurl
|
|
305
|
+
})
|
|
306
|
+
wx.previewImage({
|
|
307
|
+
urls: urls,
|
|
301
308
|
})
|
|
302
309
|
}
|
|
310
|
+
|
|
303
311
|
this.setData({
|
|
304
312
|
showPreview: true,
|
|
305
313
|
})
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const pdfViewer = require('../../../public/pdf-viewer')
|
|
2
|
-
const dicomApi = require('../../../apis/dicom-api')
|
|
3
2
|
const caseImageFilter = require('../widget/case-image-filter')
|
|
4
3
|
const hhNavigation = require('../../../hh-navigation')
|
|
5
4
|
const deviceUtil = require('../../../utils/device-utils')
|
|
@@ -42,19 +41,29 @@ module.exports = Behavior({
|
|
|
42
41
|
const type = value.type
|
|
43
42
|
if (value.contentCaseImageList && value.contentCaseImageList.length > 0) {
|
|
44
43
|
const imageList = caseImageFilter.imageList(value.contentCaseImageList)
|
|
44
|
+
const videoList = caseImageFilter.videoList(value.contentCaseImageList)
|
|
45
45
|
const pdfList = caseImageFilter.pdfList(value.contentCaseImageList)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const unit =
|
|
50
|
-
const fileType =
|
|
51
|
-
let thumb =
|
|
52
|
-
const showNumber = !['HISINFO', 'METER'].includes(type.toUpperCase()) ? `共${
|
|
53
|
-
mediaGroups.push(this.mediaItem(groupIndex, fileType, name,
|
|
54
|
-
const allImages = this.data._mediaFiles.concat(imageList)
|
|
55
|
-
this.data._mediaFiles = allImages
|
|
46
|
+
|
|
47
|
+
const imageGroupList = caseImageFilter.mediaGroupList(imageList)
|
|
48
|
+
imageGroupList.forEach(imagesInGroup => {
|
|
49
|
+
const unit = '张'
|
|
50
|
+
const fileType = 0
|
|
51
|
+
let thumb = imagesInGroup[0].thumb
|
|
52
|
+
const showNumber = !['HISINFO', 'METER'].includes(type.toUpperCase()) ? `共${imagesInGroup.length}${unit}` : '点击查看'
|
|
53
|
+
mediaGroups.push(this.mediaItem(groupIndex, fileType, name, imagesInGroup, thumb, showNumber))
|
|
56
54
|
groupIndex++
|
|
57
|
-
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const videoGroupList = caseImageFilter.mediaGroupList(videoList)
|
|
58
|
+
videoGroupList.forEach(videosInGroup => {
|
|
59
|
+
const unit = '个'
|
|
60
|
+
const fileType = 4
|
|
61
|
+
let thumb = videosInGroup[0].url + '?x-oss-process=video/snapshot,t_0,f_jpg'
|
|
62
|
+
const showNumber = !['HISINFO', 'METER'].includes(type.toUpperCase()) ? `共${videosInGroup.length}${unit}` : '点击查看'
|
|
63
|
+
mediaGroups.push(this.mediaItem(groupIndex, fileType, name, videosInGroup, thumb, showNumber))
|
|
64
|
+
groupIndex++
|
|
65
|
+
});
|
|
66
|
+
|
|
58
67
|
if (pdfList.length > 0) {
|
|
59
68
|
const showNumber = pdfList.length > 1 ? `共${pdfList.length}个` : '点击查看'
|
|
60
69
|
mediaGroups.push(this.mediaItem(groupIndex, 1, `${name}PDF`, pdfList, 'https://imgs.hh-medic.com/icon/hh_icon_pdf.png', showNumber))
|
|
@@ -111,34 +120,46 @@ module.exports = Behavior({
|
|
|
111
120
|
showPreview: true,
|
|
112
121
|
})
|
|
113
122
|
const media = this.data.mediaInfo[index]
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
if (deviceUtil.isPC()) {
|
|
121
|
-
hhNavigation.mediaPreview(this.data._mediaFiles, find)
|
|
122
|
-
} else {
|
|
123
|
-
wx.previewMedia({
|
|
124
|
-
current: find >= 0 ? find : 0,
|
|
125
|
-
sources: this.data._mediaFiles,
|
|
123
|
+
switch (media.type) {
|
|
124
|
+
case 0: // 图片
|
|
125
|
+
const images = media.files.map((value) => {
|
|
126
|
+
return value.url
|
|
126
127
|
})
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
128
|
+
wx.previewImage({
|
|
129
|
+
urls: images,
|
|
130
|
+
})
|
|
131
|
+
break
|
|
132
|
+
case 1: // PDF
|
|
133
|
+
const files = media.files
|
|
134
|
+
pdfViewer.viewPdfs(files)
|
|
135
|
+
break
|
|
136
|
+
case 2: // DICOM
|
|
137
|
+
hhNavigation.pathology(this.data.orderId, null, null, true)
|
|
138
|
+
break
|
|
139
|
+
case 4: // 视频
|
|
140
|
+
if (deviceUtil.isPC()) {
|
|
141
|
+
hhNavigation.mediaPreview(media.files, 0)
|
|
142
|
+
} else {
|
|
143
|
+
wx.previewMedia({
|
|
144
|
+
current: 0,
|
|
145
|
+
sources: media.files,
|
|
146
|
+
fail: (err) => {
|
|
147
|
+
console.error(err)
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
break
|
|
152
|
+
case 5: // URL
|
|
153
|
+
if (media.files && media.files.length > 0) {
|
|
154
|
+
const url = media.files[0].url
|
|
155
|
+
// hhNavigation.webPage(url)
|
|
156
|
+
hhNavigation.copyUrl(url)
|
|
157
|
+
}
|
|
158
|
+
break
|
|
159
|
+
case 6: // 病理
|
|
160
|
+
let hospitalId = this.data.order.doctor.hospitalid
|
|
161
|
+
hhNavigation.pathology(this.data.orderId, hospitalId, null, false)
|
|
162
|
+
break
|
|
142
163
|
}
|
|
143
164
|
},
|
|
144
165
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取媒体数据中的图片数据列表,单条数据格式如下:
|
|
3
|
+
*
|
|
4
|
+
* { type: 'image', url: 图片原始地址, thumb: 缩略图地址 }
|
|
5
|
+
*
|
|
6
|
+
* @param {*} caseImageList 媒体数据原始列表
|
|
7
|
+
*/
|
|
1
8
|
function imageList(caseImageList) {
|
|
2
9
|
const images = caseImageList.filter((value, index, array) => {
|
|
3
10
|
if (value.s3key && value.s3key.length > 0) {
|
|
4
|
-
return !value.s3key.endsWith('.pdf')
|
|
11
|
+
return !value.s3key.endsWith('.pdf') && !value.s3key.endsWith('.mp4')
|
|
5
12
|
}
|
|
6
|
-
return value.
|
|
13
|
+
return value.imageurl && !value.imageurl.includes('.pdf') && !value.url.includes('.mp4')
|
|
7
14
|
})
|
|
8
15
|
|
|
9
16
|
const imageDataList = images.map((value, index, array) => {
|
|
10
17
|
const imageurl = value.imageurl
|
|
11
18
|
return {
|
|
12
|
-
type:
|
|
19
|
+
type: 'image',
|
|
13
20
|
url: imageurl,
|
|
14
21
|
thumb: value.smallImage
|
|
15
22
|
}
|
|
@@ -17,12 +24,45 @@ function imageList(caseImageList) {
|
|
|
17
24
|
return imageDataList
|
|
18
25
|
}
|
|
19
26
|
|
|
27
|
+
/**
|
|
28
|
+
* 获取媒体数据中的视频数据列表,单条数据格式如下:
|
|
29
|
+
*
|
|
30
|
+
* { type: 'video', url: 视频原始地址, thumb: 缩略图地址 }
|
|
31
|
+
*
|
|
32
|
+
* @param {*} caseImageList 媒体数据原始列表
|
|
33
|
+
*/
|
|
34
|
+
function videoList(caseImageList) {
|
|
35
|
+
const videos = caseImageList.filter((value, index, array) => {
|
|
36
|
+
if (value.s3key && value.s3key.length > 0) {
|
|
37
|
+
return value.s3key.endsWith('.mp4')
|
|
38
|
+
}
|
|
39
|
+
return value.imageurl && value.imageurl.includes('.mp4')
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const imageDataList = videos.map((value, index, array) => {
|
|
43
|
+
const imageurl = value.imageurl
|
|
44
|
+
return {
|
|
45
|
+
type: 'video',
|
|
46
|
+
url: imageurl,
|
|
47
|
+
thumb: imageurl + '?x-oss-process=video/snapshot,t_0,f_jpg'
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
return imageDataList
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 获取媒体数据中的PDF数据列表,单条数据格式如下:
|
|
55
|
+
*
|
|
56
|
+
* { url: PDF原始地址, name: 文件描述(名字) }
|
|
57
|
+
*
|
|
58
|
+
* @param {*} caseImageList 媒体数据原始列表
|
|
59
|
+
*/
|
|
20
60
|
function pdfList(caseImageList) {
|
|
21
61
|
const pdfs = caseImageList.filter((value, index, array) => {
|
|
22
62
|
if (value.s3key && value.s3key.length > 0) {
|
|
23
63
|
return value.s3key.endsWith('.pdf')
|
|
24
64
|
}
|
|
25
|
-
return value.
|
|
65
|
+
return value.imageurl && value.imageurl.includes('.pdf')
|
|
26
66
|
})
|
|
27
67
|
return pdfs.map((value, index, arary) => {
|
|
28
68
|
return pdfData(value.imageurl, value.imagedesc)
|
|
@@ -34,14 +74,35 @@ function pdfData(url, imagedesc) {
|
|
|
34
74
|
if (index >= 0) {
|
|
35
75
|
url = url.substring(0, index)
|
|
36
76
|
}
|
|
37
|
-
// const name = url.substring(url.lastIndexOf('/') + 1)
|
|
38
77
|
return {
|
|
39
78
|
url: url,
|
|
40
|
-
name: imagedesc
|
|
79
|
+
name: imagedesc,
|
|
80
|
+
thumb: 'https://imgs.hh-medic.com/icon/hh_icon_pdf.png',
|
|
81
|
+
type: 'pdf'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 将媒体资料按照50条数据为上限数量进行分组
|
|
87
|
+
* @param {*} mediaList 媒体数据列表
|
|
88
|
+
*/
|
|
89
|
+
function mediaGroupList(mediaList) {
|
|
90
|
+
const mediaLength = mediaList.length
|
|
91
|
+
let mediaGroups = []
|
|
92
|
+
let groupSize = Math.floor(mediaLength / 50)
|
|
93
|
+
if (mediaLength % 50 > 0) {
|
|
94
|
+
groupSize += 1
|
|
95
|
+
}
|
|
96
|
+
for (let index = 0; index < groupSize; index++) {
|
|
97
|
+
const imagesInGroup = mediaList.slice(index * 50, (index + 1) * 50)
|
|
98
|
+
mediaGroups.push(imagesInGroup)
|
|
41
99
|
}
|
|
100
|
+
return mediaGroups
|
|
42
101
|
}
|
|
43
102
|
|
|
44
103
|
module.exports = {
|
|
45
104
|
imageList,
|
|
46
|
-
|
|
105
|
+
videoList,
|
|
106
|
+
pdfList,
|
|
107
|
+
mediaGroupList
|
|
47
108
|
}
|
|
@@ -57,10 +57,13 @@ scroll-view ::-webkit-scrollbar {
|
|
|
57
57
|
width: 100%;
|
|
58
58
|
display: flex;
|
|
59
59
|
flex-direction: row;
|
|
60
|
-
|
|
60
|
+
overflow-x: auto;
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
padding: 0 30rpx;
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
.order-media-item {
|
|
66
|
+
display: inline-block;
|
|
64
67
|
color: #0592f5;
|
|
65
68
|
font-size: 30rpx;
|
|
66
69
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
const dicomApi = require('../../apis/dicom-api')
|
|
2
|
-
const pdfViewer = require('../../public/pdf-viewer')
|
|
3
|
-
const hhNavigation = require('../../hh-navigation')
|
|
4
1
|
const orderApi = require('../../apis/order-app-api')
|
|
2
|
+
const caseImageFilter = require('../../consultation/detail/widget/case-image-filter')
|
|
5
3
|
|
|
6
4
|
module.exports = Behavior({
|
|
7
5
|
data: {
|
|
8
|
-
_mediaFiles: [], // 图片或视频
|
|
9
6
|
caseGroups: [], // 查看订单中资料
|
|
10
7
|
},
|
|
11
8
|
|
|
@@ -17,19 +14,19 @@ module.exports = Behavior({
|
|
|
17
14
|
loadFiles(order, callback) {
|
|
18
15
|
try {
|
|
19
16
|
let orderMediaPromise = new Promise((resolve, reject) => {
|
|
20
|
-
let mediaFiles = []
|
|
21
17
|
let groups = []
|
|
22
18
|
if (order && order.orderComponent && order.orderComponent.componentBaseList) {
|
|
23
19
|
for (let component of order.orderComponent.componentBaseList) {
|
|
24
20
|
const type = component.type
|
|
25
21
|
const fileList = component.contentCaseImageList
|
|
22
|
+
const name = component.name
|
|
26
23
|
if (fileList && fileList.length > 0) {
|
|
27
24
|
if (type === 'url') {
|
|
28
25
|
// url 类型组件为链接跳转,每个链接作为一个分组使用单独直接点击跳转
|
|
29
26
|
const urlFileList = fileList.map((res) => {
|
|
30
27
|
const item = {
|
|
31
28
|
type: 'url',
|
|
32
|
-
|
|
29
|
+
url: res.imageurl,
|
|
33
30
|
thumb: 'https://image.hh-medic.com/icon/pacs/hh_consulation_dicom_icon.png'
|
|
34
31
|
}
|
|
35
32
|
return item
|
|
@@ -39,45 +36,30 @@ module.exports = Behavior({
|
|
|
39
36
|
files: urlFileList
|
|
40
37
|
})
|
|
41
38
|
} else {
|
|
42
|
-
let
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
let imageList = images.map((file) => {
|
|
46
|
-
const url = file.imageurl
|
|
47
|
-
let thumb = url
|
|
48
|
-
const isVideo = url.endsWith('.mp4')
|
|
49
|
-
if (isVideo) {
|
|
50
|
-
thumb = `${url}?x-oss-process=video/snapshot,t_0,f_jpg`
|
|
51
|
-
}
|
|
39
|
+
let imageList = caseImageFilter.imageList(fileList)
|
|
40
|
+
let videoList = caseImageFilter.videoList(fileList)
|
|
41
|
+
let pdfList = caseImageFilter.pdfList(fileList)
|
|
52
42
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
mediaFiles.push(data)
|
|
59
|
-
return data
|
|
43
|
+
const imageGroupList = caseImageFilter.mediaGroupList(imageList)
|
|
44
|
+
imageGroupList.forEach(imagesInGroup => {
|
|
45
|
+
groups.push({
|
|
46
|
+
title: name + '(图片)',
|
|
47
|
+
files: imagesInGroup
|
|
60
48
|
})
|
|
49
|
+
});
|
|
61
50
|
|
|
51
|
+
const videoGroupList = caseImageFilter.mediaGroupList(videoList)
|
|
52
|
+
videoGroupList.forEach(videosInGroup => {
|
|
62
53
|
groups.push({
|
|
63
|
-
title:
|
|
64
|
-
files:
|
|
65
|
-
})
|
|
66
|
-
}
|
|
67
|
-
if (pdfs && pdfs.length > 0) {
|
|
68
|
-
let pdfFiles = pdfs.map((file) => {
|
|
69
|
-
const url = file.imageurl
|
|
70
|
-
const thumb = 'https://image.hh-medic.com/icon/pacs/hh_icon_pdf.png'
|
|
71
|
-
return {
|
|
72
|
-
url: url,
|
|
73
|
-
thumb: thumb,
|
|
74
|
-
type: 'pdf',
|
|
75
|
-
desc: file.imagedesc
|
|
76
|
-
}
|
|
54
|
+
title: name + '(视频)',
|
|
55
|
+
files: videosInGroup
|
|
77
56
|
})
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
if (pdfList && pdfList.length > 0) {
|
|
78
60
|
groups.push({
|
|
79
|
-
title: `${
|
|
80
|
-
files:
|
|
61
|
+
title: `${name}(PDF)`,
|
|
62
|
+
files: pdfList
|
|
81
63
|
})
|
|
82
64
|
}
|
|
83
65
|
}
|
|
@@ -108,18 +90,20 @@ module.exports = Behavior({
|
|
|
108
90
|
resolve({
|
|
109
91
|
isNew: false,
|
|
110
92
|
caseGroups: groups,
|
|
111
|
-
mediaFiles: mediaFiles
|
|
112
93
|
})
|
|
113
94
|
})
|
|
114
95
|
|
|
115
96
|
let promises = [orderMediaPromise]
|
|
116
97
|
|
|
117
98
|
let newFilePromise = new Promise((resolve, reject) => {
|
|
118
|
-
let mediaFiles = []
|
|
119
99
|
orderApi.fileData(order.orderid, order.patient.patientCode).then((res) => {
|
|
120
100
|
const list = res.data
|
|
121
101
|
if (list && list.length > 0) {
|
|
122
|
-
let
|
|
102
|
+
let groups = []
|
|
103
|
+
let imageList = []
|
|
104
|
+
let videoList = []
|
|
105
|
+
let pdfList = []
|
|
106
|
+
list.forEach((file) => {
|
|
123
107
|
let type = 'image'
|
|
124
108
|
const url = file.fileUrl
|
|
125
109
|
let thumb = url
|
|
@@ -137,18 +121,40 @@ module.exports = Behavior({
|
|
|
137
121
|
thumb: thumb,
|
|
138
122
|
type: type,
|
|
139
123
|
}
|
|
140
|
-
if (type
|
|
141
|
-
|
|
124
|
+
if (type == 'image') {
|
|
125
|
+
imageList.push(data)
|
|
126
|
+
} else if (type == 'video') {
|
|
127
|
+
videoList.push(data)
|
|
128
|
+
} else {
|
|
129
|
+
pdfList.push(data)
|
|
142
130
|
}
|
|
143
|
-
return data
|
|
144
131
|
})
|
|
132
|
+
|
|
133
|
+
const imageGroupList = caseImageFilter.mediaGroupList(imageList)
|
|
134
|
+
imageGroupList.forEach(imagesInGroup => {
|
|
135
|
+
groups.push({
|
|
136
|
+
title: "刚刚更新(图片)",
|
|
137
|
+
files: imagesInGroup
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
const videoGroupList = caseImageFilter.mediaGroupList(videoList)
|
|
142
|
+
videoGroupList.forEach(videosInGroup => {
|
|
143
|
+
groups.push({
|
|
144
|
+
title: "刚刚更新(视频)",
|
|
145
|
+
files: videosInGroup
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
if (pdfList.length > 0) {
|
|
150
|
+
groups.push({
|
|
151
|
+
title: '刚刚更新(PDF)',
|
|
152
|
+
files: pdfList
|
|
153
|
+
})
|
|
154
|
+
}
|
|
145
155
|
resolve({
|
|
146
156
|
isNew: true,
|
|
147
|
-
caseGroups:
|
|
148
|
-
title: '刚刚更新',
|
|
149
|
-
files: fileList
|
|
150
|
-
}],
|
|
151
|
-
mediaFiles: mediaFiles
|
|
157
|
+
caseGroups: groups,
|
|
152
158
|
})
|
|
153
159
|
} else {
|
|
154
160
|
resolve({
|
|
@@ -171,20 +177,15 @@ module.exports = Behavior({
|
|
|
171
177
|
Promise.all(promises).then((res) => {
|
|
172
178
|
wx.hideLoading()
|
|
173
179
|
let caseGroups = []
|
|
174
|
-
let mediaFiles = []
|
|
175
180
|
for (const result of res) {
|
|
176
181
|
if (result.isNew) {
|
|
177
182
|
caseGroups.splice(0, 0, ...result.caseGroups)
|
|
178
|
-
mediaFiles.splice(0, 0, ...result.mediaFiles)
|
|
179
183
|
} else {
|
|
180
184
|
caseGroups.push(...result.caseGroups)
|
|
181
|
-
mediaFiles.push(...result.mediaFiles)
|
|
182
185
|
}
|
|
183
|
-
|
|
184
186
|
}
|
|
185
187
|
this.setData({
|
|
186
188
|
caseGroups: caseGroups,
|
|
187
|
-
_mediaFiles: mediaFiles,
|
|
188
189
|
mediaTop: 'mediaTop'
|
|
189
190
|
}, () => {
|
|
190
191
|
callback()
|
|
@@ -12,6 +12,10 @@ Component({
|
|
|
12
12
|
files: {
|
|
13
13
|
type: Array,
|
|
14
14
|
value: []
|
|
15
|
+
},
|
|
16
|
+
groupIndex: {
|
|
17
|
+
type: Number,
|
|
18
|
+
value: -1
|
|
15
19
|
}
|
|
16
20
|
},
|
|
17
21
|
|
|
@@ -31,7 +35,8 @@ Component({
|
|
|
31
35
|
const url = e.currentTarget.dataset.url
|
|
32
36
|
this.triggerEvent('clickMedia', {
|
|
33
37
|
type: type,
|
|
34
|
-
url: url
|
|
38
|
+
url: url,
|
|
39
|
+
groupIndex: this.properties.groupIndex
|
|
35
40
|
})
|
|
36
41
|
}
|
|
37
42
|
}
|
|
@@ -3,6 +3,7 @@ const doctorLoader = require('../public/doctor-loader')
|
|
|
3
3
|
const defines = require('./video-chat-defines')
|
|
4
4
|
const pdfViewer = require('../public/pdf-viewer')
|
|
5
5
|
const hhNavigation = require('../hh-navigation')
|
|
6
|
+
const deviceUtil = require('../utils/device-utils')
|
|
6
7
|
|
|
7
8
|
Page({
|
|
8
9
|
|
|
@@ -201,27 +202,69 @@ Page({
|
|
|
201
202
|
clickMedia(e) {
|
|
202
203
|
const {
|
|
203
204
|
type,
|
|
204
|
-
url
|
|
205
|
+
url,
|
|
206
|
+
groupIndex
|
|
205
207
|
} = e.detail
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
208
|
+
const files = this.data.caseGroups[groupIndex].files
|
|
209
|
+
const find = files.findIndex((value, index, array) => {
|
|
210
|
+
return value.url == url
|
|
211
|
+
})
|
|
212
|
+
switch (type) {
|
|
213
|
+
case 'image':
|
|
214
|
+
const images = files.map((value) => {
|
|
215
|
+
return value.url
|
|
216
|
+
})
|
|
217
|
+
wx.previewImage({
|
|
218
|
+
current: url,
|
|
219
|
+
urls: images,
|
|
220
|
+
})
|
|
221
|
+
break
|
|
222
|
+
case 'video':
|
|
223
|
+
if (deviceUtil.isPC()) {
|
|
224
|
+
hhNavigation.mediaPreview(files, find)
|
|
225
|
+
} else {
|
|
226
|
+
wx.previewMedia({
|
|
227
|
+
current: find,
|
|
228
|
+
sources: files,
|
|
229
|
+
fail: (err) => {
|
|
230
|
+
console.error(err)
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
}
|
|
234
|
+
break
|
|
235
|
+
case 'pdf':
|
|
236
|
+
pdfViewer.viewPdf(url)
|
|
237
|
+
break
|
|
238
|
+
case 'url':
|
|
239
|
+
hhNavigation.copyUrl(url)
|
|
240
|
+
break
|
|
241
|
+
case 'dicom':
|
|
242
|
+
hhNavigation.pathology(this.data.orderId, null, null, true)
|
|
243
|
+
break
|
|
244
|
+
case 'bingli':
|
|
245
|
+
let hospitalId = this.data.order.doctor.hospitalid
|
|
246
|
+
hhNavigation.pathology(this.data.orderId, hospitalId, null, false)
|
|
247
|
+
break
|
|
224
248
|
}
|
|
249
|
+
// if (type === 'video' || type === 'image') {
|
|
250
|
+
// const fileList = this.data.caseGroups[groupIndex].files
|
|
251
|
+
// const find = fileList.findIndex((value, index, array) => {
|
|
252
|
+
// return value.url == url
|
|
253
|
+
// })
|
|
254
|
+
// wx.previewMedia({
|
|
255
|
+
// current: find,
|
|
256
|
+
// sources: this.data._mediaFiles,
|
|
257
|
+
// })
|
|
258
|
+
// } else if (type === 'pdf') {
|
|
259
|
+
// pdfViewer.viewPdf(url)
|
|
260
|
+
// } else if (type === 'url') {
|
|
261
|
+
// hhNavigation.copyUrl(url)
|
|
262
|
+
// } else if (type === 'dicom') {
|
|
263
|
+
// hhNavigation.pathology(this.data.orderId, null, null, true)
|
|
264
|
+
// } else if (type === 'bingli') {
|
|
265
|
+
// let hospitalId = this.data.order.doctor.hospitalid
|
|
266
|
+
// hhNavigation.pathology(this.data.orderId, hospitalId, null, false)
|
|
267
|
+
// }
|
|
225
268
|
},
|
|
226
269
|
|
|
227
270
|
updateUserAudioStatus(data) {
|