hh-doctor-sdk 0.0.7 → 0.0.9

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 (112) hide show
  1. package/components/apis/api-host-define.js +69 -1
  2. package/components/apis/consultation-reply-api.js +21 -1
  3. package/components/apis/dicom-api.js +31 -1
  4. package/components/apis/family-api.js +20 -1
  5. package/components/apis/file-upload-api.js +35 -1
  6. package/components/apis/order-app-api.js +206 -1
  7. package/components/apis/stat-log-api.js +42 -1
  8. package/components/apis/video-chat-log-api.js +47 -1
  9. package/components/apis/video-message-api.js +88 -1
  10. package/components/consultation/detail/behaviors/chat-cell-base-behaviors.js +29 -1
  11. package/components/consultation/detail/behaviors/consultation-behaviors.js +60 -1
  12. package/components/consultation/detail/behaviors/consultation-chat-behaviors.js +322 -1
  13. package/components/consultation/detail/behaviors/consultation-header-media-behaviors.js +195 -1
  14. package/components/consultation/detail/behaviors/consultation-header-text-behaviors.js +325 -1
  15. package/components/consultation/detail/behaviors/consultation-reply-behaviors.js +73 -1
  16. package/components/consultation/detail/consultation-detail-page.js +219 -1
  17. package/components/consultation/detail/consultation-detail-page.wxml +69 -5
  18. package/components/consultation/detail/consultation-detail-page.wxss +72 -1
  19. package/components/consultation/detail/widget/case-image-filter.js +47 -1
  20. package/components/consultation/detail/widget/chat-base-cell/chat-base-cell.js +31 -1
  21. package/components/consultation/detail/widget/chat-base-cell/chat-base-cell.wxml +17 -1
  22. package/components/consultation/detail/widget/chat-base-cell/chat-base-cell.wxss +9 -1
  23. package/components/consultation/detail/widget/chat-bottom/chat-bottom.js +100 -1
  24. package/components/consultation/detail/widget/chat-bottom/chat-bottom.wxml +23 -2
  25. package/components/consultation/detail/widget/chat-bottom/chat-bottom.wxss +54 -1
  26. package/components/consultation/detail/widget/chat-bottom/chat-menu-builder.js +131 -1
  27. package/components/consultation/detail/widget/chat-cell-template/chat-cell-template.wxml +169 -5
  28. package/components/consultation/detail/widget/chat-cell.wxss +394 -1
  29. package/components/consultation/detail/widget/detail-media/detail-media.js +47 -1
  30. package/components/consultation/detail/widget/detail-media/detail-media.wxml +12 -1
  31. package/components/consultation/detail/widget/detail-media/detail-media.wxss +57 -1
  32. package/components/consultation/detail/widget/detail-text/detail-text.js +31 -1
  33. package/components/consultation/detail/widget/detail-text/detail-text.wxml +6 -2
  34. package/components/consultation/detail/widget/detail-text/detail-text.wxss +14 -1
  35. package/components/consultation/evaluate/evaluate-page.js +157 -1
  36. package/components/consultation/evaluate/evaluate-page.wxml +41 -2
  37. package/components/consultation/evaluate/evaluate-page.wxss +103 -1
  38. package/components/consultation/list/behaviors/consultation-list-base-behaviors.js +157 -1
  39. package/components/consultation/list/consultation-list-page.js +104 -1
  40. package/components/consultation/list/consultation-list-page.wxml +53 -6
  41. package/components/consultation/list/consultation-list-page.wxss +114 -1
  42. package/components/consultation/reply/behaviors/reply-base-behaviors.js +183 -1
  43. package/components/consultation/reply/consultation-reply-page.js +251 -1
  44. package/components/consultation/reply/consultation-reply-page.wxml +102 -2
  45. package/components/consultation/reply/consultation-reply-page.wxss +169 -1
  46. package/components/consultation/reply/widget/audio-record-view/audio-record-view.js +144 -1
  47. package/components/consultation/reply/widget/audio-record-view/audio-record-view.wxml +27 -1
  48. package/components/consultation/reply/widget/audio-record-view/audio-record-view.wxss +197 -1
  49. package/components/hh-doctor.js +36 -1
  50. package/components/hh-navigation.js +87 -1
  51. package/components/public/app-config.js +15 -1
  52. package/components/public/behaviors/order-base-behaviors.js +61 -1
  53. package/components/public/cache-data.js +134 -1
  54. package/components/public/doctor-loader.js +60 -1
  55. package/components/public/im-manager.js +131 -1
  56. package/components/public/pdf-viewer.js +59 -1
  57. package/components/public/stat-log.js +13 -1
  58. package/components/static/Agora_Miniapp_SDK_for_WeChat.js +2 -1
  59. package/components/static/tim-wx.js +1 -0
  60. package/components/static/trtc-wx.js +2 -1
  61. package/components/uikit/css/common.wxss +28 -1
  62. package/components/uikit/custom-bottom-pop/custom-bottom-pop.js +37 -1
  63. package/components/uikit/custom-bottom-pop/custom-bottom-pop.wxml +9 -1
  64. package/components/uikit/custom-bottom-pop/custom-bottom-pop.wxss +79 -1
  65. package/components/uikit/date-time-picker/date-time-picker.js +115 -1
  66. package/components/uikit/web-view-page/web-view-page.js +87 -1
  67. package/components/uikit/web-view-page/web-view-page.wxml +6 -1
  68. package/components/uikit/web-view-page/web-view-page.wxss +1 -0
  69. package/components/utils/checksumUtils.js +56 -1
  70. package/components/utils/common-utils.js +59 -1
  71. package/components/utils/dateUtils.js +142 -1
  72. package/components/utils/eventBus.js +77 -1
  73. package/components/utils/httpUtils.js +126 -1
  74. package/components/utils/number-utils.js +48 -1
  75. package/components/utils/permission-utils.js +164 -1
  76. package/components/utils/uiUtil.js +7 -1
  77. package/components/video-chat/agora-rtc/agora-player/agora-player.js +106 -1
  78. package/components/video-chat/agora-rtc/agora-player/agora-player.wxml +26 -1
  79. package/components/video-chat/agora-rtc/agora-player/agora-player.wxss +1 -1
  80. package/components/video-chat/agora-rtc/agora-pusher/agora-pusher.js +92 -1
  81. package/components/video-chat/agora-rtc/agora-pusher/agora-pusher.wxml +22 -1
  82. package/components/video-chat/agora-rtc/agora-pusher/agora-pusher.wxss +1 -1
  83. package/components/video-chat/agora-rtc/agora-rtc.js +391 -1
  84. package/components/video-chat/agora-rtc/agora-rtc.wxml +41 -1
  85. package/components/video-chat/agora-rtc/agora-rtc.wxss +1 -1
  86. package/components/video-chat/callback/callback.js +39 -1
  87. package/components/video-chat/callback/callback.wxml +29 -1
  88. package/components/video-chat/callback/callback.wxss +26 -1
  89. package/components/video-chat/calling/calling.js +59 -1
  90. package/components/video-chat/calling/calling.wxml +21 -2
  91. package/components/video-chat/calling/calling.wxss +38 -1
  92. package/components/video-chat/controller/controller.js +86 -1
  93. package/components/video-chat/controller/controller.wxml +37 -2
  94. package/components/video-chat/controller/controller.wxss +71 -1
  95. package/components/video-chat/remote-player/remote-player.js +42 -1
  96. package/components/video-chat/remote-player/remote-player.wxml +37 -1
  97. package/components/video-chat/remote-player/remote-player.wxss +1 -1
  98. package/components/video-chat/video-chat.js +297 -1
  99. package/components/video-chat/video-chat.wxml +56 -1
  100. package/components/video-chat/video-chat.wxss +99 -1
  101. package/components/video-chat-page/behaviors/chat-files-behaviors.js +227 -1
  102. package/components/video-chat-page/behaviors/chat-log-behaviors.js +90 -1
  103. package/components/video-chat-page/behaviors/chat-sound-behaviors.js +60 -1
  104. package/components/video-chat-page/behaviors/video-chat-behaviors.js +523 -1
  105. package/components/video-chat-page/case-group-view/case-group-view.js +38 -1
  106. package/components/video-chat-page/case-group-view/case-group-view.wxml +32 -1
  107. package/components/video-chat-page/case-group-view/case-group-view.wxss +44 -1
  108. package/components/video-chat-page/video-chat-defines.js +39 -1
  109. package/components/video-chat-page/video-chat-page.js +215 -1
  110. package/components/video-chat-page/video-chat-page.wxml +86 -2
  111. package/components/video-chat-page/video-chat-page.wxss +45 -1
  112. package/package.json +1 -5
