hh-doctor-sdk 0.0.1

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.
Files changed (131) hide show
  1. package/components/apis/api-host-define.js +69 -0
  2. package/components/apis/consultation-reply-api.js +21 -0
  3. package/components/apis/dicom-api.js +31 -0
  4. package/components/apis/family-api.js +20 -0
  5. package/components/apis/file-upload-api.js +35 -0
  6. package/components/apis/order-app-api.js +206 -0
  7. package/components/apis/stat-log-api.js +42 -0
  8. package/components/apis/video-chat-log-api.js +47 -0
  9. package/components/apis/video-message-api.js +88 -0
  10. package/components/consultation/detail/behaviors/chat-cell-base-behaviors.js +29 -0
  11. package/components/consultation/detail/behaviors/consultation-behaviors.js +60 -0
  12. package/components/consultation/detail/behaviors/consultation-chat-behaviors.js +321 -0
  13. package/components/consultation/detail/behaviors/consultation-header-media-behaviors.js +176 -0
  14. package/components/consultation/detail/behaviors/consultation-header-text-behaviors.js +325 -0
  15. package/components/consultation/detail/behaviors/consultation-reply-behaviors.js +67 -0
  16. package/components/consultation/detail/consultation-detail-page.js +219 -0
  17. package/components/consultation/detail/consultation-detail-page.json +10 -0
  18. package/components/consultation/detail/consultation-detail-page.wxml +65 -0
  19. package/components/consultation/detail/consultation-detail-page.wxss +51 -0
  20. package/components/consultation/detail/widget/case-image-filter.js +47 -0
  21. package/components/consultation/detail/widget/chat-base-cell/chat-base-cell.js +31 -0
  22. package/components/consultation/detail/widget/chat-base-cell/chat-base-cell.json +4 -0
  23. package/components/consultation/detail/widget/chat-base-cell/chat-base-cell.wxml +17 -0
  24. package/components/consultation/detail/widget/chat-base-cell/chat-base-cell.wxss +9 -0
  25. package/components/consultation/detail/widget/chat-bottom/chat-bottom.js +100 -0
  26. package/components/consultation/detail/widget/chat-bottom/chat-bottom.json +4 -0
  27. package/components/consultation/detail/widget/chat-bottom/chat-bottom.wxml +24 -0
  28. package/components/consultation/detail/widget/chat-bottom/chat-bottom.wxss +54 -0
  29. package/components/consultation/detail/widget/chat-bottom/chat-menu-builder.js +131 -0
  30. package/components/consultation/detail/widget/chat-cell-template/chat-cell-template.wxml +173 -0
  31. package/components/consultation/detail/widget/chat-cell.wxss +394 -0
  32. package/components/consultation/detail/widget/detail-media/detail-media.js +47 -0
  33. package/components/consultation/detail/widget/detail-media/detail-media.json +4 -0
  34. package/components/consultation/detail/widget/detail-media/detail-media.wxml +12 -0
  35. package/components/consultation/detail/widget/detail-media/detail-media.wxss +57 -0
  36. package/components/consultation/detail/widget/detail-text/detail-text.js +31 -0
  37. package/components/consultation/detail/widget/detail-text/detail-text.json +4 -0
  38. package/components/consultation/detail/widget/detail-text/detail-text.wxml +6 -0
  39. package/components/consultation/detail/widget/detail-text/detail-text.wxss +14 -0
  40. package/components/consultation/evaluate/evaluate-page.js +157 -0
  41. package/components/consultation/evaluate/evaluate-page.json +3 -0
  42. package/components/consultation/evaluate/evaluate-page.wxml +42 -0
  43. package/components/consultation/evaluate/evaluate-page.wxss +103 -0
  44. package/components/consultation/list/behaviors/consultation-list-base-behaviors.js +144 -0
  45. package/components/consultation/list/consultation-list-page.js +84 -0
  46. package/components/consultation/list/consultation-list-page.json +5 -0
  47. package/components/consultation/list/consultation-list-page.wxml +53 -0
  48. package/components/consultation/list/consultation-list-page.wxss +105 -0
  49. package/components/consultation/reply/behaviors/reply-base-behaviors.js +175 -0
  50. package/components/consultation/reply/consultation-reply-page.js +251 -0
  51. package/components/consultation/reply/consultation-reply-page.json +6 -0
  52. package/components/consultation/reply/consultation-reply-page.wxml +103 -0
  53. package/components/consultation/reply/consultation-reply-page.wxss +169 -0
  54. package/components/consultation/reply/widget/audio-record-view/audio-record-view.js +144 -0
  55. package/components/consultation/reply/widget/audio-record-view/audio-record-view.json +4 -0
  56. package/components/consultation/reply/widget/audio-record-view/audio-record-view.wxml +27 -0
  57. package/components/consultation/reply/widget/audio-record-view/audio-record-view.wxss +197 -0
  58. package/components/hh-doctor.js +36 -0
  59. package/components/hh-navigation.js +87 -0
  60. package/components/public/app-config.js +13 -0
  61. package/components/public/behaviors/order-base-behaviors.js +53 -0
  62. package/components/public/cache-data.js +134 -0
  63. package/components/public/doctor-loader.js +60 -0
  64. package/components/public/im-manager.js +135 -0
  65. package/components/public/pdf-viewer.js +59 -0
  66. package/components/public/stat-log.js +13 -0
  67. package/components/static/Agora_Miniapp_SDK_for_WeChat.js +2 -0
  68. package/components/static/trtc-wx.js +2 -0
  69. package/components/uikit/css/common.wxss +23 -0
  70. package/components/uikit/custom-bottom-pop/custom-bottom-pop.js +37 -0
  71. package/components/uikit/custom-bottom-pop/custom-bottom-pop.json +4 -0
  72. package/components/uikit/custom-bottom-pop/custom-bottom-pop.wxml +9 -0
  73. package/components/uikit/custom-bottom-pop/custom-bottom-pop.wxss +79 -0
  74. package/components/uikit/date-time-picker/date-time-picker.js +115 -0
  75. package/components/uikit/web-view-page/web-view-page.js +87 -0
  76. package/components/uikit/web-view-page/web-view-page.json +3 -0
  77. package/components/uikit/web-view-page/web-view-page.wxml +6 -0
  78. package/components/uikit/web-view-page/web-view-page.wxss +1 -0
  79. package/components/utils/checksumUtils.js +56 -0
  80. package/components/utils/common-utils.js +59 -0
  81. package/components/utils/dateUtils.js +142 -0
  82. package/components/utils/eventBus.js +77 -0
  83. package/components/utils/httpUtils.js +123 -0
  84. package/components/utils/number-utils.js +48 -0
  85. package/components/utils/permission-utils.js +164 -0
  86. package/components/video-chat/agora-rtc/agora-player/agora-player.js +106 -0
  87. package/components/video-chat/agora-rtc/agora-player/agora-player.json +4 -0
  88. package/components/video-chat/agora-rtc/agora-player/agora-player.wxml +24 -0
  89. package/components/video-chat/agora-rtc/agora-player/agora-player.wxss +1 -0
  90. package/components/video-chat/agora-rtc/agora-pusher/agora-pusher.js +92 -0
  91. package/components/video-chat/agora-rtc/agora-pusher/agora-pusher.json +4 -0
  92. package/components/video-chat/agora-rtc/agora-pusher/agora-pusher.wxml +22 -0
  93. package/components/video-chat/agora-rtc/agora-pusher/agora-pusher.wxss +1 -0
  94. package/components/video-chat/agora-rtc/agora-rtc.js +391 -0
  95. package/components/video-chat/agora-rtc/agora-rtc.json +7 -0
  96. package/components/video-chat/agora-rtc/agora-rtc.wxml +39 -0
  97. package/components/video-chat/agora-rtc/agora-rtc.wxss +1 -0
  98. package/components/video-chat/callback/callback.js +39 -0
  99. package/components/video-chat/callback/callback.json +4 -0
  100. package/components/video-chat/callback/callback.wxml +29 -0
  101. package/components/video-chat/callback/callback.wxss +26 -0
  102. package/components/video-chat/calling/calling.js +75 -0
  103. package/components/video-chat/calling/calling.json +4 -0
  104. package/components/video-chat/calling/calling.wxml +32 -0
  105. package/components/video-chat/calling/calling.wxss +45 -0
  106. package/components/video-chat/controller/controller.js +86 -0
  107. package/components/video-chat/controller/controller.json +4 -0
  108. package/components/video-chat/controller/controller.wxml +73 -0
  109. package/components/video-chat/controller/controller.wxss +71 -0
  110. package/components/video-chat/remote-player/remote-player.js +42 -0
  111. package/components/video-chat/remote-player/remote-player.json +4 -0
  112. package/components/video-chat/remote-player/remote-player.wxml +37 -0
  113. package/components/video-chat/remote-player/remote-player.wxss +1 -0
  114. package/components/video-chat/video-chat.js +297 -0
  115. package/components/video-chat/video-chat.json +7 -0
  116. package/components/video-chat/video-chat.wxml +56 -0
  117. package/components/video-chat/video-chat.wxss +97 -0
  118. package/components/video-chat-page/behaviors/chat-files-behaviors.js +243 -0
  119. package/components/video-chat-page/behaviors/chat-log-behaviors.js +90 -0
  120. package/components/video-chat-page/behaviors/chat-sound-behaviors.js +60 -0
  121. package/components/video-chat-page/behaviors/video-chat-behaviors.js +524 -0
  122. package/components/video-chat-page/case-group-view/case-group-view.js +38 -0
  123. package/components/video-chat-page/case-group-view/case-group-view.json +4 -0
  124. package/components/video-chat-page/case-group-view/case-group-view.wxml +32 -0
  125. package/components/video-chat-page/case-group-view/case-group-view.wxss +44 -0
  126. package/components/video-chat-page/video-chat-defines.js +39 -0
  127. package/components/video-chat-page/video-chat-page.js +212 -0
  128. package/components/video-chat-page/video-chat-page.json +14 -0
  129. package/components/video-chat-page/video-chat-page.wxml +88 -0
  130. package/components/video-chat-page/video-chat-page.wxss +45 -0
  131. package/package.json +18 -0
