hh-doctor-sdk 0.6.5 → 0.6.7

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 (63) hide show
  1. package/components/apis/api-host-define.js +18 -2
  2. package/components/apis/health-api.js +28 -0
  3. package/components/apis/order-app-api.js +2 -1
  4. package/components/consultation/list/behaviors/consultation-list-base-behaviors.js +3 -3
  5. package/components/consultation/list/consultation-list-page.js +22 -18
  6. package/components/consultation/list/consultation-list-page.wxml +5 -2
  7. package/components/consultation/list/consultation-list-page.wxss +15 -2
  8. package/components/hh-navigation.js +5 -18
  9. package/components/public/user-cache-data.js +4 -3
  10. package/components/utils/dateUtils.js +21 -21
  11. package/components/utils/httpUtils.js +7 -8
  12. package/package.json +4 -2
  13. package/.vscode/settings.json +0 -1
  14. package/components/apis/ai-expert-api.js +0 -29
  15. package/components/expert-ai-order/ai-doctor-page.js +0 -438
  16. package/components/expert-ai-order/ai-doctor-page.json +0 -10
  17. package/components/expert-ai-order/ai-doctor-page.wxml +0 -65
  18. package/components/expert-ai-order/ai-doctor-page.wxss +0 -332
  19. package/components/expert-ai-order/components/ai-card-consultation-create/ai-card-consultation-create.js +0 -24
  20. package/components/expert-ai-order/components/ai-card-consultation-create/ai-card-consultation-create.wxml +0 -30
  21. package/components/expert-ai-order/components/ai-card-consultation-create/ai-card-consultation-create.wxss +0 -73
  22. package/components/expert-ai-order/components/ai-card-consultation-info/ai-card-consultation-info.js +0 -70
  23. package/components/expert-ai-order/components/ai-card-consultation-info/ai-card-consultation-info.json +0 -7
  24. package/components/expert-ai-order/components/ai-card-consultation-info/ai-card-consultation-info.wxml +0 -17
  25. package/components/expert-ai-order/components/ai-card-consultation-info/ai-card-consultation-info.wxss +0 -71
  26. package/components/expert-ai-order/components/ai-card-expert-info/ai-card-expert-info.js +0 -24
  27. package/components/expert-ai-order/components/ai-card-expert-info/ai-card-expert-info.json +0 -4
  28. package/components/expert-ai-order/components/ai-card-expert-info/ai-card-expert-info.wxml +0 -6
  29. package/components/expert-ai-order/components/ai-card-expert-info/ai-card-expert-info.wxss +0 -27
  30. package/components/expert-ai-order/components/ai-card-image/ai-card-image.js +0 -27
  31. package/components/expert-ai-order/components/ai-card-image/ai-card-image.json +0 -4
  32. package/components/expert-ai-order/components/ai-card-image/ai-card-image.wxml +0 -6
  33. package/components/expert-ai-order/components/ai-card-image/ai-card-image.wxss +0 -28
  34. package/components/expert-ai-order/components/ai-card-step/ai-card-step.js +0 -27
  35. package/components/expert-ai-order/components/ai-card-step/ai-card-step.json +0 -4
  36. package/components/expert-ai-order/components/ai-card-step/ai-card-step.wxml +0 -9
  37. package/components/expert-ai-order/components/ai-card-step/ai-card-step.wxss +0 -58
  38. package/components/expert-ai-order/components/ai-card-text/ai-card-text.js +0 -30
  39. package/components/expert-ai-order/components/ai-card-text/ai-card-text.json +0 -4
  40. package/components/expert-ai-order/components/ai-card-text/ai-card-text.wxml +0 -6
  41. package/components/expert-ai-order/components/ai-card-text/ai-card-text.wxss +0 -36
  42. package/components/expert-ai-order/components/ai-card-tip-text/ai-card-tip-text.js +0 -24
  43. package/components/expert-ai-order/components/ai-card-tip-text/ai-card-tip-text.json +0 -4
  44. package/components/expert-ai-order/components/ai-card-tip-text/ai-card-tip-text.wxml +0 -3
  45. package/components/expert-ai-order/components/ai-card-tip-text/ai-card-tip-text.wxss +0 -8
  46. package/components/expert-ai-order/components/expert-list-item/expert-list-item.js +0 -43
  47. package/components/expert-ai-order/components/expert-list-item/expert-list-item.json +0 -4
  48. package/components/expert-ai-order/components/expert-list-item/expert-list-item.wxml +0 -25
  49. package/components/expert-ai-order/components/expert-list-item/expert-list-item.wxss +0 -112
  50. package/components/expert-ai-order/constants/expert-ai-consultation-card-type.js +0 -4
  51. package/components/expert-ai-order/select-expert-page.js +0 -133
  52. package/components/expert-ai-order/select-expert-page.json +0 -11
  53. package/components/expert-ai-order/select-expert-page.wxml +0 -20
  54. package/components/expert-ai-order/select-expert-page.wxss +0 -28
  55. package/components/uikit/custom-pulldown-refresh/custom-pulldown-refresh.js +0 -358
  56. package/components/uikit/custom-pulldown-refresh/custom-pulldown-refresh.json +0 -4
  57. package/components/uikit/custom-pulldown-refresh/custom-pulldown-refresh.wxml +0 -50
  58. package/components/uikit/custom-pulldown-refresh/custom-pulldown-refresh.wxss +0 -173
  59. package/components/uikit/tabbar-content-view/tabbar-content-view.json +0 -4
  60. /package/components/uikit/{tabbar-content-view/tabbar-content-view.js → tab-bar-content-view/tab-bar-content-view.js} +0 -0
  61. /package/components/{expert-ai-order/components/ai-card-consultation-create/ai-card-consultation-create.json → uikit/tab-bar-content-view/tab-bar-content-view.json} +0 -0
  62. /package/components/uikit/{tabbar-content-view/tabbar-content-view.wxml → tab-bar-content-view/tab-bar-content-view.wxml} +0 -0
  63. /package/components/uikit/{tabbar-content-view/tabbar-content-view.wxss → tab-bar-content-view/tab-bar-content-view.wxss} +0 -0
