react_hsbc_teller 1.5.8 → 1.6.1

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": "1.5.8",
3
+ "version": "1.6.1",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -2,6 +2,25 @@ import Server from './server';
2
2
 
3
3
  class API extends Server{
4
4
 
5
+ async updateMeetingInfo(params = {}){
6
+ // return this.axios('get', '/lang/select/2', params);
7
+ try{
8
+ let result = await this.axios('post', '/hsbc/updateMeetingInfo', params);
9
+ if(result && (result.data instanceof Object) && result.code === 200){
10
+ return result||[];
11
+ }else{
12
+ let err = {
13
+ tip: '服务异常',
14
+ response: result,
15
+ data: params,
16
+ // url: 'https://api.cangdu.org/shopro/data/products',
17
+ }
18
+ throw err;
19
+ }
20
+ }catch(err){
21
+ throw err;
22
+ }
23
+ }
5
24
  async rateAll(params = {}){
6
25
  // return this.axios('get', '/lang/select/2', params);
7
26
  try{
@@ -161,6 +161,9 @@ createRoomCallback=(data)=>{
161
161
  joinRoomCallback=(data)=>{
162
162
  console.log('joinRoomCallback', data)
163
163
  }
164
+ userExit =(val)=>{
165
+     console.log(val)
166
+ }
164
167
  render() {
165
168
  return (
166
169
  <div className="test">
@@ -192,6 +195,7 @@ joinRoomCallback=(data)=>{
192
195
  createRoomCallback={this.createRoomCallback}
193
196
  joinRoomCallback={this.joinRoomCallback}
194
197
  imgCallback={this.imgCallback}
198
+ userExit={this.userExit}
195
199
  >
196
200
 
197
201
  <Pdf></Pdf>
@@ -11,6 +11,8 @@ import voiceImgOpen from '../../assets/img/icon_Mute.png'
11
11
  import voiceImgCloe from '../../assets/img/icon_MuteOne.png'
12
12
  import cameraImgOpen from '../../assets/img/icon_camera.png'
13
13
  import cameraImgCloe from '../../assets/img/icon_cameraOne.png'
14
+ import autod from '../../assets/mp3/joinmeeting.mp3'
15
+ import leftMetting from '../../assets/mp3/leftmeeting.mp3'
14
16
  import errorPng from '../../assets/img/tooltips2_fail.png'
15
17
  import { callNimIM } from '../../utils/cell.js'
16
18
  import Modal from "antd/lib/modal";
@@ -2007,6 +2009,7 @@ class Video extends Component {
2007
2009
  loading: false,
2008
2010
  });
2009
2011
  this.enterRoom()
2012
+ this.updateMeetingInfo()
2010
2013
  this.timer = setInterval(
2011
2014
  () => {
2012
2015
  if(!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0.1) {
@@ -2403,29 +2406,14 @@ class Video extends Component {
2403
2406
  this.test_controller.OnNewJoinerIn = (participant) => {
2404
2407
  console.log('新加⼊房间者', participant);
2405
2408
  this.state.isCustomer= true
2406
- // let audio = document.createElement('audio') //生成一个audio元素
2407
- // audio.src = 'http://mp3.9ku.com/hot/2005/05-19/65937.mp3' //音乐的路径
2408
- // audio.play()
2409
+ let src = autod
2410
+ let audio = new Audio(src)
2411
+ audio.play()
2409
2412
  };
2410
2413
  // 推送“有新发布”给与会者
2411
2414
  this.test_controller.OnNewPublish = (feed) => {
2412
2415
  console.log('有新发布者', feed);
2413
2416
  console.log(new Date())
2414
- callNimIM('sendCustomCmdMsg', {
2415
- customId: this.state.imRoomId,
2416
- content: JSON.stringify({
2417
- 'typeId': 1014,
2418
- 'sessionId': this.state.sessionId,
2419
- 'meetingInfo': {
2420
- 'title': this.props.meetingInfo.title,
2421
- 'host': this.props.meetingInfo.host,
2422
- 'customers': this.props.meetingInfo.customers,
2423
- 'otherAttendees': this.props.meetingInfo.otherAttendees
2424
- }
2425
-
2426
- })
2427
- }, function (code, message, data) {
2428
- })
2429
2417
  callNimIM('sendCustomCmdMsg', {
2430
2418
  customId: this.state.imRoomId,
2431
2419
  content: JSON.stringify({
@@ -2619,7 +2607,7 @@ class Video extends Component {
2619
2607
  // 取消发布成功
2620
2608
  this.test_controller.OnUnPublishSucc = (sid) => {
2621
2609
  console.log('取消发布成功', sid, document.getElementById('publish_video1').name)
2622
- if (sid != document.getElementById('publish_video1').name) {
2610
+ if (document.getElementById('publish_video1').name && sid != document.getElementById('publish_video1').name) {
2623
2611
  callNimIM('sendCustomCmdMsg', {
2624
2612
  customId: this.state.imRoomId,
2625
2613
  content: JSON.stringify({
@@ -2635,9 +2623,9 @@ class Video extends Component {
2635
2623
  screenName: '共享模式'
2636
2624
  });
2637
2625
  this.tabTitlesClick('RMScreen', 'delect')
2638
- if (this.state.isPictureInPicture) {
2639
- document.exitPictureInPicture()
2640
- }
2626
+ // if (this.state.isPictureInPicture) {
2627
+ // document.exitPictureInPicture()
2628
+ // }
2641
2629
 
2642
2630
  }
2643
2631
  };
@@ -2787,14 +2775,25 @@ class Video extends Component {
2787
2775
  exitType
2788
2776
  ) => {
2789
2777
  console.log('退出房间者', participant, exitType)
2778
+ let src = leftMetting
2779
+ let audio = new Audio(src)
2780
+ audio.play()
2790
2781
  this.appGetUsernameClick(participant).then((res)=>{
2791
2782
  console.log('退出房间者',res)
2792
- let data = res? res : '客户'
2793
- console.log(data)
2794
- this.messageClick(( data + '已退出会议'),'error')
2795
- // let audio = document.createElement('audio') //生成一个audio元素
2796
- // audio.src = 'http://mp3.9ku.com/hot/2005/05-19/65937.mp3' //音乐的路径
2797
- // audio.play()
2783
+ let data = res? res.username ? res.username : '客户' : '客户'
2784
+ console.log(data)
2785
+ this.messageClick(( data + '已退出会议'),'error')
2786
+ if(res.userType == 1) {
2787
+ // 2--坐席  1--客户
2788
+ this.props.userExit({
2789
+ userId: participant,
2790
+ userType:'1'
2791
+ })
2792
+ }
2793
+ // console.log('退出房间者',res)
2794
+ // let data = res? res : '客户'
2795
+ // console.log(data)
2796
+ // this.messageClick(( data + '已退出会议'),'error')
2798
2797
  })
2799
2798
 
2800
2799
  };
@@ -2994,9 +2993,9 @@ class Video extends Component {
2994
2993
  });
2995
2994
  console.log(pictureInPictureVideo)
2996
2995
  this.tabTitlesClick('RMScreen', 'delect')
2997
- if (this.state.isPictureInPicture) {
2998
- document.exitPictureInPicture()
2999
- }
2996
+ // if (this.state.isPictureInPicture) {
2997
+ // document.exitPictureInPicture()
2998
+ // }
3000
2999
  }
3001
3000
  };
3002
3001
  // 服务端录制初始化成功
@@ -3134,9 +3133,9 @@ class Video extends Component {
3134
3133
  });
3135
3134
  console.log(pictureInPictureVideo)
3136
3135
  this.tabTitlesClick('RMScreen', 'delect')
3137
- if (this.state.isPictureInPicture) {
3138
- document.exitPictureInPicture()
3139
- }
3136
+ // if (this.state.isPictureInPicture) {
3137
+ // document.exitPictureInPicture()
3138
+ // }
3140
3139
  // if (!this.state.laveRoomSharedScreen && this.state.isSharedScreen) {
3141
3140
  // this.sharedScreen()
3142
3141
  // }
@@ -3162,6 +3161,42 @@ class Video extends Component {
3162
3161
  }
3163
3162
  }
3164
3163
  }
3164
+ // 保存mettingInfo
3165
+ // callNimIM('sendCustomCmdMsg', {
3166
+ // customId: this.state.imRoomId,
3167
+ // content: JSON.stringify({
3168
+ // 'typeId': 1014,
3169
+ // 'sessionId': this.state.sessionId,
3170
+ // 'meetingInfo': {
3171
+ // 'title': this.props.meetingInfo.title,
3172
+ // 'host': this.props.meetingInfo.host,
3173
+ // 'customers': this.props.meetingInfo.customers,
3174
+ // 'otherAttendees': this.props.meetingInfo.otherAttendees
3175
+ // }
3176
+
3177
+ // })
3178
+ // }, function (code, message, data) {
3179
+ // })
3180
+ updateMeetingInfo= async()=>{
3181
+ let customers
3182
+ this.props.meetingInfo.customers.map((item, index) => {
3183
+ customers = customers ? customers + ',' + item : item
3184
+ })
3185
+ try{
3186
+ let result = await API.updateMeetingInfo({
3187
+ title:this.props.meetingInfo.title,
3188
+ host:this.props.meetingInfo.host,
3189
+ customers:customers,
3190
+ otherAttendees: this.props.meetingInfo.otherAttendees ? this.props.meetingInfo.otherAttendees : '',
3191
+ sessionId:this.state.sessionId
3192
+ })
3193
+ } catch (err) {
3194
+ console.error(err);
3195
+ if(err.status == 502 || err.status== 404) {
3196
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
3197
+ }
3198
+ }
3199
+ }
3165
3200
  enterRoom = async () =>{
3166
3201
  try {
3167
3202
  let result = await API.enterRoom({
@@ -3210,6 +3245,9 @@ class Video extends Component {
3210
3245
  clearInterval(value)
3211
3246
  })
3212
3247
  this.timer && clearInterval(this.timer);
3248
+ if (this.state.isPictureInPicture) {
3249
+ document.exitPictureInPicture()
3250
+ }
3213
3251
  if(this.state.isSharedScreen) {
3214
3252
  this.setState({
3215
3253
  screenName: '共享模式',
@@ -3217,9 +3255,7 @@ class Video extends Component {
3217
3255
  this.state.isSharedScreen = false
3218
3256
  this.state.laveRoomSharedScreen = true
3219
3257
  // this.test_controller.UnPublish(document.getElementById('video20').name)
3220
- if (this.state.isPictureInPicture) {
3221
- document.exitPictureInPicture()
3222
- }
3258
+
3223
3259
 
3224
3260
  this.props.onLeaveRoom({
3225
3261
  code: LEAVE_TYPE.TELLER_EXIT,
@@ -3687,6 +3723,15 @@ class Video extends Component {
3687
3723
  });
3688
3724
  if (result.code == 200) {
3689
3725
  this.messageClick('识别成功','success')
3726
+ callNimIM('sendCustomCmdMsg', {
3727
+ customId: this.state.imRoomId,
3728
+ content: JSON.stringify({
3729
+ 'typeId': 1020,
3730
+ 'sessionId': this.state.sessionId,
3731
+ 'cameraState': 1, // 1--打开前置 2--打开后置
3732
+ "userId": this.state.faceCustomerUid
3733
+ })
3734
+ });
3690
3735
  this.setState({
3691
3736
  isModalVisibleFacial: false
3692
3737
  })
@@ -3713,6 +3758,15 @@ class Video extends Component {
3713
3758
 
3714
3759
  };
3715
3760
  handleCancelFacial = () => {
3761
+ callNimIM('sendCustomCmdMsg', {
3762
+ customId: this.state.imRoomId,
3763
+ content: JSON.stringify({
3764
+ 'typeId': 1020,
3765
+ 'sessionId': this.state.sessionId,
3766
+ 'cameraState': 1, // 1--打开前置 2--打开后置
3767
+ "userId": this.state.faceCustomerUid
3768
+ })
3769
+ });
3716
3770
  this.setState({
3717
3771
  isModalVisibleFacial: false
3718
3772
  })
@@ -3794,6 +3848,18 @@ class Video extends Component {
3794
3848
  if(item.tourist) {
3795
3849
  this.retrieveCustomerInfoByActivityId(item.customId)
3796
3850
  } else {
3851
+ if(this.state.faceCustomerType == 2) {
3852
+ // ocr
3853
+ callNimIM('sendCustomCmdMsg', {
3854
+ customId: this.state.imRoomId,
3855
+ content: JSON.stringify({
3856
+ 'typeId': 1020,
3857
+ 'sessionId': this.state.sessionId,
3858
+ 'cameraState': 2, // 1--打开前置 2--打开后置
3859
+ "userId": item.customId
3860
+ })
3861
+ });
3862
+ }
3797
3863
  var sid
3798
3864
  if (item.feedId == document.getElementById("feedId1").innerText) {
3799
3865
  sid = document.getElementById('video1').name;
@@ -3826,11 +3892,20 @@ class Video extends Component {
3826
3892
  this.setState({
3827
3893
  clickedFacial: false,
3828
3894
  clickedOcr: false,
3829
-
3830
3895
  isModalVisibleFacial: true,
3831
3896
  facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
3832
3897
  })
3898
+ setTimeout(() => {
3899
+ this.setState({
3900
+ facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
3901
+ })
3902
+ },1000)
3903
+ }
3833
3904
  }
3905
+ sgsinImage=()=>{
3906
+ this.setState({
3907
+ facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png')
3908
+ })
3834
3909
  }
3835
3910
  handleChangeOcr =(val)=> {
3836
3911
  console.log(val)
@@ -3855,7 +3930,8 @@ class Video extends Component {
3855
3930
  console.log(result)
3856
3931
 
3857
3932
  if (result.code == 200) {
3858
- data = result.data.username ? result.data.username : ''
3933
+ data = result.data ? result.data : ''
3934
+ // data = result.data.username ? result.data.username : ''
3859
3935
  }
3860
3936
  return data
3861
3937
  }catch (err) {
@@ -4191,9 +4267,9 @@ class Video extends Component {
4191
4267
  screenName: '共享模式'
4192
4268
  });
4193
4269
  this.tabTitlesClick('RMScreen', 'delect')
4194
- if (this.state.isPictureInPicture) {
4195
- document.exitPictureInPicture()
4196
- }
4270
+ // if (this.state.isPictureInPicture) {
4271
+ // document.exitPictureInPicture()
4272
+ // }
4197
4273
  }
4198
4274
  }
4199
4275
 
@@ -5055,6 +5131,7 @@ class Video extends Component {
5055
5131
  <Modal title={this.state.titleModal} closable={false} centered={true} visible={this.state.isModalVisibleFacial} footer={[
5056
5132
  <div key='facial'>
5057
5133
  <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>
5134
+ <Button className="modelButtonCancel" onClick={this.sgsinImage}>重新截图</Button>
5058
5135
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkFacial}>确定</Button>
5059
5136
  </div>
5060
5137
  ]}>
@@ -5189,7 +5266,7 @@ sessionId: "",
5189
5266
  meetingInfo: {
5190
5267
  title: '--',
5191
5268
  host: '--',
5192
- customers: ['--'],
5269
+ customers: ['--','1','2'],
5193
5270
  otherAttendees: undefined
5194
5271
  },
5195
5272
  isTranscribing: false,