@@ -0,0 +1,325 @@
1
+ const cache = require('../../../public/cache-data')
2
+ const dateUtils = require('../../../utils/dateUtils')
3
+
4
+ module.exports = Behavior({
5
+
6
+ methods: {
7
+
8
+ buildHeadTextInfo() {
9
+ const order = this.data.order
10
+ var headerTexts = []
11
+ const patient = order.patient
12
+ const phone = cache.doctorId() == order.doctorid ? order.patient.patientphone || '' : ''
13
+ headerTexts.push(this.textLabel('', `${patient.patientname} | ${patient.patientsex} | ${patient.patientage}岁${phone.length > 0 ? ' | ' : ''}${phone}`))
14
+ if (order.currentDescn && order.currentDescn.length > 0) {
15
+ headerTexts.push(this.textLabel('目前诊断:', order.currentDescn))
16
+ }
17
+ if (order.objective && order.objective.length > 0) {
18
+ const label = order.orderType == 'KEYAN_HOSPTIAL_INTERNAL' ? '讨论目的:' : '咨询目的:'
19
+ headerTexts.push(this.textLabel(label, order.objective))
20
+ }
21
+ if (order.orderComponent && order.orderComponent.componentBaseList) {
22
+ const componentList = order.orderComponent.componentBaseList
23
+ headerTexts = headerTexts.concat(this.componentTexts(componentList))
24
+
25
+ const pathologyData = this.pathology(componentList)
26
+ if (pathologyData) {
27
+ headerTexts.push(pathologyData)
28
+ }
29
+
30
+ const immunoData = this.immuno(componentList)
31
+ if (immunoData) {
32
+ headerTexts.push(immunoData)
33
+ }
34
+
35
+ const operationData = this.operation(componentList)
36
+ if (operationData) {
37
+ headerTexts.push(operationData)
38
+ }
39
+
40
+ const geneTestData = this.geneTest(componentList)
41
+ if (geneTestData) {
42
+ headerTexts.push(geneTestData)
43
+ }
44
+
45
+ const timeRangeData = this.timeRange(componentList)
46
+ if (timeRangeData) {
47
+ headerTexts.push(timeRangeData)
48
+ }
49
+
50
+ const detectionData = this.detection(componentList)
51
+ if (detectionData) {
52
+ headerTexts.push(detectionData)
53
+ }
54
+
55
+ const controlsData = this.controlTexts(componentList)
56
+ headerTexts = headerTexts.concat(controlsData)
57
+ }
58
+ this.setData({
59
+ headerTexts: headerTexts
60
+ })
61
+ },
62
+
63
+ /**
64
+ * 构建咨询单详情顶部Text组件数据
65
+ * @param {*} componentList
66
+ */
67
+ componentTexts(componentList) {
68
+ return componentList.filter((value, index, array) => {
69
+ const type = value.type.toLowerCase()
70
+ const textTypes = ['text', 'photoText', 'url']
71
+ return textTypes.includes(type) && value.text !== null && value.text !== '' && value.text !== undefined
72
+ }).map((value, index, array) => {
73
+ return this.textLabel(`${value.name}:`, value.text)
74
+ })
75
+ },
76
+
77
+ /**
78
+ * radio或checkbox数据
79
+ * @param {*} componentList
80
+ */
81
+ controlTexts(componentList) {
82
+ var list = []
83
+ componentList.filter((value, index, array) => {
84
+ const type = value.type.toLowerCase()
85
+ const textTypes = ['checkbox', 'radio']
86
+ return textTypes.includes(type) && value.text && value.text.length > 0
87
+ }).forEach((value, index, array) => {
88
+ var content = ''
89
+ const text = value.text
90
+ const data = JSON.parse(text)
91
+ if (data) {
92
+ data.forEach((value, index, array) => {
93
+ if (value.value.trim() == 'other') {
94
+ if (value.input && value.input.length > 0) {
95
+ content = `${content}${value.label} ${value.input}`
96
+ } else {
97
+ content = `${content}${value.label}`
98
+ }
99
+ } else if (value.type == 'input') {
100
+ content = `${content}${value.label} ${value.input}${value.unit}`
101
+ } else {
102
+ content = `${content}${value.label}`
103
+ }
104
+ if (index < data.length - 1) {
105
+ content = `${content},`
106
+ }
107
+ })
108
+
109
+ if (content.length > 0) {
110
+ list.push(this.textLabel(`${value.name}:`, content))
111
+ }
112
+ }
113
+ })
114
+ return list
115
+ },
116
+
117
+ /**
118
+ * 病理信息
119
+ * @param {*} componentList
120
+ */
121
+ pathology(componentList) {
122
+ const text = this.getComponentText(componentList, 'bingli')
123
+ if (text && text.length > 0) {
124
+ const data = JSON.parse(text)
125
+ if (data && data.part && data.count) {
126
+ return this.textLabel('病理信息:', `${data.part},共有${data.count || 0}张`)
127
+ }
128
+ }
129
+ return null
130
+ },
131
+
132
+ /**
133
+ * 免疫组化
134
+ * @param {*} componentList
135
+ */
136
+ immuno(componentList) {
137
+ const text = this.getComponentText(componentList, 'immunoitem')
138
+ if (text && text.length > 0) {
139
+ const data = JSON.parse(text)
140
+ if (data && data.immunos && data.immunos.length > 0) {
141
+ var info = ''
142
+ data.immunos.forEach((value, index, array) => {
143
+ var detail = `${value.part},${value.count}张,`
144
+ const tagCount = value.tags.length
145
+ value.tags.forEach((value, index, array) => {
146
+ detail = `${detail}${value.name}${index < tagCount - 1 ? ',' : ''}`
147
+ })
148
+ info = `${info}${detail}${index < data.immunos.length - 1 ? '\n' : ''}`
149
+ })
150
+ if (info.length > 0) {
151
+ return this.textLabel('免疫组化:', info)
152
+ }
153
+ }
154
+ }
155
+ return null
156
+ },
157
+
158
+ /**
159
+ * 手术预约时间
160
+ * @param {*} componentList
161
+ */
162
+ operation(componentList) {
163
+ const text = this.getComponentText(componentList, 'feidaoinfo')
164
+ if (text && text.length > 0) {
165
+ const data = JSON.parse(text)
166
+ if (data && data.date && data.date.length > 0 && data.changeExpert && data.changeExpert.length > 0) {
167
+ return this.textLabel('手术预约时间:', data.date)
168
+ }
169
+ }
170
+ return null
171
+ },
172
+
173
+ /**
174
+ * 样本信息
175
+ * @param {*} componentList
176
+ */
177
+ geneTest(componentList) {
178
+ const text = this.getComponentText(componentList, 'gene_test')
179
+ if (text && text.length > 0) {
180
+ const data = JSON.parse(text)
181
+ var content = ''
182
+ if (data) {
183
+ var content = ''
184
+ if (data.geneSampleType) {
185
+ var geneSampleType = ''
186
+ switch (data.geneSampleType) {
187
+ case 'ParafifnSection':
188
+ geneSampleType = '石蜡切片'
189
+ break
190
+ case 'Puncture':
191
+ geneSampleType = '穿刺切片'
192
+ break
193
+ case 'Parafifn':
194
+ geneSampleType = '石蜡包埋块'
195
+ break
196
+ }
197
+ content = `${content}${geneSampleType},`
198
+ }
199
+ if (data.serialRegion && data.serialRegion.length > 0) {
200
+ content = `${content}${data.serialRegion},`
201
+ }
202
+ if (data.bloodSerial && data.bloodSerial.length > 0) {
203
+ content = `${content}外周血${data.bloodSerial};`
204
+ }
205
+ if (data.organRegin && data.organRegin.length > 0) {
206
+ content = `${content}原发肿瘤${data.organRegin};`
207
+ }
208
+ }
209
+ const listText = this.getComponentText(componentList, 'gene_test_selected_list')
210
+ if (listText && listText.length > 0) {
211
+ const data = JSON.parse(listText)
212
+ if (data && data.length > 0) {
213
+ data.forEach((value, index, array) => {
214
+ content = `${content}${value.name}${index < data.length -1 ? ',' : ''}`
215
+ })
216
+ }
217
+ }
218
+ if (content.length > 0) {
219
+ return this.textLabel('样本信息', content)
220
+ }
221
+ }
222
+ return null
223
+ },
224
+
225
+ /**
226
+ * 会诊时间
227
+ * @param {*} componentList
228
+ */
229
+ timeRange(componentList) {
230
+ const text = this.getComponentText(componentList, 'time_range')
231
+ if (text && text.length > 0) {
232
+ const data = JSON.parse(text)
233
+ if (data && data.begin && data.begin.length > 0 && data.end && data.end.length > 0) {
234
+ const dateBegin = new Date(data.begin)
235
+ const dateEnd = new Date(data.end)
236
+ if (dateBegin && dateEnd) {
237
+ const strBegin = dateUtils.format(dateBegin, 'MM月dd日/hh:mm')
238
+ const strEnd = dateUtils.format(dateEnd, '-hh:mm')
239
+ return this.textLabel('会诊时间:', `${strBegin}${strEnd}`)
240
+ }
241
+ }
242
+ }
243
+ return null
244
+ },
245
+
246
+ /**
247
+ * 样本信息
248
+ * @param {*} componentList
249
+ */
250
+ detection(componentList) {
251
+ const text = this.getComponentText(componentList, 'detection')
252
+ if (text && text.length > 0) {
253
+ const data = JSON.parse(text)
254
+ var info = ''
255
+ if (data && data.immunos && data.immunos.length > 0) {
256
+ data.immunos.forEach((value, index, array) => {
257
+ var detail = `${value.part},${value.count}张,`
258
+ const tagCount = value.tags.length
259
+ value.tags.forEach((value, index, array) => {
260
+ detail = `${detail}${value.name}${index < tagCount - 1 ? ',' : ''}`
261
+ })
262
+ info = `${info}${detail}${index < data.immunos.length - 1 ? '\n' : ''}`
263
+ })
264
+ if (info.length > 0) {
265
+ return this.textLabel('样本信息:', info)
266
+ }
267
+ }
268
+ }
269
+ return null
270
+ },
271
+
272
+ getComponentText(componentList, type) {
273
+ const list = componentList.filter((value, index, array) => {
274
+ const componentType = value.type.toLowerCase()
275
+ return type == componentType
276
+ })
277
+ if (list && list.length > 0 && list[0].text != null && list[0].text.length > 0) {
278
+ return list[0].text
279
+ }
280
+ return null
281
+ },
282
+
283
+ /**
284
+ * 构建咨询单详情顶部Text数据对象
285
+ * @param {*} label 标题
286
+ * @param {*} content 内容
287
+ */
288
+ textLabel(label, content) {
289
+ return {
290
+ label: label,
291
+ content: content
292
+ }
293
+ },
294
+
295
+ buildDoctorInfo() {
296
+ const order = this.data.order
297
+ const isRequest = this.isRequest()
298
+ const isMDT = order.serviceGroupName == 'MDT'
299
+ var doctorInfo = ''
300
+ const createtime = order.createtime
301
+ if (isRequest) {
302
+ const expertList = order.orderService.expertList
303
+ if (expertList && expertList.length > 0) {
304
+ if (isMDT) {
305
+ expertList.forEach((value, index, array) => {
306
+ doctorInfo = `${doctorInfo}、${value.name}`
307
+ })
308
+ doctorInfo = doctorInfo.substring(1)
309
+ } else {
310
+ const doctor = expertList[0]
311
+ doctorInfo = `${doctor.name} | ${doctor.hospital}`
312
+ }
313
+ }
314
+ } else {
315
+ if (order.doctor) {
316
+ doctorInfo = `${order.doctorname} | ${order.doctor.department} | ${order.doctor.hospital}`
317
+ }
318
+ }
319
+ const doctorShow = `${doctorInfo} | ${dateUtils.dateStringFromNow(createtime)}`
320
+ this.setData({
321
+ doctorInfo: doctorShow
322
+ })
323
+ },
324
+ }
325
+ })
@@ -0,0 +1,67 @@
1
+ const dateTimePicker = require('../../../uikit/date-time-picker/date-time-picker')
2
+ const api = require('../../../apis/consultation-reply-api')
3
+
4
+ module.exports = Behavior({
5
+
6
+ behaviors: [require('./consultation-behaviors')],
7
+
8
+ methods: {
9
+ _changeDateTime(e, update = true) {
10
+ this.setData({
11
+ dateTime: e.detail.value
12
+ });
13
+ const year = this.data.dateTimeArray[0][this.data.dateTime[0]]
14
+ const month = this.data.dateTimeArray[1][this.data.dateTime[1]]
15
+ const day = this.data.dateTimeArray[2][this.data.dateTime[2]]
16
+ const hour = this.data.dateTimeArray[3][this.data.dateTime[3]]
17
+ const minute = this.data.dateTimeArray[4][this.data.dateTime[4]]
18
+ const select = `${year}-${month}-${day}T${hour}:${minute}`
19
+ const date = new Date(select)
20
+ const selectTimestamp = date.getTime()
21
+ if (selectTimestamp - new Date().getTime() <= 0) {
22
+ wx.showModal({
23
+ title: '提示',
24
+ content: '不能选择过去的时间',
25
+ showCancel: false,
26
+ complete: (res) => {
27
+
28
+ }
29
+ })
30
+ return
31
+ }
32
+ wx.showLoading({
33
+ title: '',
34
+ })
35
+ const orderId = this.data.orderId
36
+ const time = Number.parseInt(selectTimestamp / 1000)
37
+ api.setProvideTime(orderId, time).then((res) => {
38
+ wx.hideLoading()
39
+ wx.showToast({
40
+ title: update ? '更新时间完成' : '设置时间完成',
41
+ })
42
+ setTimeout(() => {
43
+ this.loadOrderInfo()
44
+ }, 1000);
45
+ }).catch((err) => {
46
+ wx.hideLoading()
47
+ wx.showToast({
48
+ title: '设置时间失败',
49
+ })
50
+ })
51
+ },
52
+
53
+ _changeDateTimeColumn(e) {
54
+ var arr = this.data.dateTime,
55
+ dateArr = this.data.dateTimeArray
56
+
57
+ arr[e.detail.column] = e.detail.value;
58
+ // 刷新月份中的日数据
59
+ dateArr[2] = dateTimePicker.getMonthDay(dateArr[0][arr[0]], dateArr[1][arr[1]])
60
+
61
+ this.setData({
62
+ dateTimeArray: dateArr,
63
+ dateTime: arr
64
+ });
65
+ }
66
+ }
67
+ })
@@ -0,0 +1,219 @@
1
+ var audioPlayer
2
+ var currentPlayUrl
3
+ var currentPlayIndex = -1
4
+ var audioAnimationInterval
5
+
6
+ const hhNavigation = require('../../hh-navigation')
7
+ const doctorLoader = require('../../public/doctor-loader')
8
+
9
+ Page({
10
+
11
+ behaviors: [require('./behaviors/consultation-behaviors'), require('./behaviors/consultation-reply-behaviors')],
12
+
13
+ /**
14
+ * 页面的初始数据
15
+ */
16
+ data: {
17
+
18
+ },
19
+
20
+ /**
21
+ * 生命周期函数--监听页面加载
22
+ */
23
+ onLoad(options) {
24
+ wx.statLog.sendStatLog(options.orderId, '打开咨询单详情界面')
25
+ const doctorId = options.doctorId
26
+ doctorLoader.loadDoctor({
27
+ doctorId: doctorId,
28
+ scence: '咨询单详情',
29
+ isTest: options.isTest || true
30
+ }, (res) => {
31
+ if (res) {
32
+ this.datePickerTime()
33
+ }
34
+ })
35
+ const orderId = options.orderId
36
+ if (!orderId || orderId === null || orderId === '') {
37
+ wx.statLog.sendStatLog(null, `未传必要的参数:orderId`)
38
+ wx.showToast({
39
+ title: '未传必要的参数orderId',
40
+ })
41
+ setTimeout(() => {
42
+ wx.navigateBack()
43
+ }, 1000);
44
+ return
45
+ }
46
+ this.setData({
47
+ orderId: orderId,
48
+ })
49
+ },
50
+
51
+ /**
52
+ * 生命周期函数--监听页面初次渲染完成
53
+ */
54
+ onReady() {
55
+
56
+ },
57
+
58
+ /**
59
+ * 生命周期函数--监听页面显示
60
+ */
61
+ onShow() {
62
+ if (this.data.showPreview) {
63
+ this.setData({
64
+ showPreview: false,
65
+ })
66
+ } else {
67
+ this._refreshOrder()
68
+ }
69
+ },
70
+
71
+ /**
72
+ * 生命周期函数--监听页面隐藏
73
+ */
74
+ onHide() {
75
+
76
+ },
77
+
78
+ /**
79
+ * 生命周期函数--监听页面卸载
80
+ */
81
+ onUnload() {
82
+
83
+ },
84
+
85
+ /**
86
+ * 页面相关事件处理函数--监听用户下拉动作
87
+ */
88
+ onPullDownRefresh() {
89
+
90
+ },
91
+
92
+ /**
93
+ * 页面上拉触底事件的处理函数
94
+ */
95
+ onReachBottom() {
96
+
97
+ },
98
+
99
+ /**
100
+ * 用户点击右上角分享
101
+ */
102
+ onShareAppMessage() {
103
+
104
+ },
105
+
106
+ _refreshOrder() {
107
+ if (this.data.orderId === null || this.data.orderId === '') {
108
+ return
109
+ }
110
+ this.loadOrderInfo()
111
+ },
112
+
113
+ _tapLink(event) {
114
+ const url = event.currentTarget.dataset.link
115
+ hhNavigation.webPage(url)
116
+ },
117
+
118
+ _playAudio(event) {
119
+ const url = event.currentTarget.dataset.url
120
+ const index = event.currentTarget.dataset.index
121
+ const playerUrl = `${url}${url.endsWith('.amr') ? '.mp3' : ''}`
122
+ if (audioPlayer) {
123
+ if (currentPlayIndex >= 0) {
124
+ this._stopAudioAnimation()
125
+ }
126
+ audioPlayer.stop()
127
+ audioPlayer.destroy()
128
+ audioPlayer = null
129
+ if (playerUrl == currentPlayUrl) {
130
+ return
131
+ }
132
+ }
133
+ const player = wx.createInnerAudioContext()
134
+ player.src = playerUrl
135
+ player.play()
136
+ player.onEnded(() => {
137
+ this._stopAudioAnimation()
138
+ })
139
+ audioPlayer = player
140
+ currentPlayIndex = index
141
+ currentPlayUrl = playerUrl
142
+ audioAnimationInterval = setInterval(() => {
143
+ this._audioAnimation()
144
+ }, 400)
145
+ },
146
+
147
+ _audioAnimation() {
148
+ const message = this.data.messages[currentPlayIndex]
149
+ var value = message.animationValue
150
+ if (value < 3) {
151
+ value++
152
+ } else if (value == 3) {
153
+ value = 1
154
+ }
155
+ message.animationValue = value
156
+ var messages = this.data.messages
157
+ messages[currentPlayIndex] = message
158
+ this.setData({
159
+ messages: messages
160
+ })
161
+ },
162
+
163
+ _stopAudioAnimation() {
164
+ if (audioAnimationInterval) {
165
+ clearInterval(audioAnimationInterval)
166
+ }
167
+ const message = this.data.messages[currentPlayIndex]
168
+ message.animationValue = 3
169
+ var messages = this.data.messages
170
+ messages[currentPlayIndex] = message
171
+ this.setData({
172
+ messages: messages
173
+ })
174
+ },
175
+
176
+ _clickNotify() {
177
+
178
+ },
179
+
180
+ _editTime(e) {
181
+ this.datePickerTime(true)
182
+ const index = e.currentTarget.dataset.index
183
+ const messages = this.data.messages
184
+ const message = messages[index]
185
+ message.dateTimeArray = this.data.dateTimeArray
186
+ message.dateTime = this.data.dateTime
187
+ messages[index] = message
188
+ this.setData({
189
+ messages: messages
190
+ })
191
+ },
192
+
193
+ _joinVideo() {
194
+
195
+ },
196
+
197
+ changeDateTime(e) {
198
+ this._changeDateTime(e)
199
+ },
200
+
201
+ changeDateTimeColumn(e) {
202
+ this._changeDateTimeColumn(e)
203
+ },
204
+
205
+ changeDateTimeControl(e) {
206
+ this._changeDateTime(e.detail, false)
207
+ },
208
+
209
+ changeDateTimeColumnControl(e) {
210
+ this._changeDateTimeColumn(e.detail)
211
+ },
212
+
213
+ _clickEvaluate() {
214
+ if (this.data.feedbackStar <= 0) {
215
+ let isRequest = this.data.isRequest
216
+ hhNavigation.evaluate(this.data.orderId, isRequest)
217
+ }
218
+ }
219
+ })
@@ -0,0 +1,10 @@
1
+ {
2
+ "usingComponents": {
3
+ "detail-text": "./widget/detail-text/detail-text",
4
+ "detail-media": "./widget/detail-media/detail-media",
5
+ "chat-base-cell": "./widget/chat-base-cell/chat-base-cell",
6
+ "chat-bottom": "./widget/chat-bottom/chat-bottom"
7
+ },
8
+ "navigationBarTitleText": "咨询单详情",
9
+ "backgroundColor": "#000000"
10
+ }
@@ -0,0 +1,65 @@
1
+ <import src="../detail/widget/chat-cell-template/chat-cell-template" />
2
+ <view class="match-parent">
3
+ <scroll-view class="scroll-view" scroll-y scroll-into-view="{{scrollTo}}">
4
+ <view class="consultation-header" wx:if="{{order}}">
5
+ <block wx:for="{{headerTexts}}" wx:key="text">
6
+ <detail-text
7
+ label="{{item.label}}"
8
+ content="{{item.content || ''}}"
9
+ ></detail-text>
10
+ </block>
11
+ <scroll-view
12
+ wx:if="{{mediaInfo.length > 0}}"
13
+ type="list"
14
+ scroll-x
15
+ class="consultation-header-media-scroll-view"
16
+ enable-flex="true"
17
+ >
18
+ <view class="consultation-header-media-box">
19
+ <block wx:for="{{mediaInfo}}" wx:key="image">
20
+ <detail-media
21
+ index="{{item.index}}"
22
+ label="{{item.label}}"
23
+ url="{{item.icon}}"
24
+ type="{{item.type}}"
25
+ showNumber="{{item.showNumber}}"
26
+ bind:clickMedia="clickMedia"
27
+ />
28
+ </block>
29
+ </view>
30
+ </scroll-view>
31
+ <view class="doctor-info-container"
32
+ ><text class="doctor-info">{{doctorInfo}}</text>
33
+ </view>
34
+ </view>
35
+ <view class="chatting-body">
36
+ <block wx:for="{{messages}}" wx:key="message">
37
+ <block wx:if="{{item.custom}}">
38
+ <template is="{{item.template}}" data="{{...item}}" />
39
+ </block>
40
+ <block wx:else>
41
+ <chat-base-cell
42
+ index="{{item.index}}"
43
+ photo="{{item.photo}}"
44
+ name="{{item.name}}"
45
+ createtime="{{item.createtime}}"
46
+ isSend="{{item.isSend}}"
47
+ bind:clickCell="clickMessageCell"
48
+ >
49
+ <template is="{{item.template}}" data="{{...item}}" />
50
+ </chat-base-cell>
51
+ </block>
52
+ </block>
53
+ </view>
54
+ <view id="message-bottom" class="message-bottom"></view>
55
+ </scroll-view>
56
+ <chat-bottom
57
+ id="chat-bottom"
58
+ wx:if="{{order}}"
59
+ order="{{order}}"
60
+ bind:changeDateTime="changeDateTimeControl"
61
+ bind:changeDateTimeColumn="changeDateTimeColumnControl"
62
+ dateTimeArray="{{dateTimeArray}}"
63
+ dateTime="{{dateTime}}"
64
+ ></chat-bottom>
65
+ </view>