@@ -5,6 +5,7 @@ const hostTypes = {
5
5
  family: 'family', // host family app
6
6
  dicom: 'dicom', // host dicom
7
7
  log: 'log', // host log
8
+ health: 'health', // host health app,
8
9
  }
9
10
 
10
11
  const testHost = 'https://test.hh-medic.com/orderapp'
@@ -19,6 +20,12 @@ const dicomProd = 'https://dicom.hh-medic.com'
19
20
  const statLogTest = 'https://test.hh-medic.com/wmp-log'
20
21
  const statLogProd = 'https://wmp.hh-medic.com/wmp-log'
21
22
 
23
+ const healthTest = 'https://mhealth-test.hh-medic.com/familyplatformdisease'
24
+ const healthProd = 'https://mhealth.hh-medic.com/familyplatformdisease'
25
+
26
+ const wmpTest = 'https://test.hh-medic.com/wmp'
27
+ const wmpProd = 'https://wmp.hh-medic.com/wmp'
28
+
22
29
 
23
30
  function _requestHost() {
24
31
  if (cache.isTest()) {
@@ -27,7 +34,7 @@ function _requestHost() {
27
34
  return prodHost
28
35
  }
29
36
 
30
- function _familytHost() {
37
+ function _familyHost() {
31
38
  if (cache.isTest()) {
32
39
  return familyTest
33
40
  }
@@ -48,16 +55,25 @@ function _statHost() {
48
55
  return statLogProd
49
56
  }
50
57
 
58
+ function _healthHost() {
59
+ if (cache.isTest()) {
60
+ return healthTest
61
+ }
62
+ return healthProd
63
+ }
64
+
51
65
  function host(type) {
52
66
  switch (type) {
53
67
  case hostTypes.order:
54
68
  return _requestHost()
55
69
  case hostTypes.family:
56
- return _familytHost()
70
+ return _familyHost()
57
71
  case hostTypes.dicom:
58
72
  return _dicomHost()
59
73
  case hostTypes.log:
60
74
  return _statHost()
75
+ case hostTypes.health:
76
+ return _healthHost()
61
77
  default:
62
78
  return _requestHost()
63
79
  }
@@ -0,0 +1,28 @@
1
+ const httpUtils = require('../utils/httpUtils');
2
+ const hostDefine = require('../apis/api-host-define');
3
+ const userCacheData = require('../public/user-cache-data');
4
+ const apiPaths = {
5
+ getOrderList: {
6
+ hostType: hostDefine.hostTypes.health,
7
+ path: '/provider/checkSumApi/order/list'
8
+ }
9
+ }
10
+
11
+ const PAGE_SIZE = 10
12
+
13
+
14
+ function getOrderList(pageNo) {
15
+ const userToken = userCacheData.getUserToken();
16
+ const params = {
17
+ pageNo,
18
+ realUserToken: userToken,
19
+ orderCategory: 'expert',
20
+ pageSize: PAGE_SIZE,
21
+ }
22
+ return httpUtils.get(apiPaths.getOrderList, params, {});
23
+ }
24
+
25
+ module.exports = {
26
+ getOrderList,
27
+ PAGE_SIZE
28
+ }
@@ -2,7 +2,8 @@ const httpUtils = require('../utils/httpUtils');
2
2
  // const sha1 = require('../utils/checksumUtils');
3
3
  const dateFormat = require('../utils/dateUtils')
4
4
  const hostDefine = require('./api-host-define')
5
- const menuBuilder = require('../consultation/detail/widget/chat-bottom/chat-menu-builder')
5
+ const menuBuilder = require('../consultation/detail/widget/chat-bottom/chat-menu-builder');
6
+ const cacheData = require('../public/cache-data');
6
7
 
7
8
  const apiPaths = {
8
9
  login: {
@@ -51,7 +51,7 @@ module.exports = Behavior({
51
51
  _buildOrderGroupInfo(orderModel) {
52
52
  // console.error(JSON.stringify(orderModel))
53
53
  if (orderModel) {
54
- var orderGroups = []
54
+ let orderGroups = []
55
55
  // if (orderModel.requestOrderList && orderModel.requestOrderList.length > 0) {
56
56
  // orderGroups.push(this._buildGroup(true, '我的咨询', orderModel.requestOrderList))
57
57
  // }
@@ -67,7 +67,7 @@ module.exports = Behavior({
67
67
  },
68
68
 
69
69
  _buildGroup(isRequest, title, orderList) {
70
- var list = []
70
+ let list = []
71
71
  orderList.forEach((element, index, _) => {
72
72
  list.push(this._buildOrderItem(isRequest, element, index != orderList.length - 1))
73
73
  });
@@ -156,7 +156,7 @@ module.exports = Behavior({
156
156
  },
157
157
 
158
158
  clickOrderItem: function (event) {
159
- var orderId = event.currentTarget.dataset.orderid
159
+ let orderId = event.currentTarget.dataset.orderid
160
160
  hhNavigation.orderDetail(orderId.trim(), cache.doctorId(), cache.isTest())
161
161
  },
162
162
  }
@@ -10,7 +10,8 @@ Page({
10
10
  * 页面的初始数据
11
11
  */
12
12
  data: {
13
- init: false
13
+ init: false,
14
+ isLogin: false
14
15
  },
15
16
 
16
17
  /**
@@ -76,24 +77,27 @@ Page({
76
77
  })
77
78
  }
78
79
  } else {
79
- wx.showModal({
80
- showCancel: true,
81
- cancelText: '取消',
82
- confirmText: '去登录',
83
- confirmColor: "#0066ff",
84
- content: "您还未登录,是否去登录?",
85
- complete: (res) => {
86
- if (wx.loginConfig && wx.loginConfig.judgeLogin) {
87
- if (res.cancel) {
88
- wx.loginConfig.directLogin(false)
89
- }
90
- if (res.confirm) {
91
- wx.loginConfig.directLogin(true)
92
- }
93
- }
94
-
95
- }
80
+ this.setData({
81
+ isLogin: true
96
82
  })
83
+ // wx.showModal({
84
+ // showCancel: true,
85
+ // cancelText: '取消',
86
+ // confirmText: '去登录',
87
+ // confirmColor: "#0066ff",
88
+ // content: "您还未登录,是否去登录?",
89
+ // complete: (res) => {
90
+ // if (wx.loginConfig && wx.loginConfig.judgeLogin) {
91
+ // if (res.cancel) {
92
+ // wx.loginConfig.directLogin(false)
93
+ // }
94
+ // if (res.confirm) {
95
+ // wx.loginConfig.directLogin(true)
96
+ // }
97
+ // }
98
+
99
+ // }
100
+ // })
97
101
  }
98
102
  },
99
103
 
@@ -48,9 +48,12 @@
48
48
  </view>
49
49
  </block>
50
50
  </view>
51
- <view wx:if="{{showEmpty}}" class="empty-body">
52
- <image
51
+ <view wx:elif="{{showEmpty || !isLogin}}" class="empty-body">
52
+ <image class="empty-body-image"
53
53
  src="https://image.hh-medic.com/icon/pacs/hh_icon_no_order_data.png"
54
54
  />
55
+ <view class="empty-body-text">
56
+ {{isLogin ? '' : '登录后才可以查看'}}
57
+ </view>
55
58
  </view>
56
59
  </view>
@@ -124,8 +124,21 @@ page {
124
124
  }
125
125
 
126
126
  .empty-body {
127
- height: 100vh;
127
+ width: 100%;
128
+ height: 100%;
128
129
  font-size: 30rpx;
129
130
  text-align: center;
130
- line-height: 100vh;
131
+ align-items: center;
132
+ justify-content: center;
133
+ display: flex;
134
+ flex-direction: column;
131
135
  }
136
+
137
+ .empty-body-image {
138
+ margin-bottom: 20rpx;
139
+ }
140
+
141
+ .empty-body-text {
142
+ color: #999999;
143
+ font-size: 30rpx;
144
+ }
@@ -1,3 +1,6 @@
1
+ const { appID, appVersion } = require('./public/app-config')
2
+ const cache = require('./public/cache-data')
3
+
1
4
  const pages = {
2
5
  orderList: 'consultation/list/consultation-list-page',
3
6
  orderDetail: 'consultation/detail/consultation-detail-page',
@@ -7,9 +10,7 @@ const pages = {
7
10
  videoChat: 'video-chat-page/video-chat-page',
8
11
  pathology: 'pathology/pathology-page',
9
12
  copyUrl: 'copy-url-page/copy-url-page',
10
- mediaPreview: 'uikit/media-preview-page/media-preview-page',
11
- selectExpert: 'expert-ai-order/select-expert-page',
12
- aiExpert: 'expert-ai-order/ai-doctor-page'
13
+ mediaPreview: 'uikit/media-preview-page/media-preview-page'
13
14
  }
14
15
 
15
16
 
@@ -115,18 +116,6 @@ function mediaPreview(urls, index = 0) {
115
116
  navigateTo(pages.mediaPreview, params)
116
117
  }
117
118
 
118
- function selectExpert(userToken) {
119
- navigateTo(pages.selectExpert, {
120
- userToken
121
- })
122
- }
123
-
124
- function aiExpert(expert) {
125
- navigateTo(pages.aiExpert, {
126
- expert
127
- })
128
- }
129
-
130
119
  module.exports = {
131
120
  navigateTo,
132
121
  orderList,
@@ -137,7 +126,5 @@ module.exports = {
137
126
  videoChat,
138
127
  pathology,
139
128
  copyUrl,
140
- mediaPreview,
141
- selectExpert,
142
- aiExpert
129
+ mediaPreview
143
130
  }
@@ -1,11 +1,11 @@
1
1
  function cacheUser(data) {
2
- var userInfo = wx.cacheUserInfo || {}
2
+ const userInfo = wx.cacheUserInfo || {}
3
3
  const newData = Object.assign(userInfo, data)
4
4
  wx.cacheUserInfo = newData
5
5
  }
6
6
 
7
7
  function getValue(key) {
8
- var userInfo = wx.cacheUserInfo || {}
8
+ const userInfo = wx.cacheUserInfo || {}
9
9
  if (!key) {
10
10
  return null
11
11
  }
@@ -24,7 +24,8 @@ function getVideoToken() {
24
24
  return getValue('videoToken')
25
25
  }
26
26
 
27
- export default {
27
+
28
+ module.exports = {
28
29
  cacheUser,
29
30
  getUuid,
30
31
  getUserToken,
@@ -1,7 +1,7 @@
1
1
  function getHommizationTime(time) {
2
2
  //var d = new Date(time);
3
3
  if (!time) return '';
4
- var timeText = getTimeRegion(time) + ' ' + getHourMinute(time);
4
+ let timeText = getTimeRegion(time) + ' ' + getHourMinute(time);
5
5
 
6
6
  if (isToday(time)) {
7
7
 
@@ -14,19 +14,19 @@ function getHommizationTime(time) {
14
14
  }
15
15
 
16
16
  function isToday(time) {
17
- var d = getDayStart();
17
+ let d = getDayStart();
18
18
  return time >= d;
19
19
  }
20
20
 
21
21
  function isYestoday(time) {
22
- var d = getDayStart();
23
- var y = getDayStart() - 24 * 3600 * 1000;
22
+ let d = getDayStart();
23
+ let y = getDayStart() - 24 * 3600 * 1000;
24
24
  return time >= y && time < d;
25
25
  }
26
26
 
27
27
  function getTimeRegion(time) {
28
- var date = new Date(time);
29
- var hour = date.getHours();
28
+ let date = new Date(time);
29
+ let hour = date.getHours();
30
30
  if (hour < 6) {
31
31
  return '凌晨';
32
32
  } else if (hour >= 6 && hour < 11) {
@@ -41,9 +41,9 @@ function getTimeRegion(time) {
41
41
  }
42
42
 
43
43
  function getHourMinute(time) {
44
- var date = new Date(time);
45
- var hour = date.getHours();
46
- var minute = date.getMinutes();
44
+ let date = new Date(time);
45
+ let hour = date.getHours();
46
+ let minute = date.getMinutes();
47
47
  if (hour >= 13) {
48
48
  hour -= 12;
49
49
  }
@@ -51,10 +51,10 @@ function getHourMinute(time) {
51
51
  }
52
52
 
53
53
  function getYearMonthDate(time) {
54
- var date = new Date(time);
55
- var year = date.getFullYear();
56
- var month = date.getMonth() + 1;
57
- var day = date.getDate();
54
+ let date = new Date(time);
55
+ let year = date.getFullYear();
56
+ let month = date.getMonth() + 1;
57
+ let day = date.getDate();
58
58
  return year + '-' + month + '-' + day;
59
59
  }
60
60
 
@@ -62,10 +62,10 @@ function getDayStart(date) {
62
62
  if (!date) {
63
63
  date = new Date();
64
64
  }
65
- var year = date.getFullYear();
66
- var month = date.getMonth();
67
- var day = date.getDate();
68
- var start = new Date(year, month, day, 0, 0, 0);
65
+ let year = date.getFullYear();
66
+ let month = date.getMonth();
67
+ let day = date.getDate();
68
+ let start = new Date(year, month, day, 0, 0, 0);
69
69
  return start.getTime();
70
70
  };
71
71
 
@@ -79,9 +79,9 @@ function formatNumber(n) {
79
79
  * @param {*} s 秒数
80
80
  */
81
81
  function formatTimeLength(s) {
82
- var h = parseInt(s / 3600);
83
- var m1 = s % 3600;
84
- var m = parseInt(m1 / 60);
82
+ let h = parseInt(s / 3600);
83
+ let m1 = s % 3600;
84
+ let m = parseInt(m1 / 60);
85
85
  s = m1 % 60;
86
86
  if (h > 0) {
87
87
  return formatNumber(h) + ':' + formatNumber(m) + ':' + formatNumber(s);
@@ -91,7 +91,7 @@ function formatTimeLength(s) {
91
91
  };
92
92
 
93
93
  function format(d, fmt) {
94
- var o = {
94
+ let o = {
95
95
  "M+": d.getMonth() + 1, //月份
96
96
  "d+": d.getDate(), //日
97
97
  "h+": d.getHours(), //小时
@@ -27,12 +27,12 @@ function httpGet(request, params, data) {
27
27
 
28
28
  function _request(request, method, params, data) {
29
29
  return new Promise((resolve, reject) => {
30
- var host = hostDefine.host(request.hostType)
31
- var url = `${host}${request.path}`
30
+ let host = hostDefine.host(request.hostType)
31
+ let url = `${host}${request.path}`
32
32
  const doctorId = cache.doctorId()
33
33
  const uuid = cache.uuid()
34
34
 
35
- var fullParams = Object.assign({}, params || {})
35
+ let fullParams = { ...params || {}}
36
36
  fullParams.sdkProductId = appConfig.appID
37
37
  fullParams.pid = appConfig.appID
38
38
  fullParams.app_version = appConfig.appVersion
@@ -53,15 +53,14 @@ function _request(request, method, params, data) {
53
53
  url = `${url}${url.includes('?') ? '&' : '?'}${key}=${encodeURIComponent(value)}`
54
54
  }
55
55
  }
56
- var timestamp = new Date().getTime()
57
- var nonce = timestamp.toString()
58
- var curTime = Number.parseInt(timestamp / 1000)
59
- var checkSum = sha1.sha1(appConfig.appSecret + nonce + curTime)
56
+ let timestamp = new Date().getTime()
57
+ let nonce = timestamp.toString()
58
+ let curTime = Number.parseInt(timestamp / 1000)
59
+ let checkSum = sha1.sha1(appConfig.appSecret + nonce + curTime)
60
60
 
61
61
  const header = {
62
62
  'Accept': 'application/json',
63
63
  'content-type': 'application/json',
64
- // 'cookie': cookie,
65
64
  'APPTYPE': 'pc',
66
65
  'AppKey': appConfig.appKey,
67
66
  'Nonce': nonce,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-doctor-sdk",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "和缓名医小程序SDK",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -10,5 +10,7 @@
10
10
  ],
11
11
  "author": "liumingming",
12
12
  "license": "ISC",
13
- "miniprogram": "components"
13
+ "miniprogram": "components",
14
+ "dependencies": {
15
+ }
14
16
  }
@@ -1 +0,0 @@
1
- {"editor.bracketPairColorization.enabled": true, "editor.guides.bracketPairs": "active"}
@@ -1,29 +0,0 @@
1
- import appConfig from '../public/app-config';
2
- import cache from '../public/cache-data'
3
- const getSoundWSUrl = 'commonai2/ws/voice/ars/stream'
4
-
5
- function getSoundWsUrl(query) {
6
- const queryString = transQueryData(query);
7
- const isTest = getApp().globalData.profileName == 'test'
8
- return `wss://mhealth${ isTest ? '-test' : '' }.hh-medic.com/${ getSoundWSUrl }?${ queryString }`
9
- }
10
-
11
- function transQueryData(query) {
12
- const userToken = cache.userToken()
13
- let params = {
14
- sdkProductId: appConfig.appID,
15
- userToken: userToken,
16
- memberUserToken: userToken,
17
- app_version: appConfig.appVersion,
18
- actionSource: 'wxdoctor',
19
- wxAppId: appConfig.appID,
20
- timestamp: new Date().getTime(),
21
- ...(query || {}),
22
- }
23
- return Object.keys(params).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join("&")
24
- }
25
-
26
- export default {
27
- getSoundWsUrl,
28
- transQueryData
29
- }