react_hsbc_teller 0.7.3 → 0.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -37,6 +37,7 @@ class Video extends Component {
37
37
  cancel = axios.CancelToken.source()
38
38
  signCanvas = React.createRef();
39
39
  state = {
40
+ sessionType: true,
40
41
  isWhiteboard: false,
41
42
  isSelect: '',
42
43
  loading: false,
@@ -48,6 +49,7 @@ class Video extends Component {
48
49
  employeeNumber: '',
49
50
  employeeName: '',
50
51
  isModalVisibleInvitation: false,
52
+ linkData: '',
51
53
  roomCustomerList: [],
52
54
  facialImg: '',
53
55
  isModalVisibleFacial: false,
@@ -162,6 +164,9 @@ class Video extends Component {
162
164
  })
163
165
  } catch (err) {
164
166
  console.error(err);
167
+ this.setState({
168
+ sessionType: false
169
+ })
165
170
  this.props.createRoomCallback({
166
171
  type: 2,
167
172
  errorManage: '保存房间信息失败',
@@ -539,7 +544,12 @@ class Video extends Component {
539
544
  }
540
545
  };
541
546
  endSessionValue = () => {
542
- this.test_controller.LeaveRoom()
547
+ if(this.state.sessionType) {
548
+ this.test_controller.LeaveRoom()
549
+ } else {
550
+ this.finishSession()
551
+ }
552
+
543
553
  };
544
554
  // 画中画
545
555
  pictureInPicture = () => {
@@ -681,7 +691,7 @@ class Video extends Component {
681
691
  for (let k = 0; k < str.length; k++){
682
692
  // console.log(str.substring(0,k+1))
683
693
  // console.log(cobj.measureText(str.substring(0,k+1)).width)
684
- if (cobj.measureText(str.substring(0,k+1)).width>240){
694
+ if (cobj.measureText(str.substring(0,k+1)).width>210){
685
695
  str = str.substring(0,k-2)
686
696
  str += '...'
687
697
  break;
@@ -1080,6 +1090,9 @@ class Video extends Component {
1080
1090
  window.IMOpenfire = msg =>{
1081
1091
  console.log('im登录', msg)
1082
1092
  if(!msg) {
1093
+ this.setState({
1094
+ sessionType: false
1095
+ })
1083
1096
  this.roomCallBack(2, 'im建立连接失败',-7)
1084
1097
  } else {
1085
1098
  this.setState({
@@ -1185,7 +1198,7 @@ class Video extends Component {
1185
1198
  microphoneList: objList1,
1186
1199
  speakerList: [objList2[0]]
1187
1200
  })
1188
- if (!this.state.appId) {
1201
+ if (!this.state.appId && this.state.sessionType) {
1189
1202
  this.mpaasSig(data);
1190
1203
  this.setState({
1191
1204
  cameraValue: obj[0].actionid,
@@ -1201,6 +1214,9 @@ class Video extends Component {
1201
1214
  // 获取设备失败
1202
1215
  this.test_controller.OnGetDevicesFailed = (code, msg) => {
1203
1216
  console.log('获取设备失败', code, msg)
1217
+ this.setState({
1218
+ sessionType: false
1219
+ })
1204
1220
  this.messageClick('获取设备失败,请检查摄像头设备是否可用或是否禁用摄像头','error')
1205
1221
  this.roomCallBack(2, '获取设备失败',-1)
1206
1222
  };
@@ -1211,6 +1227,9 @@ class Video extends Component {
1211
1227
  };
1212
1228
  this.test_controller.OnConnectFailed = (code, msg) => {
1213
1229
  console.log('建立连接失败', code, msg)
1230
+ this.setState({
1231
+ sessionType: false
1232
+ })
1214
1233
  this.roomCallBack(2, '连接失败',-2)
1215
1234
  };
1216
1235
  // 断开连接回调
@@ -1225,6 +1244,9 @@ class Video extends Component {
1225
1244
  // 初始化房间失败
1226
1245
  this.test_controller.OnInitRoomConfigFail = (err_code, err_msg) => {
1227
1246
  console.log('初始化房间失败', err_code, err_msg)
1247
+ this.setState({
1248
+ sessionType: false
1249
+ })
1228
1250
  this.roomCallBack(2, '初始化失败',-3)
1229
1251
  };
1230
1252
  // 初始化成功回调
@@ -1251,6 +1273,9 @@ class Video extends Component {
1251
1273
  // 创建房间失败
1252
1274
  this.test_controller.OnCreateRoomFailed = (err_code, err_msg) => {
1253
1275
  console.log('创建房间失败', err_code, err_msg)
1276
+ this.setState({
1277
+ sessionType: false
1278
+ })
1254
1279
  this.roomCallBack(2, '创建房间失败',-4)
1255
1280
  };
1256
1281
  // 初始化⾳视频成功
@@ -1273,6 +1298,9 @@ class Video extends Component {
1273
1298
  // 加入房间失败
1274
1299
  this.test_controller.OnJoinRoomFailed = (err_code, err_msg) => {
1275
1300
  console.log('加入房间失败', err_code, err_msg)
1301
+ this.setState({
1302
+ sessionType: false
1303
+ })
1276
1304
  this.roomCallBack(2, '加入失败',-5)
1277
1305
  };
1278
1306
  // 发布媒体流成功
@@ -1293,6 +1321,9 @@ class Video extends Component {
1293
1321
  // 发布媒体流失败
1294
1322
  this.test_controller.OnPublishFailed = (sid, err_code, err_msg) => {
1295
1323
  console.log('发布媒体流失败', sid, err_code, err_msg)
1324
+ this.setState({
1325
+ sessionType: false
1326
+ })
1296
1327
  this.roomCallBack(2, '发布失败',-6)
1297
1328
  };
1298
1329
  // 订阅媒体流成功
@@ -1844,6 +1875,7 @@ class Video extends Component {
1844
1875
  exitType
1845
1876
  ) => {
1846
1877
  console.log('退出房间者', participant, exitType)
1878
+ this.messageClick(this.props.customLeaveRoom,'error')
1847
1879
  };
1848
1880
  // 弱网回调
1849
1881
  this.test_controller.OnNetworkWeak = (bpsSend, bpsRecv, sid) => {
@@ -2154,7 +2186,7 @@ class Video extends Component {
2154
2186
  finishSession = async () => {
2155
2187
 
2156
2188
 
2157
- if (this.state.roomCustomerList.length == 0) {
2189
+ if (this.state.roomCustomerList.length == 0 && this.state.sessionType) {
2158
2190
  try {
2159
2191
  let result = await API.finishSession({
2160
2192
  sessionId: this.state.sessionId,
@@ -2168,7 +2200,8 @@ class Video extends Component {
2168
2200
  isWhiteboard: false,
2169
2201
  isPictureInPicture: false,
2170
2202
  imStatus: false,
2171
- imJoinRoom: false
2203
+ imJoinRoom: false,
2204
+ sessionType: true
2172
2205
  });
2173
2206
  this.props.onLeaveRoom({
2174
2207
  code: LEAVE_TYPE.TELLER_EXIT,
@@ -2205,8 +2238,12 @@ class Video extends Component {
2205
2238
  axios.get(this.props.resourcePath + "/beauty/beauty.js")
2206
2239
  .then(response => this.addToScriptClick()).catch(function (error) {
2207
2240
  console.log(error);
2241
+ this.setState({
2242
+ sessionType: false
2243
+ })
2208
2244
  this.roomCallBack(2, '创建房间失败',-4)
2209
2245
 
2246
+
2210
2247
  })
2211
2248
 
2212
2249
  }
@@ -2601,7 +2638,8 @@ class Video extends Component {
2601
2638
  isModalVisibleInvitation: true,
2602
2639
  employeeNumber: '',
2603
2640
  employeeName: '',
2604
- employeeError: ''
2641
+ employeeError: '',
2642
+ linkData: ''
2605
2643
  })
2606
2644
 
2607
2645
  }
@@ -2798,6 +2836,11 @@ class Video extends Component {
2798
2836
  employeeName: result.data.staffName,
2799
2837
  employeeError: result.data.staffName ? '' : '查无此人',
2800
2838
  })
2839
+ if(result.data.staffName){
2840
+ this.setState({
2841
+ linkData:encodeURIComponent('https://wp-staff-gateway.wealth-platform.uat.ali.cloud.cn.hsbc/meeting-ui/OHB/CN/HSBC?chnlID=OHB&locale=zh_CN&chnlCC=CN&chnlGMC=HSBC&targetFunc=supervisorMeeting&sourceFunc=rmMeeting&appointmentID='+ this.props.businessNumber + '&staffID='+this.state.employeeNumber+'&staffName='+result.data.staffName)
2842
+ })
2843
+ }
2801
2844
  } else {
2802
2845
  this.messageClick('查询失败','error')
2803
2846
  }
@@ -3511,7 +3554,12 @@ class Video extends Component {
3511
3554
  <Modal className="modelClass" title="新增预约" closable={false} centered={true} visible={this.state.isModalVisibleInvitation} footer={[
3512
3555
  <div key='invitation'>
3513
3556
  <Button className="modelButtonCancel" onClick={this.handleCancelInvitation}>取消</Button>
3514
- <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkInvitation}>确定</Button>
3557
+ {
3558
+ this.state.employeeName &&<Button className='modelButtonOk'type="primary" danger onClick={this.handleOkInvitation}>确定</Button>
3559
+ }
3560
+ {
3561
+ !this.state.employeeName &&<Button className='modelButtonCancelOne' type="primary" danger >确定</Button>
3562
+ }
3515
3563
  </div>
3516
3564
  ]}>
3517
3565
  <div>
@@ -3523,6 +3571,9 @@ class Video extends Component {
3523
3571
  <div className="invitationDiv">
3524
3572
  <span className="modalSpan">&nbsp;&nbsp;&nbsp;姓名:</span><span>{this.state.employeeName}</span>
3525
3573
  </div>
3574
+ <div className='linkClass'>
3575
+ <span>{this.state.linkData}</span>
3576
+ </div>
3526
3577
  </div>
3527
3578
  {
3528
3579
  this.state.employeeError && <div className='errorClassInvitation'>
@@ -3588,6 +3639,7 @@ Video.defaultProps = {
3588
3639
  fontSize: '14',
3589
3640
  fontFamily: 'auto',
3590
3641
  menus: ['SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP'],
3642
+ customLeaveRoom: '客户离开房间',
3591
3643
  meetingInfo: {
3592
3644
  title: '测试',
3593
3645
  host: 'wmz',
@@ -312,6 +312,15 @@
312
312
  border: 1px #5C5C5C solid!important;
313
313
  border-spacing: 20px!important;
314
314
  }
315
+ .modelButtonCancelOne{
316
+ width: 100px!important;
317
+ height: 40px!important;
318
+ font-size: 16px!important;
319
+ color: #5C5C5C!important;
320
+ border: 1px #5C5C5C solid!important;
321
+ border-spacing: 20px!important;
322
+ background: #d9d9d9!important;
323
+ }
315
324
  .modelButtonOk{
316
325
  width: 100px!important;
317
326
  height: 40px!important;
@@ -434,4 +443,9 @@
434
443
  width: 18px;
435
444
  height: 18px;
436
445
  }
446
+ }
447
+ .linkClass{
448
+ margin: 20px 40px;
449
+ font-size: 14px;
450
+ word-break: break-all;
437
451
  }