hh-doctor-sdk 0.4.6 → 0.5.0

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.
@@ -71,13 +71,28 @@ Component({
71
71
  if (orderId) {
72
72
  api.getAgoraToken(orderId).then((res) => {
73
73
  const token = res.data.token
74
+ wx.statLog.sendStatLog(orderId, `获取声网token成功 -> ${token}`)
74
75
  this.joinChannel({
75
76
  roomID: roomID,
76
77
  token: token
77
78
  })
78
79
  }).catch((e) => {
79
-
80
+ wx.statLog.sendStatLog(orderId, `获取声网token失败 -> ${JSON.stringify(e)}`)
81
+ wx.showToast({
82
+ title: '获取声网token失败',
83
+ })
84
+ setTimeout(() => {
85
+ wx.navigateBack()
86
+ }, 1000)
87
+ })
88
+ } else {
89
+ wx.statLog.sendStatLog(orderId, '传入的订单号为空')
90
+ wx.showToast({
91
+ title: '订单号为空,未获取房间号',
80
92
  })
93
+ setTimeout(() => {
94
+ wx.navigateBack()
95
+ }, 1000)
81
96
  }
82
97
  },
83
98
 
@@ -96,6 +111,7 @@ Component({
96
111
  async joinChannel(data) {
97
112
  const strRoomID = '' + data.roomID
98
113
  const uuid = cache.uuid()
114
+ wx.statLog.sendStatLog(this.properties.orderId, `声网开始进房 ${uuid} - ${strRoomID} - ${data.token}`)
99
115
  await this.client.join(data.token, strRoomID, uuid)
100
116
  const url = await this.client.publish()
101
117
  const ts = new Date().getTime()
@@ -345,7 +345,7 @@ module.exports = Behavior({
345
345
  wx.statLog.sendStatLog(this.data.orderId, '发送拒绝呼叫消息')
346
346
  message_api.bindData({
347
347
  'toUUID': this.data.expert.uuid,
348
- 'orderId': this.orderId
348
+ 'orderId': this.data.orderId
349
349
  })
350
350
  return message_api.sendReject()
351
351
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-doctor-sdk",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
4
4
  "description": "和缓名医小程序SDK",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"