hh-doctor-sdk 0.3.8 → 0.3.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.
@@ -68,6 +68,10 @@ const apiPaths = {
68
68
  fileData: {
69
69
  hostType: hostDefine.hostTypes.order,
70
70
  path: '/patient/fileData'
71
+ },
72
+ endConsultation: {
73
+ hostType: hostDefine.hostTypes.order,
74
+ path: '/orderask/update_ask_order_status'
71
75
  }
72
76
  }
73
77
 
@@ -205,6 +209,13 @@ function fileData(orderId, patientId) {
205
209
  return httpUtils.get(apiPaths.fileData, params, null)
206
210
  }
207
211
 
212
+ function endConsultation(orderId) {
213
+ var params = {
214
+ orderId: orderId,
215
+ }
216
+ return httpUtils.post(apiPaths.endConsultation, params, null)
217
+ }
218
+
208
219
  module.exports = {
209
220
  login,
210
221
  getRoomId,
@@ -217,4 +228,5 @@ module.exports = {
217
228
  getOrderFeedbackTags,
218
229
  feedback,
219
230
  fileData,
231
+ endConsultation,
220
232
  }
@@ -4,6 +4,8 @@ const pdfViewer = require('../../../public/pdf-viewer')
4
4
  const caseImageFilter = require('../widget/case-image-filter')
5
5
  const commonUtils = require('../../../utils/common-utils')
6
6
  const dateTimePicker = require('../../../uikit/date-time-picker/date-time-picker')
7
+ const deviceUtils = require('../../../utils/device-utils')
8
+ const hhNavigation = require('../../../hh-navigation')
7
9
 
8
10
  const MessageTypes = {
9
11
  text: 0,
@@ -289,13 +291,12 @@ module.exports = Behavior({
289
291
  const find = this.data.messageMediaFiles.findIndex((value, index, array) => {
290
292
  return value.url == imageurl
291
293
  })
292
- if (find >= 0) {
293
- wx.previewMedia({
294
- current: find,
295
- sources: this.data.messageMediaFiles,
296
- })
294
+
295
+ if (deviceUtils.isPC()) {
296
+ hhNavigation.mediaPreview(this.data.messageMediaFiles, find)
297
297
  } else {
298
298
  wx.previewMedia({
299
+ current: find >= 0 ? find : 0,
299
300
  sources: this.data.messageMediaFiles,
300
301
  })
301
302
  }
@@ -76,6 +76,7 @@
76
76
  order="{{order}}"
77
77
  bind:changeDateTime="changeDateTimeControl"
78
78
  bind:changeDateTimeColumn="changeDateTimeColumnControl"
79
+ bind:refreshData="_refreshOrder"
79
80
  dateTimeArray="{{dateTimeArray}}"
80
81
  dateTime="{{dateTime}}"
81
82
  ></chat-bottom>
@@ -2,6 +2,7 @@ const menuBuilder = require('./chat-menu-builder')
2
2
  const cache = require('../../../../public/cache-data')
3
3
  const hhNavigation = require('../../../../hh-navigation')
4
4
  const permission = require('../../../../utils/permission-utils')
5
+ const orderApi = require('../../../../apis/order-app-api')
5
6
 
6
7
  Component({
7
8
 
@@ -19,16 +20,8 @@ Component({
19
20
  },
20
21
 
21
22
  lifetimes: {
22
- // ready: function () {
23
- // this.initMenuData()
24
- // },
25
- },
26
23
 
27
- // pageLifetimes: {
28
- // show: function () {
29
- // this.initMenuData()
30
- // }
31
- // },
24
+ },
32
25
 
33
26
  /**
34
27
  * 组件的初始数据
@@ -70,6 +63,9 @@ Component({
70
63
  case menuBuilder.ChatEventType.doctorAsk:
71
64
  this._forwart2Reply(menuBuilder.ChatEventType.doctorAsk)
72
65
  break
66
+ case menuBuilder.ChatEventType.endConsultation:
67
+ this._endConsultation()
68
+ break
73
69
  }
74
70
  },
75
71
 
@@ -84,6 +80,42 @@ Component({
84
80
  }
85
81
  },
86
82
 
83
+ _endConsultation() {
84
+ wx.showModal({
85
+ title: '提示',
86
+ content: '关闭咨询后,申请医生将无法继续就本咨询询问,你确定要关闭咨询么?',
87
+ complete: (res) => {
88
+ if (res.cancel) {
89
+
90
+ }
91
+ if (res.confirm) {
92
+ wx.showLoading({
93
+ title: '',
94
+ })
95
+ const order = this.properties.order
96
+ orderApi.endConsultation(order.orderid).then((res) => {
97
+ wx.hideLoading()
98
+ if (res.status == 200 && res.data) {
99
+ this.triggerEvent('refreshData')
100
+ wx.showToast({
101
+ title: '关闭成功',
102
+ })
103
+ } else {
104
+ wx.showToast({
105
+ title: '关闭失败,稍后重试',
106
+ })
107
+ }
108
+ }).catch((err) => {
109
+ wx.hideLoading()
110
+ wx.showToast({
111
+ title: '关闭失败,稍后重试',
112
+ })
113
+ })
114
+ }
115
+ }
116
+ })
117
+ },
118
+
87
119
  /**
88
120
  * 时间选择器点击确定回调方法
89
121
  * @param {*} e 事件回调参数
@@ -22,10 +22,10 @@ const ChatEventType = {
22
22
  videoMore: 'videoMore',
23
23
  visitConfirm: 'visitConfirm',
24
24
  visitReject: 'visitReject',
25
-
26
25
  cancel: 'cancel',
27
26
  doctorAsk: 'doctorAsk',
28
- dAddSupply: 'dAddSupply'
27
+ dAddSupply: 'dAddSupply',
28
+ endConsultation: 'endConsultation'
29
29
  }
30
30
 
31
31
  function orderMenus(order) {
@@ -66,6 +66,9 @@ function _videoMenus(order) {
66
66
  if (isSetTime) {
67
67
  menus.push(_menu(ChatEventType.startVideo, '发起视频'))
68
68
  menus.push(_menu(ChatEventType.reply, '回复意见', 1))
69
+ if (order.serviceGroupName != 'MDT' && (order.orderMessage.askButton || false)) {
70
+ menus.push(_menu(ChatEventType.endConsultation, "结束咨询"))
71
+ }
69
72
  } else {
70
73
  menus.push(_menu(ChatEventType.refuse, '拒绝'))
71
74
  menus.push(_menu(ChatEventType.reply, '回复意见', 1))
@@ -94,6 +97,9 @@ function _feidaoMenus(order) {
94
97
  menus.push(_menu(ChatEventType.visitConfirm, '可行手术'))
95
98
  menus.push(_menu(ChatEventType.visitReject, '无法手术', 1))
96
99
  menus.push(_menu(ChatEventType.reply, '回复意见', 1))
100
+ if (order.serviceGroupName != 'MDT' && (order.orderMessage.askButton || false)) {
101
+ menus.push(_menu(ChatEventType.endConsultation, "结束咨询"))
102
+ }
97
103
  return menus
98
104
  }
99
105
 
@@ -126,6 +132,9 @@ function _normalMenus(order) {
126
132
  menus.push(_menu(ChatEventType.discuss, '内部讨论'))
127
133
  }
128
134
  menus.push(_menu(ChatEventType.reply, '回复意见', 1))
135
+ if (order.serviceGroupName != 'MDT' && (order.orderMessage.askButton || false)) {
136
+ menus.push(_menu(ChatEventType.endConsultation, "结束咨询"))
137
+ }
129
138
  break
130
139
  default:
131
140
  menus.push(_menu(ChatEventType.reply, '回复意见', 1))
@@ -14,7 +14,7 @@
14
14
  name="chatImg"
15
15
  src="{{item.url}}"
16
16
  class="slide-image"
17
- mode="aspectFill"
17
+ mode="aspectFit"
18
18
  />
19
19
  <video
20
20
  wx:else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-doctor-sdk",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "和缓名医小程序SDK",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"