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,212 @@
1
+ const imManager = require('../public/im-manager')
2
+ const doctorLoader = require('../public/doctor-loader')
3
+ const defines = require('./video-chat-defines')
4
+ const pdfViewer = require('../public/pdf-viewer')
5
+
6
+ Page({
7
+
8
+ behaviors: [require('./behaviors/video-chat-behaviors')],
9
+
10
+ /**
11
+ * 生命周期函数--监听页面加载
12
+ */
13
+ onLoad(options) {
14
+ wx.setKeepScreenOn({
15
+ keepScreenOn: true,
16
+ })
17
+ const doctorId = options.doctorId
18
+ doctorLoader.loadDoctor({
19
+ doctorId: doctorId,
20
+ scence: '咨询单详情',
21
+ isTest: options.isTest || true
22
+ }, (res) => {
23
+ if (res) {
24
+ this.initData(options)
25
+ }
26
+ })
27
+
28
+ },
29
+
30
+ initData(options) {
31
+ if (!this.checkParams(options)) {
32
+ return
33
+ }
34
+ this._sendLog('打开呼叫界面')
35
+ wx.statLog.sendStatLog(this.data.orderId, '打开呼叫界面')
36
+ this.bindIMMessageEvent()
37
+ this._loadData()
38
+ },
39
+
40
+ /**
41
+ * 生命周期函数--监听页面初次渲染完成
42
+ */
43
+ onReady() {
44
+ wx.statLog.sendStatLog(this.data.orderId, '开始播放呼叫铃声并且加载数据')
45
+ this.playCallRing()
46
+ },
47
+
48
+ /**
49
+ * 生命周期函数--监听页面显示
50
+ */
51
+ onShow() {
52
+
53
+ },
54
+
55
+ /**
56
+ * 生命周期函数--监听页面隐藏
57
+ */
58
+ onHide() {
59
+
60
+ },
61
+
62
+ /**
63
+ * 生命周期函数--监听页面卸载
64
+ */
65
+ onUnload() {
66
+ this.unBindIMMessageEvent()
67
+ },
68
+
69
+ /**
70
+ * 页面相关事件处理函数--监听用户下拉动作
71
+ */
72
+ onPullDownRefresh() {
73
+
74
+ },
75
+
76
+ /**
77
+ * 页面上拉触底事件的处理函数
78
+ */
79
+ onReachBottom() {
80
+
81
+ },
82
+
83
+ /**
84
+ * 用户点击右上角分享
85
+ */
86
+ onShareAppMessage() {
87
+
88
+ },
89
+
90
+ /**
91
+ * 监测是否所有必须的参数
92
+ * @param {*} options
93
+ */
94
+ checkParams(options) {
95
+ const orderId = options.orderId
96
+ if (orderId === null || orderId === '') {
97
+ wx.showToast({
98
+ title: '未传必要的参数orderId',
99
+ })
100
+ setTimeout(() => {
101
+ wx.navigateBack()
102
+ }, 1000);
103
+ return false
104
+ }
105
+ const info = wx.getSystemInfoSync()
106
+ //mac windows 无需处理顶部间距
107
+ const isPC = info.platform === 'mac' || info.platform === 'windows'
108
+ const res = wx.getMenuButtonBoundingClientRect()
109
+ const top = isPC ? 0 : res.bottom + 10
110
+ let callback = false
111
+ if (options.callback) {
112
+ callback = JSON.parse(options.callback)
113
+ }
114
+ this.setData({
115
+ smallVideoTop: top,
116
+ callback: callback,
117
+ orderId: orderId,
118
+ })
119
+ this.bindOrderId(orderId)
120
+ return true
121
+ },
122
+
123
+ _loadData() {
124
+ this.loadOrderInfo()
125
+ },
126
+
127
+ /**
128
+ * 绑定IM消息回调事件
129
+ */
130
+ bindIMMessageEvent() {
131
+ wx.statLog.sendStatLog(this.data.orderId, `注册IM消息回调`)
132
+ this.messageEventKey = wx.eventBus.newKey()
133
+ wx.eventBus.on({
134
+ key: this.messageEventKey,
135
+ event: imManager.EventNames.IMCustomMessage,
136
+ 'listener': (params) => {
137
+ wx.statLog.sendStatLog(this.data.orderId, `收到IM消息(${JSON.stringify(params)})`)
138
+ if (params) {
139
+ this.onMessage(params.command)
140
+ }
141
+ }
142
+ })
143
+ },
144
+
145
+ /**
146
+ * 取消绑定IM消息回调事件
147
+ */
148
+ unBindIMMessageEvent() {
149
+ wx.statLog.sendStatLog(this.data.orderId, `注销IM消息回调`)
150
+ wx.eventBus.off({
151
+ key: this.messageEventKey
152
+ })
153
+ },
154
+
155
+ /**
156
+ * 处理消息
157
+ * @param {*} command 消息命令
158
+ */
159
+ onMessage(command) {
160
+ switch (command) {
161
+ case defines.commands.reject:
162
+ case defines.commands.rejectWMP:
163
+ // case defines.commands.busy:
164
+ wx.statLog.sendStatLog(this.data.orderId, '对方拒绝接听')
165
+ this.hangup(defines.hangupTypes.otherReject)
166
+ break
167
+ case defines.commands.cancel:
168
+ wx.statLog.sendStatLog(this.data.orderId, '专家侧取消呼叫')
169
+ this.hangup(defines.hangupTypes.otherCancel)
170
+ break
171
+ case defines.commands.uploadPic:
172
+ this.setData({
173
+ newCases: true,
174
+ })
175
+ break
176
+ case defines.commands.switchToAudioWMP:
177
+ case defines.commands.switchToAudioAgora:
178
+ this.setData({
179
+ isInVoice: true,
180
+ })
181
+ break
182
+ case defines.commands.switchToVideoWMP:
183
+ case defines.commands.switchToVideoAgora:
184
+ this.setData({
185
+ isInVoice: false,
186
+ })
187
+ break
188
+ }
189
+ },
190
+
191
+ hideCasePop() {
192
+ this.selectComponent("#casePop").hide()
193
+ },
194
+
195
+ clickMedia(e) {
196
+ const {
197
+ type,
198
+ url
199
+ } = e.detail
200
+ if (type === 'video' || type === 'image') {
201
+ const find = this.data._mediaFiles.findIndex((value, index, array) => {
202
+ return value.url == url
203
+ })
204
+ wx.previewMedia({
205
+ current: find,
206
+ sources: this.data._mediaFiles,
207
+ })
208
+ } else if (type === 'pdf') {
209
+ pdfViewer.viewPdf(url)
210
+ }
211
+ }
212
+ })
@@ -0,0 +1,14 @@
1
+ {
2
+ "usingComponents": {
3
+ "video-chat": "../video-chat/video-chat",
4
+ "agora-video-chat": "../video-chat/agora-rtc/agora-rtc",
5
+ "video-controller": "../video-chat/controller/controller",
6
+ "video-calling": "../video-chat/calling/calling",
7
+ "video-callback": "../video-chat/callback/callback",
8
+ "custom-pop": "../uikit/custom-bottom-pop/custom-bottom-pop",
9
+ "case-group": "./case-group-view/case-group-view"
10
+ },
11
+ "backgroundColor": "#000000",
12
+ "navigationStyle": "custom",
13
+ "disableScroll": true
14
+ }
@@ -0,0 +1,88 @@
1
+ <view class="video-chat-container">
2
+ <block wx:if="{{order}}">
3
+ <video-chat
4
+ id="trtc"
5
+ wx:if="{{!isFromAgora}}"
6
+ orderId="{{orderId}}"
7
+ order="{{order}}"
8
+ callback="{{callback}}"
9
+ isInVoice="{{isInVoice}}"
10
+ smallVideoTop="{{smallVideoTop}}"
11
+ isFamilyOrder="{{isFamilyOrder}}"
12
+ expertAvatar="{{expertAvatar}}"
13
+ bind:directHangup="_directHangup"
14
+ bind:sendCallMessage="sendCallMessage"
15
+ bind:updateVideoState="_updateVideoState"
16
+ bind:sendLog="_sendLogC"
17
+ bind:remoteUserJoin="_onRemoteUserJoin"
18
+ bind:remoteUserLeave="_onRemoteUserLeave"
19
+ />
20
+ <agora-video-chat
21
+ id="artc"
22
+ wx:if="{{isFromAgora}}"
23
+ orderId="{{orderId}}"
24
+ order="{{order}}"
25
+ callback="{{callback}}"
26
+ isInVoice="{{isInVoice}}"
27
+ smallVideoTop="{{smallVideoTop}}"
28
+ isFamilyOrder="{{isFamilyOrder}}"
29
+ expertAvatar="{{expertAvatar}}"
30
+ bind:directHangup="_directHangup"
31
+ bind:sendCallMessage="sendCallMessage"
32
+ bind:updateVideoState="_updateVideoState"
33
+ bind:sendLog="_sendLogC"
34
+ bind:remoteUserJoin="_onRemoteUserJoin"
35
+ bind:remoteUserLeave="_onRemoteUserLeave"
36
+ />
37
+ </block>
38
+ <video-controller
39
+ wx:if="{{'chatting' === videoStatus}}"
40
+ startChatTime="{{startChatTime}}"
41
+ newCases="{{newCases}}"
42
+ callback="{{callback}}"
43
+ isInVoice="{{isInVoice}}"
44
+ bind:hangup="_controllerHangup"
45
+ bind:changeVoice="_controllerChangeVoiceVideo"
46
+ bind:clickViewCase="_viewCase"
47
+ />
48
+ <video-calling
49
+ wx:elif="{{'calling' === videoStatus}}"
50
+ bind:cancel="_controllerCancel"
51
+ isFamilyOrder="{{isFamilyOrder}}"
52
+ smallVideoTop="{{smallVideoTop}}"
53
+ bind:notifyCall="_controllerNotifyCall"
54
+ />
55
+ <video-callback
56
+ wx:elif="{{'call_back' === videoStatus}}"
57
+ expert="{{expert}}"
58
+ smallVideoTop="{{smallVideoTop}}"
59
+ bind:accept="_controllerAccept"
60
+ bind:reject="_controllerReject"
61
+ />
62
+ </view>
63
+ <custom-pop id="casePop">
64
+ <view class="case-pop-container">
65
+ <view class="case-pop-title-bar">
66
+ <view>病历资料</view>
67
+ <image
68
+ class="close-button"
69
+ src="https://image.hh-medic.com/icon/pacs/hh_drawer_close.png"
70
+ bind:tap="hideCasePop"
71
+ />
72
+ </view>
73
+ <scroll-view
74
+ class="scroll-view"
75
+ scroll-y
76
+ scroll-into-view="{{mediaTop}}"
77
+ >
78
+ <view id="mediaTop"></view>
79
+ <block wx:for="{{caseGroups}}">
80
+ <case-group
81
+ bind:clickMedia="clickMedia"
82
+ title="{{item.title}}"
83
+ files="{{item.files}}"
84
+ ></case-group>
85
+ </block>
86
+ </scroll-view>
87
+ </view>
88
+ </custom-pop>
@@ -0,0 +1,45 @@
1
+ @import "../uikit/css/common.wxss";
2
+
3
+ page {
4
+ background-color: black;
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+ .video-chat-container {
9
+ height: 100%;
10
+ color: black;
11
+ display: flex;
12
+ }
13
+
14
+ .close-button {
15
+ position: absolute;
16
+ width: 90rpx;
17
+ height: 90rpx;
18
+ top: 0;
19
+ right: 0;
20
+ margin: 0;
21
+ /* border: 0 red solid !important; */
22
+ background-color: transparent;
23
+ /* color: #333333;
24
+ font-weight: normal;
25
+ font-size: 32rpx; */
26
+ }
27
+
28
+ .close-button::after {
29
+ border: none;
30
+ }
31
+
32
+ .case-pop-container {
33
+ display: flex;
34
+ height: 800rpx;
35
+ background-color: white;
36
+ flex-direction: column;
37
+ }
38
+
39
+ .case-pop-title-bar {
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ font-size: 36rpx;
44
+ margin: 20rpx 0;
45
+ }
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "hh-doctor-sdk",
3
+ "version": "0.0.1",
4
+ "description": "和缓名医小程序SDK",
5
+ "devDependencies": {},
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [
10
+ "和缓名医小程序SDK"
11
+ ],
12
+ "author": "liumingming",
13
+ "license": "ISC",
14
+ "dependencies": {
15
+ "@tencentcloud/chat": "^3.1.3"
16
+ },
17
+ "miniprogram": "components"
18
+ }