hh-doctor-sdk 0.3.0 → 0.3.2
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/apis/dicom-api.js +31 -1
- package/components/apis/order-app-api.js +14 -0
- package/components/consultation/detail/behaviors/consultation-chat-behaviors.js +8 -6
- package/components/consultation/detail/behaviors/consultation-header-media-behaviors.js +9 -1
- package/components/consultation/detail/consultation-detail-page.js +5 -0
- package/components/consultation/detail/widget/chat-bottom/chat-bottom.js +8 -1
- package/components/consultation/detail/widget/chat-bottom/chat-bottom.wxml +1 -0
- package/components/consultation/detail/widget/chat-bottom/chat-bottom.wxss +0 -7
- package/components/consultation/detail/widget/chat-bottom/chat-menu-builder.js +64 -2
- package/components/consultation/detail/widget/chat-cell-template/chat-cell-template.wxml +1 -0
- package/components/consultation/list/behaviors/consultation-list-base-behaviors.js +1 -1
- package/components/consultation/list/consultation-list-page.js +3 -23
- package/components/consultation/list/consultation-list-page.wxml +8 -4
- package/components/consultation/list/consultation-list-page.wxss +19 -4
- package/components/consultation/reply/behaviors/reply-base-behaviors.js +19 -0
- package/components/hh-navigation.js +16 -0
- package/components/pathology/pathology-page.js +130 -0
- package/components/pathology/pathology-page.json +4 -0
- package/components/pathology/pathology-page.wxml +17 -0
- package/components/pathology/pathology-page.wxss +52 -0
- package/components/public/cache-data.js +11 -2
- package/components/utils/base64.js +67 -0
- package/components/utils/httpUtils.js +7 -2
- package/components/utils/permission-utils.js +39 -1
- package/package.json +1 -1
|
@@ -8,6 +8,10 @@ const apiPaths = {
|
|
|
8
8
|
hostType: hostDefine.hostTypes.dicom,
|
|
9
9
|
path: '/service/querydicom'
|
|
10
10
|
},
|
|
11
|
+
getPathology: {
|
|
12
|
+
hostType: hostDefine.hostTypes.dicom,
|
|
13
|
+
path: '/api/pathology',
|
|
14
|
+
}
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
function getDicom(orderId) {
|
|
@@ -18,6 +22,30 @@ function getDicom(orderId) {
|
|
|
18
22
|
return httpUtils.get(apiPaths.getDicom, params, {})
|
|
19
23
|
}
|
|
20
24
|
|
|
25
|
+
function getPatholoty(hospitalId, orderId, path) {
|
|
26
|
+
let params = {
|
|
27
|
+
'action': 'listmenu',
|
|
28
|
+
'hospitalid': hospitalId,
|
|
29
|
+
'orderid': orderId
|
|
30
|
+
}
|
|
31
|
+
if (path) {
|
|
32
|
+
params['path'] = path
|
|
33
|
+
}
|
|
34
|
+
return httpUtils.get(apiPaths.getPathology, params, {})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getPatholotyDetail(hospitalId, orderId, path) {
|
|
38
|
+
let params = {
|
|
39
|
+
'action': 'listall',
|
|
40
|
+
'hospitalid': hospitalId,
|
|
41
|
+
'orderid': orderId
|
|
42
|
+
}
|
|
43
|
+
if (path) {
|
|
44
|
+
params['path'] = path
|
|
45
|
+
}
|
|
46
|
+
return httpUtils.get(apiPaths.getPathology, params, {})
|
|
47
|
+
}
|
|
48
|
+
|
|
21
49
|
function dicomUrl(id) {
|
|
22
50
|
const baseUrl = cache.isTest() ? 'https://test.hh-medic.com/dicom/dicomviewer/viewer.html' : 'https://dicom.hh-medic.com/dicomviewer/viewer.html'
|
|
23
51
|
const timestamp = new Date().getTime()
|
|
@@ -27,5 +55,7 @@ function dicomUrl(id) {
|
|
|
27
55
|
|
|
28
56
|
module.exports = {
|
|
29
57
|
getDicom,
|
|
30
|
-
dicomUrl
|
|
58
|
+
dicomUrl,
|
|
59
|
+
getPatholoty,
|
|
60
|
+
getPatholotyDetail
|
|
31
61
|
}
|
|
@@ -41,6 +41,14 @@ const apiPaths = {
|
|
|
41
41
|
hostType: hostDefine.hostTypes.order,
|
|
42
42
|
path: '/orderplan/reply_order'
|
|
43
43
|
},
|
|
44
|
+
doctorAsk: {
|
|
45
|
+
hostType: hostDefine.hostTypes.order,
|
|
46
|
+
path: '/orderask/ask_order_doctor'
|
|
47
|
+
}, // 医生追问回复
|
|
48
|
+
doctorSupply: {
|
|
49
|
+
hostType: hostDefine.hostTypes.order,
|
|
50
|
+
path: '/orderask/ask_order_doctor'
|
|
51
|
+
}, // 医生补充资料
|
|
44
52
|
orderList: {
|
|
45
53
|
hostType: hostDefine.hostTypes.order,
|
|
46
54
|
path: '/orderlist/doctor_order_task_list'
|
|
@@ -149,6 +157,12 @@ function requestReply(type, params, body) {
|
|
|
149
157
|
case menuBuilder.ChatEventType.reply:
|
|
150
158
|
requestPath = apiPaths.expertReply
|
|
151
159
|
break
|
|
160
|
+
case menuBuilder.ChatEventType.doctorAsk:
|
|
161
|
+
requestPath = apiPaths.doctorAsk
|
|
162
|
+
break
|
|
163
|
+
case menuBuilder.ChatEventType.dAddSupply:
|
|
164
|
+
requestPath = apiPaths.doctorSupply
|
|
165
|
+
break
|
|
152
166
|
}
|
|
153
167
|
return httpUtils.post(requestPath, params, body, null)
|
|
154
168
|
}
|
|
@@ -81,12 +81,14 @@ module.exports = Behavior({
|
|
|
81
81
|
messages: list,
|
|
82
82
|
isRequest: isRequest,
|
|
83
83
|
}, () => {
|
|
84
|
-
|
|
85
|
-
wx.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
wx.createSelectorQuery().select('#scroll-body').boundingClientRect(res => {
|
|
86
|
+
wx.pageScrollTo({
|
|
87
|
+
scrollTop: res.bottom,
|
|
88
|
+
duration: 200
|
|
89
|
+
})
|
|
90
|
+
}).exec()
|
|
91
|
+
}, 500);
|
|
90
92
|
})
|
|
91
93
|
}
|
|
92
94
|
},
|
|
@@ -2,6 +2,7 @@ const pdfViewer = require('../../../public/pdf-viewer')
|
|
|
2
2
|
const dicomApi = require('../../../apis/dicom-api')
|
|
3
3
|
const caseImageFilter = require('../widget/case-image-filter')
|
|
4
4
|
const hhNavigation = require('../../../hh-navigation')
|
|
5
|
+
const cache = require('../../../public/cache-data')
|
|
5
6
|
|
|
6
7
|
module.exports = Behavior({
|
|
7
8
|
|
|
@@ -30,7 +31,7 @@ module.exports = Behavior({
|
|
|
30
31
|
/**
|
|
31
32
|
* 构建多媒体文件数据
|
|
32
33
|
* @param {*} index 分组下标
|
|
33
|
-
* @param {*} type 类型 0.图片 1.pdf 2.DICOM 4.视频 5.URL DICOM
|
|
34
|
+
* @param {*} type 类型 0.图片 1.pdf 2.DICOM 4.视频 5.URL DICOM 6.病理
|
|
34
35
|
* @param {*} label 显示标题
|
|
35
36
|
* @param {*} files 文件列表
|
|
36
37
|
*/
|
|
@@ -98,6 +99,10 @@ module.exports = Behavior({
|
|
|
98
99
|
mediaGroups.push(this.mediaItem(groupIndex, 2, 'DICOM', [], 'https://imgs.hh-medic.com/icon/hh_consulation_dicom_icon.png', '点击查看'))
|
|
99
100
|
groupIndex++
|
|
100
101
|
}
|
|
102
|
+
if (order.patient.patientBingli && order.patient.patientBingli.length > 0) {
|
|
103
|
+
mediaGroups.push(this.mediaItem(groupIndex, 6, '病理', [], 'http://image.hh-medic.com/icon/pacs/hh_icon_bingli.png', '点击查看'))
|
|
104
|
+
groupIndex++
|
|
105
|
+
}
|
|
101
106
|
this.setData({
|
|
102
107
|
mediaInfo: mediaGroups
|
|
103
108
|
})
|
|
@@ -148,6 +153,9 @@ module.exports = Behavior({
|
|
|
148
153
|
const url = media.files[0].url
|
|
149
154
|
hhNavigation.webPage(url)
|
|
150
155
|
}
|
|
156
|
+
} else if (media.type == 6) {
|
|
157
|
+
let hospitalId = this.data.order.doctor.hospitalid
|
|
158
|
+
hhNavigation.pathology(this.data.orderId, hospitalId)
|
|
151
159
|
}
|
|
152
160
|
},
|
|
153
161
|
|
|
@@ -5,6 +5,7 @@ var audioAnimationInterval
|
|
|
5
5
|
|
|
6
6
|
const hhNavigation = require('../../hh-navigation')
|
|
7
7
|
const doctorLoader = require('../../public/doctor-loader')
|
|
8
|
+
const permission = require('../../utils/permission-utils')
|
|
8
9
|
|
|
9
10
|
Page({
|
|
10
11
|
|
|
@@ -204,6 +205,10 @@ Page({
|
|
|
204
205
|
|
|
205
206
|
},
|
|
206
207
|
|
|
208
|
+
tapSetDate() {
|
|
209
|
+
permission.subscriptionVideoTime()
|
|
210
|
+
},
|
|
211
|
+
|
|
207
212
|
changeDateTime(e) {
|
|
208
213
|
this._changeDateTime(e)
|
|
209
214
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const menuBuilder = require('./chat-menu-builder')
|
|
2
2
|
const cache = require('../../../../public/cache-data')
|
|
3
|
-
const base = require('../../../../hh-doctor')
|
|
4
3
|
const hhNavigation = require('../../../../hh-navigation')
|
|
4
|
+
const permission = require('../../../../utils/permission-utils')
|
|
5
5
|
|
|
6
6
|
Component({
|
|
7
7
|
|
|
@@ -67,6 +67,9 @@ Component({
|
|
|
67
67
|
case menuBuilder.ChatEventType.reply:
|
|
68
68
|
this._forwart2Reply(menuBuilder.ChatEventType.reply)
|
|
69
69
|
break
|
|
70
|
+
case menuBuilder.ChatEventType.doctorAsk:
|
|
71
|
+
this._forwart2Reply(menuBuilder.ChatEventType.doctorAsk)
|
|
72
|
+
break
|
|
70
73
|
}
|
|
71
74
|
},
|
|
72
75
|
|
|
@@ -95,6 +98,10 @@ Component({
|
|
|
95
98
|
*/
|
|
96
99
|
changeDateTimeColumn(e) {
|
|
97
100
|
this.triggerEvent('changeDateTimeColumn', e)
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
tapSetDate() {
|
|
104
|
+
permission.subscriptionVideoTime()
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
107
|
})
|
|
@@ -7,6 +7,9 @@ const OrderState = {
|
|
|
7
7
|
rejected: 3,
|
|
8
8
|
timeout: 4,
|
|
9
9
|
addSupplement: 15,
|
|
10
|
+
giveUp: 9,
|
|
11
|
+
giveUpComplete: 10,
|
|
12
|
+
confirm: 12,
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
const ChatEventType = {
|
|
@@ -18,7 +21,11 @@ const ChatEventType = {
|
|
|
18
21
|
startVideo: 'startVideo',
|
|
19
22
|
videoMore: 'videoMore',
|
|
20
23
|
visitConfirm: 'visitConfirm',
|
|
21
|
-
visitReject: 'visitReject'
|
|
24
|
+
visitReject: 'visitReject',
|
|
25
|
+
|
|
26
|
+
cancel: 'cancel',
|
|
27
|
+
doctorAsk: 'doctorAsk',
|
|
28
|
+
dAddSupply: 'dAddSupply'
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
function orderMenus(order) {
|
|
@@ -27,7 +34,7 @@ function orderMenus(order) {
|
|
|
27
34
|
}
|
|
28
35
|
const isRequest = cache.isRequest(order.doctorid)
|
|
29
36
|
if (isRequest) {
|
|
30
|
-
return
|
|
37
|
+
return _doctorNormalMenu(order)
|
|
31
38
|
}
|
|
32
39
|
const provideType = order.provideType
|
|
33
40
|
if (!isRequest && provideType && provideType.length > 0 && provideType != 'normal') {
|
|
@@ -41,6 +48,9 @@ function orderMenus(order) {
|
|
|
41
48
|
return _normalMenus(order)
|
|
42
49
|
}
|
|
43
50
|
|
|
51
|
+
/**
|
|
52
|
+
* 专家视频订单菜单
|
|
53
|
+
* */
|
|
44
54
|
function _videoMenus(order) {
|
|
45
55
|
var menus = []
|
|
46
56
|
const state = order.state
|
|
@@ -63,6 +73,9 @@ function _videoMenus(order) {
|
|
|
63
73
|
return menus
|
|
64
74
|
}
|
|
65
75
|
|
|
76
|
+
/**
|
|
77
|
+
* 专家飞刀订单菜单
|
|
78
|
+
* */
|
|
66
79
|
function _feidaoMenus(order) {
|
|
67
80
|
var menus = []
|
|
68
81
|
const state = order.state
|
|
@@ -82,6 +95,9 @@ function _feidaoMenus(order) {
|
|
|
82
95
|
return menus
|
|
83
96
|
}
|
|
84
97
|
|
|
98
|
+
/**
|
|
99
|
+
* 专家普通订单菜单
|
|
100
|
+
* */
|
|
85
101
|
function _normalMenus(order) {
|
|
86
102
|
var menus = []
|
|
87
103
|
const state = order.state
|
|
@@ -118,6 +134,52 @@ function _normalMenus(order) {
|
|
|
118
134
|
return menus
|
|
119
135
|
}
|
|
120
136
|
|
|
137
|
+
/**
|
|
138
|
+
* 提单医生普通菜单
|
|
139
|
+
* @param {*} order 订单
|
|
140
|
+
*/
|
|
141
|
+
function _doctorNormalMenu(order) {
|
|
142
|
+
var menus = []
|
|
143
|
+
const state = order.state
|
|
144
|
+
const isPaySuccess = (order.needPayMoney || 0) <= 0
|
|
145
|
+
const canFeedback = order.orderMessage && (order.orderMessage.needDoctorFeedback || false)
|
|
146
|
+
const canAsk = (order.isask || 0) == 1
|
|
147
|
+
switch (state) {
|
|
148
|
+
case OrderState.timeout:
|
|
149
|
+
case OrderState.rejected:
|
|
150
|
+
menus.push(_menu(ChatEventType.cancel, '直接退款'))
|
|
151
|
+
break
|
|
152
|
+
case OrderState.giveUp:
|
|
153
|
+
case OrderState.giveUpComplete:
|
|
154
|
+
break
|
|
155
|
+
case OrderState.submit:
|
|
156
|
+
if (isPaySuccess) {
|
|
157
|
+
menus.push(_menu(ChatEventType.doctorAsk, '讨论交流'))
|
|
158
|
+
}
|
|
159
|
+
break
|
|
160
|
+
case OrderState.finished:
|
|
161
|
+
if (canAsk && !canFeedback) {
|
|
162
|
+
menus.push(_menu(ChatEventType.doctorAsk, '讨论交流'))
|
|
163
|
+
}
|
|
164
|
+
break
|
|
165
|
+
case OrderState.confirm:
|
|
166
|
+
if (canFeedback) {
|
|
167
|
+
menus.push(_menu(ChatEventType.doctorAsk, '讨论交流'))
|
|
168
|
+
}
|
|
169
|
+
break
|
|
170
|
+
case OrderState.accepted:
|
|
171
|
+
menus.push(_menu(ChatEventType.doctorAsk, '讨论交流'))
|
|
172
|
+
break
|
|
173
|
+
case OrderState.addSupplement:
|
|
174
|
+
menus.push(_menu(ChatEventType.dAddSupply, '补充资料'))
|
|
175
|
+
menus.push(_menu(ChatEventType.doctorAsk, '讨论交流'))
|
|
176
|
+
break
|
|
177
|
+
default:
|
|
178
|
+
break
|
|
179
|
+
}
|
|
180
|
+
return menus
|
|
181
|
+
}
|
|
182
|
+
|
|
121
183
|
function _menu(type, text, style = 0) {
|
|
122
184
|
return {
|
|
123
185
|
type: type,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const hhDoctor = require('../../hh-doctor')
|
|
2
1
|
const doctorLoader = require('../../public/doctor-loader')
|
|
3
2
|
const cache = require('../../public/cache-data')
|
|
4
3
|
|
|
@@ -40,9 +39,11 @@ Page({
|
|
|
40
39
|
if (judgeLogin) {
|
|
41
40
|
wx.statLog.sendStatLog(null, '打开咨询单列表界面')
|
|
42
41
|
const doctorId = wx.getStorageSync('doctorId') || ''
|
|
42
|
+
console.error(`doctorId => ${doctorId}`)
|
|
43
43
|
const isTest = (getApp().globalData.profileName || 'prod') == 'test'
|
|
44
44
|
cache.cache({
|
|
45
|
-
isTest: isTest
|
|
45
|
+
isTest: isTest,
|
|
46
|
+
doctorId: doctorId
|
|
46
47
|
})
|
|
47
48
|
if (!doctorId) {
|
|
48
49
|
wx.showModal({
|
|
@@ -84,16 +85,9 @@ Page({
|
|
|
84
85
|
complete: (res) => {
|
|
85
86
|
if (wx.loginConfig && wx.loginConfig.judgeLogin) {
|
|
86
87
|
if (res.cancel) {
|
|
87
|
-
// wx.switchTab({
|
|
88
|
-
// url: '/pages/recommend/recommend',
|
|
89
|
-
// })
|
|
90
88
|
wx.loginConfig.directLogin(false)
|
|
91
89
|
}
|
|
92
|
-
|
|
93
90
|
if (res.confirm) {
|
|
94
|
-
// wx.navigateTo({
|
|
95
|
-
// url: '/pkgMine/pages/mine/loginpage',
|
|
96
|
-
// })
|
|
97
91
|
wx.loginConfig.directLogin(true)
|
|
98
92
|
}
|
|
99
93
|
}
|
|
@@ -121,18 +115,4 @@ Page({
|
|
|
121
115
|
onPullDownRefresh() {
|
|
122
116
|
this.loadList()
|
|
123
117
|
},
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* 页面上拉触底事件的处理函数
|
|
127
|
-
*/
|
|
128
|
-
onReachBottom() {
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* 用户点击右上角分享
|
|
134
|
-
*/
|
|
135
|
-
onShareAppMessage() {
|
|
136
|
-
|
|
137
|
-
}
|
|
138
118
|
})
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
<view class="match-parent">
|
|
2
|
-
<view wx:if="{{!showEmpty}}" class="
|
|
2
|
+
<view wx:if="{{!showEmpty}}" class="order-list-body">
|
|
3
3
|
<block wx:for="{{orderGroup}}" wx:key="orderGroup" wx:for-item="group">
|
|
4
|
-
<view
|
|
5
|
-
|
|
4
|
+
<view
|
|
5
|
+
id="{{group.sectionId}}"
|
|
6
|
+
wx:if="{{group.showSection}}"
|
|
7
|
+
class="order-group"
|
|
6
8
|
>
|
|
7
|
-
|
|
9
|
+
{{group.title}}
|
|
10
|
+
</view>
|
|
11
|
+
<view class="order-list">
|
|
8
12
|
<block
|
|
9
13
|
wx:for="{{group.list}}"
|
|
10
14
|
wx:key="order"
|
|
@@ -6,17 +6,32 @@ page {
|
|
|
6
6
|
height: 100%;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
flex-direction: column;
|
|
9
|
+
.order-list-body {
|
|
10
|
+
width: 100%;
|
|
12
11
|
padding-bottom: constant(safe-area-inset-bottom); /* 兼容 IOS<11.2 */
|
|
13
12
|
padding-bottom: env(safe-area-inset-bottom); /* 兼容 IOS>11.2 */
|
|
14
13
|
}
|
|
15
14
|
|
|
15
|
+
.order-list {
|
|
16
|
+
width: 100%;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
.order-group {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: row;
|
|
24
|
+
width: calc(100% - 30rpx);
|
|
25
|
+
position: sticky;
|
|
26
|
+
top: 0;
|
|
27
|
+
height: 80rpx;
|
|
17
28
|
font-size: 32rpx;
|
|
29
|
+
font-weight: bold;
|
|
18
30
|
color: #333333;
|
|
19
|
-
padding:
|
|
31
|
+
padding: 0 0 0 30rpx;
|
|
32
|
+
background-color: #f3f5fb;
|
|
33
|
+
align-items: center;
|
|
34
|
+
z-index: 2;
|
|
20
35
|
}
|
|
21
36
|
|
|
22
37
|
.order-item {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const menuBuilder = require('../../detail/widget/chat-bottom/chat-menu-builder')
|
|
2
2
|
const api = require('../../../apis/order-app-api')
|
|
3
3
|
const checkPermission = require('../../../utils/permission-utils')
|
|
4
|
+
const cache = require('../../../public/cache-data')
|
|
4
5
|
|
|
5
6
|
module.exports = Behavior({
|
|
6
7
|
|
|
@@ -48,6 +49,7 @@ module.exports = Behavior({
|
|
|
48
49
|
placeHolder = '请在此填写拒绝原因'
|
|
49
50
|
break
|
|
50
51
|
case menuBuilder.ChatEventType.reply:
|
|
52
|
+
case menuBuilder.ChatEventType.doctorAsk:
|
|
51
53
|
title = '填写回复内容'
|
|
52
54
|
placeHolder = '请在此填回复内容'
|
|
53
55
|
break
|
|
@@ -88,9 +90,14 @@ module.exports = Behavior({
|
|
|
88
90
|
nullTip = '请补充需要补充资料原因'
|
|
89
91
|
break
|
|
90
92
|
case menuBuilder.ChatEventType.reply:
|
|
93
|
+
case menuBuilder.ChatEventType.doctorAsk:
|
|
91
94
|
status = 2
|
|
92
95
|
nullTip = '请补充需要回复的内容'
|
|
93
96
|
break
|
|
97
|
+
case menuBuilder.ChatEventType.dAddSupply:
|
|
98
|
+
status = 200
|
|
99
|
+
nullTip = '请补充资料'
|
|
100
|
+
break
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
var params = {}
|
|
@@ -104,6 +111,12 @@ module.exports = Behavior({
|
|
|
104
111
|
'actionSource': 'wxdoctor',
|
|
105
112
|
'status': status,
|
|
106
113
|
}
|
|
114
|
+
|
|
115
|
+
if (this.isRequest()) {
|
|
116
|
+
body['role'] = 1
|
|
117
|
+
body['userid'] = this.data.order.doctorid
|
|
118
|
+
}
|
|
119
|
+
|
|
107
120
|
if (type == menuBuilder.ChatEventType.eAddSupply) {
|
|
108
121
|
body['showDoctor'] = true
|
|
109
122
|
}
|
|
@@ -119,7 +132,9 @@ module.exports = Behavior({
|
|
|
119
132
|
}
|
|
120
133
|
})
|
|
121
134
|
body['caseImageList'] = sendMediaFiles
|
|
135
|
+
|
|
122
136
|
}
|
|
137
|
+
|
|
123
138
|
if (body['comments'] == '' && (body['contentSound'] == null || body['contentSound'] == '') && body['caseImageList'] == null) {
|
|
124
139
|
wx.showToast({
|
|
125
140
|
icon: null,
|
|
@@ -179,5 +194,9 @@ module.exports = Behavior({
|
|
|
179
194
|
}
|
|
180
195
|
this._toRecordAudio()
|
|
181
196
|
},
|
|
197
|
+
|
|
198
|
+
isRequest() {
|
|
199
|
+
return cache.doctorId() == this.data.order.doctorid
|
|
200
|
+
},
|
|
182
201
|
}
|
|
183
202
|
})
|
|
@@ -5,6 +5,7 @@ const pages = {
|
|
|
5
5
|
webPage: 'uikit/web-view-page/web-view-page',
|
|
6
6
|
evaluate: 'consultation/evaluate/evaluate-page',
|
|
7
7
|
videoChat: 'video-chat-page/video-chat-page',
|
|
8
|
+
pathology: 'pathology/pathology-page'
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
|
|
@@ -76,6 +77,20 @@ function videoChat(orderId, doctorId, isTest, callback) {
|
|
|
76
77
|
})
|
|
77
78
|
}
|
|
78
79
|
|
|
80
|
+
function pathology(orderId, hospitalId, path) {
|
|
81
|
+
let params = {
|
|
82
|
+
'orderId': orderId,
|
|
83
|
+
'hospitalId': hospitalId
|
|
84
|
+
}
|
|
85
|
+
if (path) {
|
|
86
|
+
params['path'] = path
|
|
87
|
+
}
|
|
88
|
+
navigateTo(
|
|
89
|
+
pages.pathology,
|
|
90
|
+
params
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
79
94
|
module.exports = {
|
|
80
95
|
navigateTo,
|
|
81
96
|
orderList,
|
|
@@ -84,4 +99,5 @@ module.exports = {
|
|
|
84
99
|
webPage,
|
|
85
100
|
evaluate,
|
|
86
101
|
videoChat,
|
|
102
|
+
pathology,
|
|
87
103
|
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
const dicomApi = require('../apis/dicom-api')
|
|
2
|
+
const hhNavigation = require('../hh-navigation')
|
|
3
|
+
const base64Utils = require('../utils/base64')
|
|
4
|
+
|
|
5
|
+
const basePathologyUrl = 'https://dicom.hh-medic.com/pathology/viewer'
|
|
6
|
+
|
|
7
|
+
Page({
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 页面的初始数据
|
|
11
|
+
*/
|
|
12
|
+
data: {
|
|
13
|
+
orderId: null,
|
|
14
|
+
hospitalId: null,
|
|
15
|
+
path: null,
|
|
16
|
+
list: [],
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 生命周期函数--监听页面加载
|
|
21
|
+
*/
|
|
22
|
+
onLoad(options) {
|
|
23
|
+
const orderId = options.orderId
|
|
24
|
+
const hospitalId = options.hospitalId
|
|
25
|
+
let path = options.path || null
|
|
26
|
+
if (path != null) {
|
|
27
|
+
path = decodeURIComponent(path)
|
|
28
|
+
}
|
|
29
|
+
if (path != null) {
|
|
30
|
+
wx.setNavigationBarTitle({
|
|
31
|
+
title: path,
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
this.setData({
|
|
35
|
+
orderId: orderId,
|
|
36
|
+
hospitalId: hospitalId,
|
|
37
|
+
path: path,
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 生命周期函数--监听页面初次渲染完成
|
|
43
|
+
*/
|
|
44
|
+
onReady() {
|
|
45
|
+
wx.startPullDownRefresh()
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 生命周期函数--监听页面显示
|
|
50
|
+
*/
|
|
51
|
+
onShow() {
|
|
52
|
+
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 生命周期函数--监听页面隐藏
|
|
57
|
+
*/
|
|
58
|
+
onHide() {
|
|
59
|
+
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 生命周期函数--监听页面卸载
|
|
64
|
+
*/
|
|
65
|
+
onUnload() {
|
|
66
|
+
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 页面相关事件处理函数--监听用户下拉动作
|
|
71
|
+
*/
|
|
72
|
+
onPullDownRefresh() {
|
|
73
|
+
this._loadList()
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 页面上拉触底事件的处理函数
|
|
78
|
+
*/
|
|
79
|
+
onReachBottom() {
|
|
80
|
+
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 用户点击右上角分享
|
|
85
|
+
*/
|
|
86
|
+
onShareAppMessage() {
|
|
87
|
+
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
clickCell: function (event) {
|
|
91
|
+
const name = event.currentTarget.dataset.name
|
|
92
|
+
if (this.data.path == null) {
|
|
93
|
+
hhNavigation.pathology(this.data.orderId, this.data.hospitalId, name)
|
|
94
|
+
} else {
|
|
95
|
+
dicomApi.getPatholotyDetail(this.data.hospitalId, this.data.orderId, name).then((res) => {
|
|
96
|
+
const dataEncode = encodeURIComponent(JSON.stringify(res.data))
|
|
97
|
+
const base64Params = base64Utils.base64Encode(dataEncode)
|
|
98
|
+
const url = `${basePathologyUrl}?para=${base64Params}`
|
|
99
|
+
hhNavigation.webPage(url)
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
_loadList() {
|
|
105
|
+
wx.showNavigationBarLoading()
|
|
106
|
+
const hospitalId = this.data.hospitalId
|
|
107
|
+
const orderId = this.data.orderId
|
|
108
|
+
const path = this.data.path
|
|
109
|
+
dicomApi.getPatholoty(hospitalId, orderId, path).then(res => {
|
|
110
|
+
wx.hideNavigationBarLoading()
|
|
111
|
+
wx.stopPullDownRefresh()
|
|
112
|
+
if (res.data && res.data.list) {
|
|
113
|
+
this.setData({
|
|
114
|
+
list: res.data.list,
|
|
115
|
+
})
|
|
116
|
+
if (!path || path == null) {
|
|
117
|
+
wx.setNavigationBarTitle({
|
|
118
|
+
title: res.data.hospital,
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}).catch((e) => {
|
|
123
|
+
wx.hideNavigationBarLoading()
|
|
124
|
+
wx.stopPullDownRefresh()
|
|
125
|
+
wx.showToast({
|
|
126
|
+
title: '加载出错了',
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<view>
|
|
2
|
+
<view class="tui-table-view">
|
|
3
|
+
<view
|
|
4
|
+
class="tui-col-3"
|
|
5
|
+
wx:for="{{list}}"
|
|
6
|
+
wx:key="item"
|
|
7
|
+
data-name="{{item.name}}"
|
|
8
|
+
bind:tap="clickCell"
|
|
9
|
+
>
|
|
10
|
+
<view class="tui-col-3-image-container">
|
|
11
|
+
<image class="tui-col-3-image" src="{{item.url}}"></image>
|
|
12
|
+
<view class="tui-col-3-count">共{{item.count}}张</view>
|
|
13
|
+
</view>
|
|
14
|
+
<view class="tui-col-3-name">{{item.name}}</view>
|
|
15
|
+
</view>
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
page {
|
|
2
|
+
background-color: #f3f5fb;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.tui-table-view {
|
|
8
|
+
display: -webkit-flex;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
width: 90%;
|
|
14
|
+
margin: 0 5%;
|
|
15
|
+
}
|
|
16
|
+
.tui-col-3 {
|
|
17
|
+
width: 47%;
|
|
18
|
+
text-align: center;
|
|
19
|
+
color: #797979;
|
|
20
|
+
padding-top: 20rpx;
|
|
21
|
+
font-size: 30rpx;
|
|
22
|
+
margin-bottom: 20rpx;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tui-col-3-image-container {
|
|
26
|
+
position: relative;
|
|
27
|
+
height: 240rpx;
|
|
28
|
+
border-radius: 6rpx;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.tui-col-3-image {
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.tui-col-3-count {
|
|
38
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
39
|
+
position: absolute;
|
|
40
|
+
right: 0;
|
|
41
|
+
bottom: 0;
|
|
42
|
+
color: white;
|
|
43
|
+
font-size: 32rpx;
|
|
44
|
+
padding: 4rpx 10rpx;
|
|
45
|
+
border-radius: 6rpx;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.tui-col-3-name {
|
|
49
|
+
font-size: 32rpx;
|
|
50
|
+
margin-top: 20rpx;
|
|
51
|
+
color: #333333;
|
|
52
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function cache(data) {
|
|
2
2
|
var doctorOptions = wx.doctorOptions || {}
|
|
3
|
-
if (data.doctorId && data.doctorId
|
|
3
|
+
if (data.doctorId && data.doctorId != null && data.doctorId != '') {
|
|
4
4
|
generateSessionId()
|
|
5
5
|
}
|
|
6
6
|
// if (data.doctor != null) {
|
|
@@ -84,6 +84,14 @@ function uuid() {
|
|
|
84
84
|
return null
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
function userToken() {
|
|
88
|
+
const doctorInfo = doctor()
|
|
89
|
+
if (doctorInfo) {
|
|
90
|
+
return doctorInfo.userToken
|
|
91
|
+
}
|
|
92
|
+
return null
|
|
93
|
+
}
|
|
94
|
+
|
|
87
95
|
function videoToken() {
|
|
88
96
|
const doctorInfo = doctor()
|
|
89
97
|
if (doctorInfo) {
|
|
@@ -130,5 +138,6 @@ module.exports = {
|
|
|
130
138
|
getSessionId,
|
|
131
139
|
getLogId,
|
|
132
140
|
clearLogId,
|
|
133
|
-
isRequest
|
|
141
|
+
isRequest,
|
|
142
|
+
userToken,
|
|
134
143
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// 实现Base64加密
|
|
2
|
+
function base64Encode(str) {
|
|
3
|
+
let base64 = new Base64();
|
|
4
|
+
return base64.encode(str);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// 实现Base64解密
|
|
8
|
+
function base64Decode(str) {
|
|
9
|
+
let base64 = new Base64();
|
|
10
|
+
return base64.decode(str);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 定义Base64对象
|
|
14
|
+
function Base64() {
|
|
15
|
+
|
|
16
|
+
// Base64字符集
|
|
17
|
+
const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
18
|
+
|
|
19
|
+
// 编码函数
|
|
20
|
+
this.encode = function (str) {
|
|
21
|
+
let result = '';
|
|
22
|
+
for (let i = 0; i < str.length; i += 3) {
|
|
23
|
+
let a = str.charCodeAt(i);
|
|
24
|
+
let b = i + 1 < str.length ? str.charCodeAt(i + 1) : 0;
|
|
25
|
+
let c = i + 2 < str.length ? str.charCodeAt(i + 2) : 0;
|
|
26
|
+
|
|
27
|
+
let a1 = a >> 2,
|
|
28
|
+
a2 = ((a & 3) << 4) | (b >> 4),
|
|
29
|
+
a3 = ((b & 15) << 2) | (c >> 6),
|
|
30
|
+
a4 = c & 63;
|
|
31
|
+
|
|
32
|
+
result += base64Chars[a1] + base64Chars[a2] + (i + 1 < str.length ? base64Chars[a3] : '=') + (i + 2 < str.length ? base64Chars[a4] : '=');
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 解码函数
|
|
38
|
+
this.decode = function (str) {
|
|
39
|
+
let result = '';
|
|
40
|
+
let i = 0;
|
|
41
|
+
while (i < str.length) {
|
|
42
|
+
let a = base64Chars.indexOf(str.charAt(i++));
|
|
43
|
+
let b = base64Chars.indexOf(str.charAt(i++));
|
|
44
|
+
let c = base64Chars.indexOf(str.charAt(i++));
|
|
45
|
+
let d = base64Chars.indexOf(str.charAt(i++));
|
|
46
|
+
|
|
47
|
+
let a1 = (a << 2) | (b >> 4);
|
|
48
|
+
let a2 = ((b & 15) << 4) | (c >> 2);
|
|
49
|
+
let a3 = ((c & 3) << 6) | d;
|
|
50
|
+
|
|
51
|
+
result += String.fromCharCode(a1);
|
|
52
|
+
if (c != 64) {
|
|
53
|
+
result += String.fromCharCode(a2);
|
|
54
|
+
}
|
|
55
|
+
if (d != 64) {
|
|
56
|
+
result += String.fromCharCode(a3);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 向外暴露方法
|
|
64
|
+
module.exports = {
|
|
65
|
+
base64Encode: base64Encode,
|
|
66
|
+
base64Decode: base64Decode
|
|
67
|
+
}
|
|
@@ -36,7 +36,7 @@ function _request(request, method, params, data) {
|
|
|
36
36
|
fullParams.sdkProductId = appConfig.appID
|
|
37
37
|
fullParams.pid = appConfig.appID
|
|
38
38
|
fullParams.app_version = appConfig.appVersion
|
|
39
|
-
fullParams.actionSource = '
|
|
39
|
+
fullParams.actionSource = 'wxdoctor'
|
|
40
40
|
fullParams.device_token = ''
|
|
41
41
|
if (doctorId) {
|
|
42
42
|
fullParams.doctor_id = doctorId
|
|
@@ -61,13 +61,18 @@ function _request(request, method, params, data) {
|
|
|
61
61
|
const header = {
|
|
62
62
|
'Accept': 'application/json',
|
|
63
63
|
'content-type': 'application/json',
|
|
64
|
-
'cookie': cookie,
|
|
64
|
+
// 'cookie': cookie,
|
|
65
65
|
'APPTYPE': 'pc',
|
|
66
66
|
'AppKey': appConfig.appKey,
|
|
67
67
|
'Nonce': nonce,
|
|
68
68
|
'CurTime': curTime,
|
|
69
69
|
'CheckSum': checkSum
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
if (data && !data.actionSource) {
|
|
73
|
+
data['actionSource'] = 'wxdoctor'
|
|
74
|
+
}
|
|
75
|
+
|
|
71
76
|
if (request.download) {
|
|
72
77
|
wx.downloadFile({
|
|
73
78
|
url: url,
|
|
@@ -157,8 +157,46 @@ function showPermissionTip(error, ...scopes) {
|
|
|
157
157
|
})
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
function subscriptionVideoTime() {
|
|
161
|
+
const id = 'D8X5Vg3T0MmqA_uie9kyTEmfUoaHreWq4d9KoeM1UCg'
|
|
162
|
+
wx.getSetting({
|
|
163
|
+
withSubscriptions: true,
|
|
164
|
+
success(res) {
|
|
165
|
+
// console.log(res)
|
|
166
|
+
if (res.subscriptionsSetting.mainSwitch) { // 用户打开了订阅消息总开关
|
|
167
|
+
if (res.subscriptionsSetting.itemSettings) { // 用户同意总是保持是否推送消息的选择, 这里表示以后不会再拉起推送消息的授权
|
|
168
|
+
let moIdState = res.subscriptionsSetting.itemSettings[id]; // 用户同意的消息模板id
|
|
169
|
+
if (moIdState === 'accept') {
|
|
170
|
+
// console.log('接受了消息推送');
|
|
171
|
+
} else if (moIdState === 'reject') {
|
|
172
|
+
// console.log('拒绝了消息推送');
|
|
173
|
+
wx.requestSubscribeMessage({
|
|
174
|
+
tmplIds: [id],
|
|
175
|
+
success(res) {},
|
|
176
|
+
})
|
|
177
|
+
} else if (moIdState === 'ban') {
|
|
178
|
+
// console.log("已被后台封禁");
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
wx.requestSubscribeMessage({
|
|
182
|
+
tmplIds: [id],
|
|
183
|
+
success(res) {},
|
|
184
|
+
})
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// else {
|
|
188
|
+
// wx.openSetting({
|
|
189
|
+
// withSubscriptions: true,
|
|
190
|
+
// })
|
|
191
|
+
|
|
192
|
+
// }
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
|
|
160
197
|
module.exports = {
|
|
161
198
|
checkMediaPermission: checkMediaPermission,
|
|
162
199
|
checkScopeRecord: checkScopeRecord,
|
|
163
|
-
checkScopeCamera: checkScopeCamera
|
|
200
|
+
checkScopeCamera: checkScopeCamera,
|
|
201
|
+
subscriptionVideoTime: subscriptionVideoTime,
|
|
164
202
|
}
|