hh-doctor-sdk 0.2.2 → 0.2.4

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.
@@ -29,7 +29,7 @@ module.exports = Behavior({
29
29
  doctorInfo: '',
30
30
  headerTexts: [], // 头部文字部分
31
31
  mediaInfo: [], // 头部媒体数据部分
32
- mediaFiles: [], // 图片和视频
32
+ _mediaFiles: [],
33
33
  dicoms: [], // DICOM数据
34
34
  messageDatas: [], // 原始信息流数据
35
35
  messages: [], // 构建信息流数据
@@ -179,7 +179,7 @@ module.exports = Behavior({
179
179
  message.type = MessageTypes.image
180
180
  message.images = caseImageList
181
181
  message.isVideo = isVideo
182
- message.cover = caseImageList[0].smallImage
182
+ message.cover = isVideo ? caseImageList[0].imageurl + '?x-oss-process=video/snapshot,t_0,f_jpg' : caseImageList[0].smallImage
183
183
  message.number = `共${caseImageList.length}${isVideo ? '个' : '张'}`
184
184
  message.template = MessageTemplates.image
185
185
 
@@ -231,7 +231,11 @@ module.exports = Behavior({
231
231
  if (data.commentsExtends && data.commentsExtends.length > 0) {
232
232
  const fileData = JSON.parse(data.commentsExtends)
233
233
  if (fileData) {
234
- const fileSize = `${(fileData.size / 1000).toFixed(2)}M`
234
+ let fileSize = ''
235
+ if (fileData.size) {
236
+ fileSize = `${(fileData.size / 1000).toFixed(2)}M`
237
+ }
238
+
235
239
  message.file = {
236
240
  name: fileData.name,
237
241
  size: fileSize
@@ -64,8 +64,9 @@ module.exports = Behavior({
64
64
  const isVideo = imageList[0].type == 'video'
65
65
  const unit = isVideo ? '个' : '张'
66
66
  const fileType = isVideo ? 4 : 0
67
+ let thumb = isVideo ? imageList[0].url + '?x-oss-process=video/snapshot,t_0,f_jpg' : imageList[0].thumb
67
68
  const showNumber = !['HISINFO', 'METER'].includes(type.toUpperCase()) ? `共${imageCount}${unit}` : '点击查看'
68
- mediaGroups.push(this.mediaItem(groupIndex, fileType, name, imageList, imageList[0].thumb, showNumber))
69
+ mediaGroups.push(this.mediaItem(groupIndex, fileType, name, imageList, thumb, showNumber))
69
70
  const allImages = this.data._mediaFiles.concat(imageList)
70
71
  this.data._mediaFiles = allImages
71
72
  groupIndex++
@@ -3,6 +3,7 @@ var currentPlayUrl
3
3
  var currentPlayIndex = -1
4
4
  var audioAnimationInterval
5
5
 
6
+ const hhDoctor = require('../../hh-doctor')
6
7
  const hhNavigation = require('../../hh-navigation')
7
8
  const doctorLoader = require('../../public/doctor-loader')
8
9
 
@@ -19,12 +20,13 @@ Page({
19
20
  * 生命周期函数--监听页面加载
20
21
  */
21
22
  onLoad(options) {
23
+ hhDoctor.initSDK()
22
24
  wx.statLog.sendStatLog(options.orderId, '打开咨询单详情界面')
23
25
  const doctorId = options.doctorId
24
26
  doctorLoader.loadDoctor({
25
27
  doctorId: doctorId,
26
28
  scence: '咨询单详情',
27
- isTest: options.isTest || true
29
+ isTest: options.isTest || false
28
30
  }, (res) => {
29
31
  if (res) {
30
32
  this.datePickerTime()
@@ -62,7 +64,8 @@ Page({
62
64
  showPreview: false,
63
65
  })
64
66
  } else {
65
- this._refreshOrder()
67
+ // this._refreshOrder()
68
+ wx.startPullDownRefresh()
66
69
  }
67
70
  },
68
71
 
@@ -1,12 +1,5 @@
1
1
  <import src="../detail/widget/chat-cell-template/chat-cell-template" />
2
2
  <view class="match-parent body-display">
3
- <view wx:if="{{notifySetVideoTime}}" class="set-time-tip">
4
- <image
5
- class="set-time-tip-image"
6
- src="https://image.hh-medic.com/icon/pacs/hh_warning_icon_fill.png"
7
- />
8
- 本咨询为视频咨询,请设置你方便的视频时间</view
9
- >
10
3
  <view
11
4
  id="scroll-body"
12
5
  class="body-display"
@@ -60,6 +53,7 @@
60
53
  name="{{item.name}}"
61
54
  createtime="{{item.createtime}}"
62
55
  isSend="{{item.isSend}}"
56
+ type="{{item.type}}"
63
57
  bind:clickCell="clickMessageCell"
64
58
  >
65
59
  <template is="{{item.template}}" data="{{...item}}" />
@@ -69,6 +63,13 @@
69
63
  </view>
70
64
  <view id="message-bottom" class="message-bottom"></view>
71
65
  </view>
66
+ <view wx:if="{{notifySetVideoTime}}" class="set-time-tip">
67
+ <image
68
+ class="set-time-tip-image"
69
+ src="https://image.hh-medic.com/icon/pacs/hh_warning_icon_fill.png"
70
+ />
71
+ 本咨询为视频咨询,请设置你方便的视频时间
72
+ </view>
72
73
  <chat-bottom
73
74
  id="chat-bottom"
74
75
  wx:if="{{order && doctorInfo}}"
@@ -7,7 +7,26 @@ Component({
7
7
  * 组件的属性列表
8
8
  */
9
9
  properties: {
10
-
10
+ index: {
11
+ type: Number,
12
+ value: 0,
13
+ },
14
+ name: {
15
+ type: String,
16
+ value: ''
17
+ },
18
+ createtime: {
19
+ type: String,
20
+ value: ''
21
+ },
22
+ isSend: {
23
+ type: Boolean,
24
+ value: false
25
+ },
26
+ type: {
27
+ type: Number,
28
+ value: 0
29
+ }
11
30
  },
12
31
 
13
32
  /**
@@ -9,7 +9,11 @@
9
9
  <view class="chat-cell-body">
10
10
  <text wx:if="{{!isSend}}" class="chat-cell-name">{{name}}</text>
11
11
  <view class="chat-cell-body-content">
12
- <view class="chat-triangle {{isSend ? 'sender' : ''}}"></view>
12
+ <view
13
+ wx:if="{{type != 2}}"
14
+ class="chat-triangle {{isSend ? 'sender' : ''}}"
15
+ ></view>
16
+ <view wx:if="{{type == 2}}" class="chat-triangle-empty"></view>
13
17
  <view
14
18
  class="{{isSend ? 'chat-cell-sender-content' : 'chat-cell-content'}}"
15
19
  catch:tap="clickCell"
@@ -1,8 +1,8 @@
1
1
  @import "../chat-cell.wxss";
2
2
 
3
3
  .chat-cell-name {
4
- font-size: 32rpx;
5
- color: #333333;
4
+ font-size: 28rpx;
5
+ color: #646464;
6
6
  margin-left: 20rpx;
7
7
  margin-bottom: 10rpx;
8
8
  line-height: 1;
@@ -58,7 +58,7 @@ function _videoMenus(order) {
58
58
  } else {
59
59
  menus.push(_menu(ChatEventType.refuse, '拒绝'))
60
60
  menus.push(_menu(ChatEventType.setTime, '设置时间'))
61
- menus.push(_menu(ChatEventType.videoMore, '更多'))
61
+ // menus.push(_menu(ChatEventType.videoMore, '更多'))
62
62
  }
63
63
  return menus
64
64
  }
@@ -32,16 +32,13 @@
32
32
  <template name="textItem">
33
33
  <view class="chatting-text-container">
34
34
  <block wx:for="{{textArray}}" wx:key="this">
35
- <!-- <text wx:if="{{item.type == 'text'}}" class="chatting-text"
36
- >{{item.value}}</text
37
- >
38
- wx:elif="{{item.type == 'link'}}"-->
39
35
  <view
40
36
  class="chatting-text {{item.type == 'link' ? 'link' : ''}}"
41
37
  catch:tap="{{item.type == 'link' ? '_tapLink' : ''}}"
42
38
  data-link="{{item.type == 'link' ? item.value : ''}}"
43
- >{{item.name}}</view
44
39
  >
40
+ {{item.name}}
41
+ </view>
45
42
  </block>
46
43
  </view>
47
44
  </template>
@@ -3,7 +3,7 @@
3
3
  width: 0px;
4
4
  border-width: 12rpx;
5
5
  border-style: solid;
6
- margin-top: 10rpx;
6
+ margin-top: 20rpx;
7
7
  border-color: transparent white transparent transparent;
8
8
  top: 5rpx;
9
9
  }
@@ -13,6 +13,10 @@
13
13
  left: auto;
14
14
  }
15
15
 
16
+ .chat-triangle-empty {
17
+ width: 20rpx;
18
+ }
19
+
16
20
  .chat-cell {
17
21
  font-size: 32rpx;
18
22
  margin-left: 10rpx;
@@ -34,14 +38,15 @@
34
38
  float: left;
35
39
  }
36
40
  .chat-cell-content {
41
+ max-width: calc(100% - 80rpx - 30rpx);
37
42
  display: flex;
38
43
  flex-direction: row;
39
44
  background-color: white;
40
- margin: 0 0 10px 0rpx;
41
- padding: 10rpx 20rpx 10rpx 20rpx;
42
- border-radius: 7px;
45
+ margin: 0rpx 30rpx 10rpx 0rpx;
46
+ padding: 14rpx 20rpx 14rpx 20rpx;
47
+ border-radius: 14rpx;
43
48
  width: fit-content;
44
- min-height: 30rpx;
49
+ min-height: 40rpx;
45
50
  }
46
51
 
47
52
  .chat-cell-sender-photo {
@@ -52,11 +57,11 @@
52
57
  display: flex;
53
58
  flex-direction: row;
54
59
  background-color: #c6e2fe;
55
- margin: 0px 0 10px 50px;
60
+ margin: 0rpx 0 10rpx 70rpx;
56
61
  padding: 10rpx 20rpx 10rpx 20rpx;
57
- border-radius: 7px;
62
+ border-radius: 14rpx;
58
63
  width: fit-content;
59
- min-height: 30rpx;
64
+ min-height: 40rpx;
60
65
  }
61
66
 
62
67
  .chat-time-container {
@@ -79,7 +84,9 @@
79
84
  .chat-image-container {
80
85
  display: flex;
81
86
  position: relative;
82
- margin: 10rpx 0 10rpx 0;
87
+ margin: -12rpx -20rpx;
88
+ border-radius: 10rpx;
89
+ overflow: hidden;
83
90
  }
84
91
 
85
92
  .chat-image {
@@ -128,6 +135,8 @@
128
135
  .pdf-name {
129
136
  font-size: 28rpx;
130
137
  color: #333333;
138
+ max-width: 400rpx;
139
+ word-wrap: break-word;
131
140
  }
132
141
 
133
142
  .pdf-size {
@@ -145,7 +154,7 @@
145
154
 
146
155
  .chatting-text {
147
156
  display: contents;
148
- font-size: 28rpx;
157
+ font-size: 32rpx;
149
158
  color: #333333;
150
159
  word-break: break-all;
151
160
  }
@@ -234,19 +243,6 @@
234
243
  right: 0px;
235
244
  }
236
245
 
237
- .sound-length {
238
- margin-left: 10px;
239
- line-height: 40px;
240
- height: 40px;
241
- font-size: 20px;
242
- color: #969696;
243
- }
244
-
245
- .sound-length.sender {
246
- margin-left: auto;
247
- margin-right: 10px;
248
- }
249
-
250
246
  .chat-cell-body {
251
247
  display: flex;
252
248
  flex-direction: column;
@@ -267,14 +263,13 @@
267
263
  .notify-end-time-icon {
268
264
  width: 50rpx;
269
265
  height: 50rpx;
270
- margin: auto;
271
266
  }
272
267
 
273
268
  .notify-end-time-text {
274
269
  font-size: 32rpx;
275
270
  color: #333333;
276
- margin-left: 10rpx;
277
271
  margin: auto 0 auto 10rpx;
272
+ word-break: break-all;
278
273
  }
279
274
 
280
275
  .notify-time-container {
@@ -32,17 +32,18 @@ module.exports = Behavior({
32
32
  orderId: null, // 订单Id
33
33
  order: null, // 订单
34
34
  orderGroup: [],
35
+ showEmpty: false
35
36
  },
36
37
 
37
38
  methods: {
38
39
  loadList() {
39
40
  wx.showNavigationBarLoading()
41
+ this.setData({
42
+ showEmpty: false
43
+ })
40
44
  api.orderList().then((res) => {
41
45
  wx.hideNavigationBarLoading()
42
46
  wx.stopPullDownRefresh()
43
- this.setData({
44
- triggered: false
45
- })
46
47
  this._buildOrderGroupInfo(res.data)
47
48
  })
48
49
  },
@@ -51,14 +52,16 @@ module.exports = Behavior({
51
52
  // console.error(JSON.stringify(orderModel))
52
53
  if (orderModel) {
53
54
  var orderGroups = []
54
- // if (orderModel.requestOrderList) {
55
+ // if (orderModel.requestOrderList && orderModel.requestOrderList.length > 0) {
55
56
  // orderGroups.push(this._buildGroup(true, '我的咨询', orderModel.requestOrderList))
56
57
  // }
57
- if (orderModel.responseOrderList) {
58
+ if (orderModel.responseOrderList && orderModel.responseOrderList.length > 0) {
58
59
  orderGroups.push(this._buildGroup(false, '我的回复', orderModel.responseOrderList))
59
60
  }
61
+ let showEmpty = orderGroups.length == 0
60
62
  this.setData({
61
63
  orderGroup: orderGroups,
64
+ showEmpty: showEmpty
62
65
  })
63
66
  }
64
67
  },
@@ -1,3 +1,4 @@
1
+ const hhDoctor = require('../../hh-doctor')
1
2
  const doctorLoader = require('../../public/doctor-loader')
2
3
  const cache = require('../../public/cache-data')
3
4
 
@@ -10,7 +11,7 @@ Page({
10
11
  * 页面的初始数据
11
12
  */
12
13
  data: {
13
- needRefresh: false,
14
+ init: false
14
15
  },
15
16
 
16
17
  /**
@@ -62,7 +63,14 @@ Page({
62
63
  isTest: isTest,
63
64
  }, (result) => {
64
65
  if (result) {
65
- this.loadList()
66
+ if (this.data.init) {
67
+ this.loadList()
68
+ } else {
69
+ wx.startPullDownRefresh()
70
+ this.setData({
71
+ init: true
72
+ })
73
+ }
66
74
  }
67
75
  })
68
76
  }
@@ -98,11 +106,7 @@ Page({
98
106
  /**
99
107
  * 生命周期函数--监听页面隐藏
100
108
  */
101
- onHide() {
102
- this.setData({
103
- needRefresh: true,
104
- })
105
- },
109
+ onHide() {},
106
110
 
107
111
  /**
108
112
  * 生命周期函数--监听页面卸载
@@ -1,5 +1,5 @@
1
1
  <view class="match-parent">
2
- <view class="chatting-body">
2
+ <view wx:if="{{!showEmpty}}" class="chatting-body">
3
3
  <block wx:for="{{orderGroup}}" wx:key="orderGroup" wx:for-item="group">
4
4
  <view wx:if="{{group.showSection}}" class="order-group"
5
5
  >{{group.title}}</view
@@ -44,4 +44,11 @@
44
44
  </view>
45
45
  </block>
46
46
  </view>
47
+ <view wx:if="{{showEmpty}}" class="empty-body">
48
+ <image
49
+ class="empty-image"
50
+ src="https://image.hh-medic.com/icon/pacs/hh_consulation_empty.png"
51
+ />
52
+ 暂时没有咨询单
53
+ </view>
47
54
  </view>
@@ -107,3 +107,19 @@ page {
107
107
  .status-yellow-color {
108
108
  background-color: #f49600;
109
109
  }
110
+
111
+ .empty-body {
112
+ position: absolute;
113
+ left: calc(50% - 100rpx);
114
+ top: calc(50% - 200rpx);
115
+ display: flex;
116
+ flex-direction: column;
117
+ font-size: 30rpx;
118
+ color: #646464;
119
+ }
120
+
121
+ .empty-image {
122
+ width: 200rpx;
123
+ height: 200rpx;
124
+ margin-bottom: 30rpx;
125
+ }
@@ -7,6 +7,7 @@ const cache = require('./cache-data')
7
7
  */
8
8
  function loadDoctor(options, callback) {
9
9
  const doctorId = options.doctorId
10
+ const isTest = options.isTest || false
10
11
  if (!doctorId) {
11
12
  wx.statLog.sendStatLog(null, `场景:${options.scence || '未知'} 未传必要的参数`)
12
13
  wx.showToast({
@@ -21,7 +22,8 @@ function loadDoctor(options, callback) {
21
22
  // 如果传入是新的doctorId,重新缓存doctorId并重置doctor为空
22
23
  cache.cache({
23
24
  doctorId: doctorId,
24
- doctor: null
25
+ doctor: null,
26
+ isTest: isTest
25
27
  })
26
28
  }
27
29
 
@@ -1,5 +1,8 @@
1
1
  /** 解析文本中的超链接 */
2
2
  function findLinkFromText(text, typeText, typeUrl) {
3
+ if (!text || text.length == 0) {
4
+ return []
5
+ }
3
6
  let linkArr = []
4
7
  let reg = /[http|https|wxapp|dicom]+:\/\/[\w|\-|_|.|~|!|\*|'|\(|\)|;|:|@|&|=|+|\$|,|\/|\?|#|\[|\]|%]*/g
5
8
  let link = reg.exec(text)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-doctor-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "和缓名医小程序SDK",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"