@@ -1 +1,69 @@
1
- const cache=require("../public/cache-data"),hostTypes={order:"order",family:"family",dicom:"dicom",log:"log"},testHost="https://test.hh-medic.com/orderapp",prodHost="https://sec.hh-medic.com/orderapp",familyTest="https://test.hh-medic.com/familyapp",familyProd="https://sdk01.hh-medic.com/familyapp",dicomTest="https://test.hh-medic.com/dicom",dicomProd="https://dicom.hh-medic.com",statLogTest="https://test.hh-medic.com/wmp-log",statLogProd="https://wmp.hh-medic.com/wmp-log";function _requestHost(){return cache.isTest()?testHost:prodHost}function _familytHost(){return cache.isTest()?familyTest:familyProd}function _dicomHost(){return cache.isTest()?dicomTest:dicomProd}function _statHost(){return cache.isTest()?statLogTest:statLogProd}function host(t){switch(t){case hostTypes.order:return _requestHost();case hostTypes.family:return _familytHost();case hostTypes.dicom:return _dicomHost();case hostTypes.log:return _statHost();default:return _requestHost()}}module.exports={hostTypes:hostTypes,host:host};
1
+ const cache = require('../public/cache-data')
2
+
3
+ const hostTypes = {
4
+ order: 'order', // host order app
5
+ family: 'family', // host family app
6
+ dicom: 'dicom', // host dicom
7
+ log: 'log'
8
+ }
9
+
10
+ const testHost = 'https://test.hh-medic.com/orderapp'
11
+ const prodHost = 'https://sec.hh-medic.com/orderapp'
12
+
13
+ const familyTest = 'https://test.hh-medic.com/familyapp'
14
+ const familyProd = 'https://sdk01.hh-medic.com/familyapp'
15
+
16
+ const dicomTest = 'https://test.hh-medic.com/dicom'
17
+ const dicomProd = 'https://dicom.hh-medic.com'
18
+
19
+ const statLogTest = 'https://test.hh-medic.com/wmp-log'
20
+ const statLogProd = 'https://wmp.hh-medic.com/wmp-log'
21
+
22
+
23
+ function _requestHost() {
24
+ if (cache.isTest()) {
25
+ return testHost
26
+ }
27
+ return prodHost
28
+ }
29
+
30
+ function _familytHost() {
31
+ if (cache.isTest()) {
32
+ return familyTest
33
+ }
34
+ return familyProd
35
+ }
36
+
37
+ function _dicomHost() {
38
+ if (cache.isTest()) {
39
+ return dicomTest
40
+ }
41
+ return dicomProd
42
+ }
43
+
44
+ function _statHost() {
45
+ if (cache.isTest()) {
46
+ return statLogTest
47
+ }
48
+ return statLogProd
49
+ }
50
+
51
+ function host(type) {
52
+ switch (type) {
53
+ case hostTypes.order:
54
+ return _requestHost()
55
+ case hostTypes.family:
56
+ return _familytHost()
57
+ case hostTypes.dicom:
58
+ return _dicomHost()
59
+ case hostTypes.log:
60
+ return _statHost()
61
+ default:
62
+ return _requestHost()
63
+ }
64
+ }
65
+
66
+ module.exports = {
67
+ hostTypes,
68
+ host,
69
+ }
@@ -1 +1,21 @@
1
- const httpUtils=require("../utils/httpUtils"),hostDefine=require("../apis/api-host-define"),apiPaths={setProvideTime:{hostType:hostDefine.hostTypes.order,path:"/api/updateProvideTime"}};function setProvideTime(e,i){e={orderId:e,provideTime:i};return httpUtils.post(apiPaths.setProvideTime,e,{})}module.exports={setProvideTime:setProvideTime};
1
+ const httpUtils = require('../utils/httpUtils')
2
+ const hostDefine = require('../apis/api-host-define')
3
+
4
+ const apiPaths = {
5
+ setProvideTime: {
6
+ hostType: hostDefine.hostTypes.order,
7
+ path: '/api/updateProvideTime'
8
+ },
9
+ }
10
+
11
+ function setProvideTime(orderId, time) {
12
+ const params = {
13
+ 'orderId': orderId,
14
+ 'provideTime': time
15
+ }
16
+ return httpUtils.post(apiPaths.setProvideTime, params, {})
17
+ }
18
+
19
+ module.exports = {
20
+ setProvideTime,
21
+ }
@@ -1 +1,31 @@
1
- const httpUtils=require("../utils/httpUtils"),hostDefine=require("../apis/api-host-define"),cache=require("../public/cache-data"),checksumUtils=require("../utils/checksumUtils"),apiPaths={getDicom:{hostType:hostDefine.hostTypes.dicom,path:"/service/querydicom"}};function getDicom(e){e={orderid:e,action:"listmenu"};return httpUtils.get(apiPaths.getDicom,e,{})}function dicomUrl(e){var i=cache.isTest()?"https://test.hh-medic.com/dicom/dicomviewer/viewer.html":"https://dicom.hh-medic.com/dicomviewer/viewer.html",t=(new Date).getTime();return i+`?Nonce=${e}&CurTime=${t}&CheckSum=`+checksumUtils.sha1("Bck3bOeR5rSJ"+e+t)}module.exports={getDicom:getDicom,dicomUrl:dicomUrl};
1
+ const httpUtils = require('../utils/httpUtils');
2
+ const hostDefine = require('../apis/api-host-define')
3
+ const cache = require('../public/cache-data')
4
+ const checksumUtils = require('../utils/checksumUtils')
5
+
6
+ const apiPaths = {
7
+ getDicom: {
8
+ hostType: hostDefine.hostTypes.dicom,
9
+ path: '/service/querydicom'
10
+ },
11
+ }
12
+
13
+ function getDicom(orderId) {
14
+ const params = {
15
+ 'orderid': orderId,
16
+ 'action': 'listmenu'
17
+ }
18
+ return httpUtils.get(apiPaths.getDicom, params, {})
19
+ }
20
+
21
+ function dicomUrl(id) {
22
+ const baseUrl = cache.isTest() ? 'https://test.hh-medic.com/dicom/dicomviewer/viewer.html' : 'https://dicom.hh-medic.com/dicomviewer/viewer.html'
23
+ const timestamp = new Date().getTime()
24
+ const checksum = checksumUtils.sha1(`Bck3bOeR5rSJ${id}${timestamp}`)
25
+ return `${baseUrl}?Nonce=${id}&CurTime=${timestamp}&CheckSum=${checksum}`
26
+ }
27
+
28
+ module.exports = {
29
+ getDicom,
30
+ dicomUrl
31
+ }
@@ -1 +1,20 @@
1
- const httpUtils=require("../utils/httpUtils"),hostDefine=require("../apis/api-host-define"),apiPaths={doctorDetail:{hostType:hostDefine.hostTypes.family,path:"/expert/famDoctorDetail"}};function getDoctorInfo(t){t={doctorUuid:t};return httpUtils.post(apiPaths.doctorDetail,t,{})}module.exports={getDoctorInfo:getDoctorInfo};
1
+ const httpUtils = require('../utils/httpUtils')
2
+ const hostDefine = require('../apis/api-host-define')
3
+
4
+ const apiPaths = {
5
+ doctorDetail: {
6
+ hostType: hostDefine.hostTypes.family,
7
+ path: '/expert/famDoctorDetail'
8
+ },
9
+ }
10
+
11
+ function getDoctorInfo(doctorUUID) {
12
+ const params = {
13
+ 'doctorUuid': doctorUUID
14
+ }
15
+ return httpUtils.post(apiPaths.doctorDetail, params, {})
16
+ }
17
+
18
+ module.exports = {
19
+ getDoctorInfo,
20
+ }
@@ -1 +1,35 @@
1
- const hostDefine=require("./api-host-define"),cache=require("../public/cache-data");function upload(i,t){var e=i.substring(i.lastIndexOf("/")+1),e=`${hostDefine.host(hostDefine.hostTypes.order)}/file/file_upload_wmp?session_id=${cache.getSessionId()}&user_id=${cache.doctorId()}&login_name=${cache.phone()}&file_name=`+e;wx.uploadFile({filePath:i,name:"file",url:e,header:{APPTYPE:"wxapp","Content-Type":"multipart/form-data"},success:e=>{let l=null,a=!1;null!=e.data&&(200==(e=JSON.parse(e.data)).status&&null!=e.file_key&&""!=e.file_key&&(l=e.file_key),a=null!=l&&""!=l),t(a,i,l)},fail:()=>{t(!1,i,null)}})}module.exports={upload:upload};
1
+ const hostDefine = require('./api-host-define')
2
+ const cache = require('../public/cache-data')
3
+
4
+ function upload(path, callback) {
5
+ var fileName = path.substring(path.lastIndexOf('/') + 1)
6
+ var url = `${hostDefine.host(hostDefine.hostTypes.order)}/file/file_upload_wmp?session_id=${cache.getSessionId()}&user_id=${cache.doctorId()}&login_name=${cache.phone()}&file_name=${fileName}`
7
+ wx.uploadFile({
8
+ filePath: path,
9
+ name: 'file',
10
+ url: url,
11
+ header: {
12
+ "APPTYPE": "wxapp",
13
+ "Content-Type": "multipart/form-data"
14
+ },
15
+ success: (res) => {
16
+ let fileKey = null
17
+ let uploadResult = false
18
+ if (res.data != null) {
19
+ var resultData = JSON.parse(res.data)
20
+ if (resultData.status == 200 && resultData.file_key != null && resultData.file_key != '') {
21
+ fileKey = resultData.file_key
22
+ }
23
+ uploadResult = fileKey != null && fileKey != ''
24
+ }
25
+ callback(uploadResult, path, fileKey)
26
+ },
27
+ fail: () => {
28
+ callback(false, path, null)
29
+ }
30
+ })
31
+ }
32
+
33
+ module.exports = {
34
+ upload,
35
+ }
@@ -1 +1,206 @@
1
- const httpUtils=require("../utils/httpUtils"),dateFormat=require("../utils/dateUtils"),hostDefine=require("./api-host-define"),menuBuilder=require("../consultation/detail/widget/chat-bottom/chat-menu-builder"),apiPaths={login:{hostType:hostDefine.hostTypes.order,path:"/login/login.do"},getDoctor:{hostType:hostDefine.hostTypes.order,path:"/doctor/doctorinfo"},getRoomId:{hostType:hostDefine.hostTypes.order,path:"/ordercreate/getRoomId"},getOrderDetail:{hostType:hostDefine.hostTypes.order,path:"/orderdetail/get_order_doctor"},getExpertInfo:{hostType:hostDefine.hostTypes.order,path:"/doctor/expertinfo"},getAgoraToken:{hostType:hostDefine.hostTypes.order,path:"/api/im/getAgoraToken"},needMoreByExpert:{hostType:hostDefine.hostTypes.order,path:"/orderask/needMoreOrderByExpert"},refuseOrderByExpert:{hostType:hostDefine.hostTypes.order,path:"/orderask/refuseOrderByExpert"},expertReply:{hostType:hostDefine.hostTypes.order,path:"/orderplan/reply_order"},orderList:{hostType:hostDefine.hostTypes.order,path:"/orderlist/doctor_order_task_list"},orderFeedback:{hostType:hostDefine.hostTypes.order,path:"/manager/feedback/create"},feedbackTagList:{hostType:hostDefine.hostTypes.order,path:"/manager/feedback/tagList"},feedback:{hostType:hostDefine.hostTypes.order,path:"/manager/feedback/create"},fileData:{hostType:hostDefine.hostTypes.order,path:"/patient/fileData"}};function login(e,t){var r=new Date,e={mail:e,password:t,role:1,timestamp:dateFormat.format(r,"yyyyMMddhhmmss")};return httpUtils.post(apiPaths.login,null,e)}function getDoctorInfo(e){e={doctor_id:e};return httpUtils.get(apiPaths.getDoctor,e,null)}function getRoomId(e){var t={};return e&&(t.orderId=e),httpUtils.post(apiPaths.getRoomId,t,null)}function getOrderDetail(e){var t={};return e&&(t.orderId=e),httpUtils.get(apiPaths.getOrderDetail,t,null)}function getExpertInfo(e){var t={};return e&&(t.expert_id=e),httpUtils.post(apiPaths.getExpertInfo,t,null)}function getAgoraToken(e){var t={};return e&&(t.orderId=e),httpUtils.post(apiPaths.getAgoraToken,t,null)}function requestReply(e,t,r){var t=Object.assign({},t||{}),o=apiPaths.needMoreByExpert;switch(e){case menuBuilder.ChatEventType.eAddSupply:o=apiPaths.needMoreByExpert;break;case menuBuilder.ChatEventType.refuse:o=apiPaths.refuseOrderByExpert;break;case menuBuilder.ChatEventType.reply:o=apiPaths.expertReply}return httpUtils.post(o,t,r,null)}function orderList(){return httpUtils.post(apiPaths.orderList,{},null)}function getOrderFeedbackTags(e){e={role:e};return httpUtils.post(apiPaths.feedbackTagList,e,null)}function feedback(e,t,r,o,s){e={role:e,orderId:t,isGood:r,comments:o,tagIdList:s};return httpUtils.post(apiPaths.feedback,null,e)}function fileData(e,t){e={orderId:e,patientId:t};return httpUtils.get(apiPaths.fileData,e,null)}module.exports={login:login,getRoomId:getRoomId,getOrderDetail:getOrderDetail,getExpertInfo:getExpertInfo,getAgoraToken:getAgoraToken,getDoctorInfo:getDoctorInfo,requestReply:requestReply,orderList:orderList,getOrderFeedbackTags:getOrderFeedbackTags,feedback:feedback,fileData:fileData};
1
+ const httpUtils = require('../utils/httpUtils');
2
+ // const sha1 = require('../utils/checksumUtils');
3
+ const dateFormat = require('../utils/dateUtils')
4
+ const hostDefine = require('./api-host-define')
5
+ const menuBuilder = require('../consultation/detail/widget/chat-bottom/chat-menu-builder')
6
+
7
+ const apiPaths = {
8
+ login: {
9
+ hostType: hostDefine.hostTypes.order,
10
+ path: '/login/login.do'
11
+ }, // 登录
12
+ getDoctor: {
13
+ hostType: hostDefine.hostTypes.order,
14
+ path: '/doctor/doctorinfo'
15
+ },
16
+ getRoomId: {
17
+ hostType: hostDefine.hostTypes.order,
18
+ path: '/ordercreate/getRoomId'
19
+ }, // 获取视频房间号
20
+ getOrderDetail: {
21
+ hostType: hostDefine.hostTypes.order,
22
+ path: '/orderdetail/get_order_doctor'
23
+ }, // 获取订单详情数据
24
+ getExpertInfo: {
25
+ hostType: hostDefine.hostTypes.order,
26
+ path: '/doctor/expertinfo'
27
+ }, // 获取专家信息
28
+ getAgoraToken: {
29
+ hostType: hostDefine.hostTypes.order,
30
+ path: '/api/im/getAgoraToken'
31
+ }, // 获取声网视频Token
32
+ needMoreByExpert: {
33
+ hostType: hostDefine.hostTypes.order,
34
+ path: '/orderask/needMoreOrderByExpert'
35
+ }, // 专家回复追问,专家要求补充资料
36
+ refuseOrderByExpert: {
37
+ hostType: hostDefine.hostTypes.order,
38
+ path: '/orderask/refuseOrderByExpert'
39
+ }, // 拒绝
40
+ expertReply: {
41
+ hostType: hostDefine.hostTypes.order,
42
+ path: '/orderplan/reply_order'
43
+ },
44
+ orderList: {
45
+ hostType: hostDefine.hostTypes.order,
46
+ path: '/orderlist/doctor_order_task_list'
47
+ }, // 订单列表
48
+ orderFeedback: {
49
+ hostType: hostDefine.hostTypes.order,
50
+ path: '/manager/feedback/create'
51
+ }, // 订单评价
52
+ feedbackTagList: {
53
+ hostType: hostDefine.hostTypes.order,
54
+ path: '/manager/feedback/tagList'
55
+ }, // 订单评价tag列表
56
+ feedback: {
57
+ hostType: hostDefine.hostTypes.order,
58
+ path: '/manager/feedback/create'
59
+ }, // 评价
60
+ fileData: {
61
+ hostType: hostDefine.hostTypes.order,
62
+ path: '/patient/fileData'
63
+ }
64
+ }
65
+
66
+ function login(userName, password) {
67
+ var date = new Date()
68
+ var time = dateFormat.format(date, 'yyyyMMddhhmmss')
69
+ var newPwd = password;
70
+ var data = {
71
+ 'mail': userName,
72
+ 'password': newPwd,
73
+ 'role': 1,
74
+ 'timestamp': time
75
+ }
76
+ return httpUtils.post(apiPaths.login, null, data)
77
+ }
78
+
79
+ /**
80
+ * 获取医生信息
81
+ * @param {*} doctorId
82
+ */
83
+ function getDoctorInfo(doctorId) {
84
+ const params = {
85
+ doctor_id: doctorId
86
+ }
87
+ return httpUtils.get(apiPaths.getDoctor, params, null)
88
+ }
89
+
90
+ /**
91
+ * 获取视频房间号
92
+ * @param {*} orderId
93
+ */
94
+ function getRoomId(orderId) {
95
+ var params = {}
96
+ if (orderId) {
97
+ params['orderId'] = orderId
98
+ }
99
+ return httpUtils.post(apiPaths.getRoomId, params, null)
100
+ }
101
+
102
+ /**
103
+ * 订单详情
104
+ * @param {*} orderId 订单ID
105
+ */
106
+ function getOrderDetail(orderId) {
107
+ var params = {}
108
+ if (orderId) {
109
+ params['orderId'] = orderId
110
+ }
111
+ return httpUtils.get(apiPaths.getOrderDetail, params, null)
112
+ }
113
+
114
+ function getExpertInfo(expertId) {
115
+ var params = {}
116
+ if (expertId) {
117
+ params['expert_id'] = expertId
118
+ }
119
+ return httpUtils.post(apiPaths.getExpertInfo, params, null)
120
+ }
121
+
122
+ function getAgoraToken(orderId) {
123
+ var params = {}
124
+ if (orderId) {
125
+ params['orderId'] = orderId
126
+ }
127
+ return httpUtils.post(apiPaths.getAgoraToken, params, null)
128
+ }
129
+
130
+ function requestReply(type, params, body) {
131
+ var params = Object.assign({}, params || {})
132
+ var requestPath = apiPaths.needMoreByExpert
133
+ // refuse: 1,
134
+ // discuss: 2,
135
+ // eAddSupply: 3,
136
+ // reply: 4,
137
+ // setTime: 5,
138
+ // startVideo: 6,
139
+ // videoMore: 7,
140
+ // visitConfirm: 8,
141
+ // visitReject: 9
142
+ switch (type) {
143
+ case menuBuilder.ChatEventType.eAddSupply:
144
+ requestPath = apiPaths.needMoreByExpert
145
+ break
146
+ case menuBuilder.ChatEventType.refuse:
147
+ requestPath = apiPaths.refuseOrderByExpert
148
+ break
149
+ case menuBuilder.ChatEventType.reply:
150
+ requestPath = apiPaths.expertReply
151
+ break
152
+ }
153
+ return httpUtils.post(requestPath, params, body, null)
154
+ }
155
+
156
+ /**
157
+ * 订单列表
158
+ */
159
+ function orderList() {
160
+ var params = {}
161
+ return httpUtils.post(apiPaths.orderList, params, null)
162
+ }
163
+
164
+ /**
165
+ * 获取评价tag列表
166
+ * @param {*} role
167
+ */
168
+ function getOrderFeedbackTags(role) {
169
+ var params = {
170
+ 'role': role
171
+ }
172
+ return httpUtils.post(apiPaths.feedbackTagList, params, null)
173
+ }
174
+
175
+ function feedback(role, orderId, isGood, comments, tagIdList) {
176
+ var body = {
177
+ 'role': role,
178
+ orderId: orderId,
179
+ isGood: isGood,
180
+ comments: comments,
181
+ tagIdList: tagIdList
182
+ }
183
+ return httpUtils.post(apiPaths.feedback, null, body)
184
+ }
185
+
186
+ function fileData(orderId, patientId) {
187
+ var params = {
188
+ orderId: orderId,
189
+ patientId: patientId,
190
+ }
191
+ return httpUtils.get(apiPaths.fileData, params, null)
192
+ }
193
+
194
+ module.exports = {
195
+ login,
196
+ getRoomId,
197
+ getOrderDetail,
198
+ getExpertInfo,
199
+ getAgoraToken,
200
+ getDoctorInfo,
201
+ requestReply,
202
+ orderList,
203
+ getOrderFeedbackTags,
204
+ feedback,
205
+ fileData,
206
+ }
@@ -1 +1,42 @@
1
- const httpUtils=require("../utils/httpUtils"),cache=require("../public/cache-data"),hostDefine=require("../apis/api-host-define"),appConfig=require("../public/app-config"),logType={netLog:11,userControl:12,localChat:13,remoteChat:14},apiPaths={statLog:{hostType:hostDefine.hostTypes.log,path:"/",download:!0}};function sendLog(e){var t=cache.uuid(),o=cache.getSessionId(),i=cache.getLogId()||1,t={uuid:t,sdkProductId:appConfig.appID,version:appConfig.appVersion,t:(new Date).getTime(),session:o,orderId:e.orderId||"",id:""+i,type:1,content:e.content||""};return httpUtils.get(apiPaths.statLog,t,null)}module.exports={sendLog:sendLog,logType:logType};
1
+ const httpUtils = require('../utils/httpUtils');
2
+ const cache = require('../public/cache-data')
3
+ const hostDefine = require('../apis/api-host-define')
4
+ const appConfig = require('../public/app-config')
5
+
6
+ const logType = {
7
+ netLog: 11, // 联网打点日志
8
+ userControl: 12, // 用户点击
9
+ localChat: 13, // 用户自己进房出房类操作
10
+ remoteChat: 14, // 远端用户进房出房类操作
11
+ }
12
+
13
+ const apiPaths = {
14
+ statLog: {
15
+ hostType: hostDefine.hostTypes.log,
16
+ path: '/',
17
+ download: true
18
+ },
19
+ }
20
+
21
+ function sendLog(data) {
22
+ const uuid = cache.uuid()
23
+ const session = cache.getSessionId()
24
+ const id = cache.getLogId() || 1
25
+ const params = {
26
+ 'uuid': uuid,
27
+ 'sdkProductId': appConfig.appID,
28
+ 'version': appConfig.appVersion,
29
+ 't': new Date().getTime(),
30
+ 'session': session,
31
+ 'orderId': data.orderId || '',
32
+ 'id': `${id}`,
33
+ 'type': 1,
34
+ 'content': data.content || ''
35
+ }
36
+ return httpUtils.get(apiPaths.statLog, params, null)
37
+ }
38
+
39
+ module.exports = {
40
+ sendLog,
41
+ logType
42
+ }
@@ -1 +1,47 @@
1
- const httpUtils=require("../utils/httpUtils"),hostDefine=require("../apis/api-host-define"),apiPaths={sendMessage:{hostType:hostDefine.hostTypes.order,path:"/api/writeVideoRecord"}},logTypes={start:"start",end:"end",connect:"专家进房成功",refuse:"对方拒绝接听视频",send_call_success:"发送呼叫消息成功",send_call_failed:"发送呼叫消息失败",video_permission_fail:"获取音视频权限失败"};var orderId,that;function bindData(e){(that=this).orderId=e.orderId}function sendLog(e){e=_httpParams(e);return httpUtils.post(apiPaths.sendMessage,e,{})}function _httpParams(e){return{orderId:that.orderId,actionTime:Number.parseInt((new Date).getTime()/1e3),actionType:e,channelid:0}}module.exports={logTypes:logTypes,bindData:bindData,sendLog:sendLog};
1
+ const httpUtils = require('../utils/httpUtils');
2
+ const hostDefine = require('../apis/api-host-define')
3
+
4
+ const apiPaths = {
5
+ sendMessage: {
6
+ hostType: hostDefine.hostTypes.order,
7
+ path: '/api/writeVideoRecord'
8
+ },
9
+ }
10
+
11
+ const logTypes = {
12
+ start: "start", //双方都进入视频
13
+ end: "end", //结束视频
14
+ connect: "专家进房成功", //进房成功
15
+ refuse: "对方拒绝接听视频", //对方挂断
16
+ send_call_success: "发送呼叫消息成功",
17
+ send_call_failed: "发送呼叫消息失败",
18
+ video_permission_fail: "获取音视频权限失败"
19
+ }
20
+
21
+ var orderId
22
+ var that
23
+
24
+ function bindData(data) {
25
+ that = this
26
+ this.orderId = data.orderId
27
+ }
28
+
29
+ function sendLog(actionType) {
30
+ const params = _httpParams(actionType)
31
+ return httpUtils.post(apiPaths.sendMessage, params, {})
32
+ }
33
+
34
+ function _httpParams(actionType) {
35
+ return {
36
+ 'orderId': that.orderId,
37
+ 'actionTime': Number.parseInt(new Date().getTime() / 1000),
38
+ 'actionType': actionType,
39
+ 'channelid': 0
40
+ }
41
+ }
42
+
43
+ module.exports = {
44
+ logTypes,
45
+ bindData,
46
+ sendLog
47
+ }
@@ -1 +1,88 @@
1
- const httpUtils=require("../utils/httpUtils"),cache=require("../public/cache-data"),hostDefine=require("../apis/api-host-define"),apiPaths={sendMessage:{hostType:hostDefine.hostTypes.order,path:"/api/im/sendTRTCMsg"}},commands={CALL:"call",CANCEL:"cancel",ACCEPT:"ACCEPT",REJECT_wmp:"REJECT_wmp",REJECT:"REJECT",busy:"busy",INTERRUPT:"interrupt",SWITCH_TO_AUDIO:"SWITCH_TO_AUDIO",SWITCH_TO_VIDEO:"SWITCH_TO_VIDEO",SWITCH_TO_VIDEO_WMP:"SWITCH_TO_VIDEO_SYNC_wmp",SWITCH_TO_AUDIO_WMP:"SWITCH_TO_AUDIO_SYNC_wmp",SWITCH_TO_AUDIO_SYNC_agora:"SWITCH_TO_AUDIO_SYNC_agora",SWITCH_TO_VIDEO_SYNC_agora:"SWITCH_TO_VIDEO_SYNC_agora"};var toUUID,orderId,that;function bindData(e){(that=this).toUUID=e.toUUID,this.orderId=e.orderId}function sendCall(){return _sendMessage(commands.CALL)}function sendCancel(){return _sendMessage(commands.CANCEL)}function sendReject(){return _sendMessage(commands.REJECT_wmp)}function sendSwitch2Audio(e){return _sendMessage(e?commands.SWITCH_TO_AUDIO_SYNC_agora:commands.SWITCH_TO_AUDIO_WMP)}function sendSwitch2Video(e){return _sendMessage(e?commands.SWITCH_TO_VIDEO_SYNC_agora:commands.SWITCH_TO_VIDEO_WMP)}function _sendMessage(e){return httpUtils.post(apiPaths.sendMessage,_httpParams(),_body(e)).then(e=>{}).catch(e=>{})}function _body(e){return{uuid:cache.uuid(),orderId:that.orderId,command:e,source:"expert",random:(new Date).getTime(),doctorId:cache.doctorId()}}function _httpParams(){return{fromUuid:cache.uuid(),toUuid:that.toUUID}}module.exports={bindData:bindData,sendCall:sendCall,sendCancel:sendCancel,sendReject:sendReject,sendSwitch2Audio:sendSwitch2Audio,sendSwitch2Video:sendSwitch2Video};
1
+ const httpUtils = require('../utils/httpUtils');
2
+ const cache = require('../public/cache-data')
3
+ const hostDefine = require('../apis/api-host-define')
4
+
5
+ const apiPaths = {
6
+ sendMessage: {
7
+ hostType: hostDefine.hostTypes.order,
8
+ path: '/api/im/sendTRTCMsg'
9
+ },
10
+ }
11
+
12
+ const commands = {
13
+ CALL: "call",
14
+ CANCEL: "cancel",
15
+ ACCEPT: "ACCEPT",
16
+ REJECT_wmp: "REJECT_wmp",
17
+ REJECT: "REJECT",
18
+ busy: "busy",
19
+ INTERRUPT: "interrupt",
20
+ SWITCH_TO_AUDIO: "SWITCH_TO_AUDIO",
21
+ SWITCH_TO_VIDEO: "SWITCH_TO_VIDEO",
22
+ SWITCH_TO_VIDEO_WMP: "SWITCH_TO_VIDEO_SYNC_wmp",
23
+ SWITCH_TO_AUDIO_WMP: "SWITCH_TO_AUDIO_SYNC_wmp",
24
+ SWITCH_TO_AUDIO_SYNC_agora: "SWITCH_TO_AUDIO_SYNC_agora",
25
+ SWITCH_TO_VIDEO_SYNC_agora: "SWITCH_TO_VIDEO_SYNC_agora"
26
+ }
27
+
28
+ var toUUID
29
+ var orderId
30
+ var that
31
+
32
+ function bindData(data) {
33
+ that = this
34
+ this.toUUID = data.toUUID
35
+ this.orderId = data.orderId
36
+ }
37
+
38
+ function sendCall() {
39
+ return _sendMessage(commands.CALL)
40
+ }
41
+
42
+ function sendCancel() {
43
+ return _sendMessage(commands.CANCEL)
44
+ }
45
+
46
+ function sendReject() {
47
+ return _sendMessage(commands.REJECT_wmp)
48
+ }
49
+
50
+ function sendSwitch2Audio(fromAgroa) {
51
+ return _sendMessage(fromAgroa ? commands.SWITCH_TO_AUDIO_SYNC_agora : commands.SWITCH_TO_AUDIO_WMP)
52
+ }
53
+
54
+ function sendSwitch2Video(fromAgroa) {
55
+ return _sendMessage(fromAgroa ? commands.SWITCH_TO_VIDEO_SYNC_agora : commands.SWITCH_TO_VIDEO_WMP)
56
+ }
57
+
58
+ function _sendMessage(command) {
59
+ return httpUtils.post(apiPaths.sendMessage, _httpParams(), _body(command))
60
+ .then((res) => {}).catch((e) => {})
61
+ }
62
+
63
+ function _body(command) {
64
+ return {
65
+ 'uuid': cache.uuid(),
66
+ 'orderId': that.orderId,
67
+ 'command': command,
68
+ 'source': 'expert',
69
+ 'random': new Date().getTime(),
70
+ 'doctorId': cache.doctorId()
71
+ }
72
+ }
73
+
74
+ function _httpParams() {
75
+ return {
76
+ 'fromUuid': cache.uuid(),
77
+ 'toUuid': that.toUUID
78
+ }
79
+ }
80
+
81
+ module.exports = {
82
+ bindData,
83
+ sendCall,
84
+ sendCancel,
85
+ sendReject,
86
+ sendSwitch2Audio,
87
+ sendSwitch2Video
88
+ }
@@ -1 +1,29 @@
1
- module.exports=Behavior({properties:{index:{type:Number,value:0},id:{type:Number,value:0},createtime:{type:String,value:null},photo:{type:String,value:null},name:{type:String,value:null},isSend:{type:Boolean,value:!1}}});
1
+ module.exports = Behavior({
2
+
3
+ properties: {
4
+ index: {
5
+ type: Number,
6
+ value: 0
7
+ },
8
+ id: {
9
+ type: Number,
10
+ value: 0
11
+ },
12
+ createtime: {
13
+ type: String,
14
+ value: null
15
+ },
16
+ photo: {
17
+ type: String,
18
+ value: null
19
+ },
20
+ name: {
21
+ type: String,
22
+ value: null
23
+ },
24
+ isSend: {
25
+ type: Boolean,
26
+ value: false
27
+ }
28
+ }
29
+ })
@@ -1 +1,60 @@
1
- const cache=require("../../../public/cache-data");module.exports=Behavior({behaviors:[require("../../../public/behaviors/order-base-behaviors"),require("./consultation-header-text-behaviors"),require("./consultation-header-media-behaviors"),require("./consultation-chat-behaviors")],data:{doctorInfo:"",headerTexts:[],mediaInfo:[],dicoms:[]},lifetimes:{ready:function(){}},methods:{loadOrderInfo(){this.setData({doctorInfo:"",headerTexts:[],mediaInfo:[],mediaFiles:[],dicoms:[],messageDatas:[],messages:[],messageMediaFiles:[],scrollTo:null,showPreview:!1}),this.loadOrder(()=>{this.selectComponent("#chat-bottom").initMenuData(),this.buildOrderInfo(),this.loadDicom()})},isRequest(){return cache.doctorId()==this.data.order.doctorid},buildOrderInfo(){this.buildHeadTextInfo(),this.buildMediaFiles(),this.buildDoctorInfo(),this.buildMessages()}}});
1
+ const cache = require('../../../public/cache-data')
2
+
3
+ module.exports = Behavior({
4
+
5
+ behaviors: [
6
+ require('../../../public/behaviors/order-base-behaviors'),
7
+ require('./consultation-header-text-behaviors'),
8
+ require('./consultation-header-media-behaviors'),
9
+ require('./consultation-chat-behaviors')
10
+ ],
11
+
12
+ data: {
13
+ doctorInfo: '',
14
+ headerTexts: [], // 头部文字部分
15
+ mediaInfo: [], // 头部媒体数据部分
16
+ dicoms: [], // DICOM数据
17
+ },
18
+
19
+ lifetimes: {
20
+ ready: function () {
21
+
22
+ }
23
+ },
24
+
25
+ methods: {
26
+ loadOrderInfo() {
27
+ this.setData({
28
+ doctorInfo: '',
29
+ headerTexts: [], // 头部文字部分
30
+ mediaInfo: [], // 头部媒体数据部分
31
+ mediaFiles: [], // 图片和视频
32
+ dicoms: [], // DICOM数据
33
+ messageDatas: [], // 原始信息流数据
34
+ messages: [], // 构建信息流数据
35
+ messageMediaFiles: [], // 图片和视频数据
36
+ scrollTo: null,
37
+ showPreview: false,
38
+ })
39
+ this.loadOrder(() => {
40
+ this.selectComponent('#chat-bottom').initMenuData()
41
+ this.buildOrderInfo()
42
+ this.loadDicom()
43
+ })
44
+ },
45
+
46
+ isRequest() {
47
+ return cache.doctorId() == this.data.order.doctorid
48
+ },
49
+
50
+ /**
51
+ * 组织订单头部订单显示数据
52
+ */
53
+ buildOrderInfo() {
54
+ this.buildHeadTextInfo() // 组织头部文字部分数据
55
+ this.buildMediaFiles() // 图片、视频或其他
56
+ this.buildDoctorInfo() // 头部医生信息
57
+ this.buildMessages() // 信息流消息
58
+ },
59
+ },
60
+ })