react_hsbc_teller 0.3.4 → 0.3.5

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.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -3,10 +3,6 @@ import './foot.less'
3
3
  import Popover from "antd/lib/popover";
4
4
  import 'antd/lib/popover/style'
5
5
  export default class foot extends Component {
6
- state = {
7
- clicked: false,
8
- clickedOcr: false
9
- }
10
6
  voice = () => {
11
7
  this.props.voice()
12
8
  }
@@ -26,15 +22,9 @@ export default class foot extends Component {
26
22
  this.props.endSession()
27
23
  }
28
24
  facialRecognition=()=>{
29
- this.setState({
30
- clicked: true
31
- })
32
25
  this.props.facialRecognition()
33
26
  }
34
27
  ocrClick=()=>{
35
- this.setState({
36
- clickedOcr: true
37
- })
38
28
  this.props.ocrClick()
39
29
  }
40
30
  pictureInPicture=()=>{
@@ -44,17 +34,21 @@ export default class foot extends Component {
44
34
  this.props.invitationClick()
45
35
  }
46
36
  customerFaceClick=(item)=>{
47
- this.setState({
48
- clicked: false,
49
- clickedOcr: false
50
- })
51
37
  this.props.customerFaceClick(item)
52
38
  }
53
39
  switchExternal=()=>{
54
40
  this.props.switchExternal()
55
41
  }
42
+ facialHandleVisibleChange = visible => {
43
+ console.log(visible)
44
+ this.props.facialHandleVisibleChange(visible)
45
+ };
46
+ ocrHandleVisibleChange = visible => {
47
+ console.log(visible)
48
+ this.props.ocrHandleVisibleChange(visible)
49
+ };
56
50
  render() {
57
- const {isTranscribing,img,cameraImg,screenName,suspendName,customerList} = this.props
51
+ const {clickedOcr,clickedFacial,isTranscribing,img,cameraImg,screenName,suspendName,customerList} = this.props
58
52
  const content = (
59
53
  <div>
60
54
  {customerList.map((item)=>{
@@ -111,7 +105,7 @@ export default class foot extends Component {
111
105
  {suspendName}
112
106
  </div>
113
107
  </div> */}
114
- <Popover content={content} trigger="click" visible={this.state.clicked}>
108
+ <Popover content={content} trigger="click" visible={clickedFacial} onVisibleChange={this.facialHandleVisibleChange}>
115
109
  <div className="one" onClick={this.facialRecognition.bind(this)}>
116
110
  <img className="imgClass" src={require("../../assets/img/Face_recognition.png").default} alt="" />
117
111
  <div className="text">
@@ -126,7 +120,7 @@ export default class foot extends Component {
126
120
  邀请
127
121
  </div>
128
122
  </div>
129
- <Popover content={content} trigger="click" visible={this.state.clickedOcr}>
123
+ <Popover content={content} trigger="click" visible={clickedOcr} onVisibleChange={this.ocrHandleVisibleChange}>
130
124
  <div className="one" onClick={this.ocrClick.bind(this)}>
131
125
  <img className="imgClass" src={require("../../assets/img/icon_ocr.png").default} alt="" />
132
126
  <div className="text">
@@ -69,6 +69,8 @@ class Video extends Component {
69
69
  sessionId: this.props.sessionId,
70
70
  imRoomId: this.props.imRoomId,
71
71
  isPictureInPicture: false,
72
+ clickedFacial: false,
73
+ clickedOcr: false
72
74
  };
73
75
  // eslint-disable-next-line no-undef
74
76
  test_controller = '';
@@ -324,7 +326,7 @@ class Video extends Component {
324
326
  }
325
327
  }
326
328
  // 获取人员客户列表
327
- selectCustomer = () => {
329
+ selectCustomer = (val) => {
328
330
  const list = []
329
331
  if (document.getElementById('video1').name) {
330
332
  console.log(this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText))
@@ -380,24 +382,41 @@ class Video extends Component {
380
382
  name: '客户6'
381
383
  })
382
384
  }
385
+ if(list.length > 0) {
386
+ if(val == 'ocr') {
387
+ this.setState({
388
+ clickedOcr: true
389
+ })
390
+ } else if(val == 'facial'){
391
+ this.setState({
392
+ clickedFacial: true
393
+ })
394
+ }
395
+ } else {
396
+ message.success('当前暂无客户')
397
+ }
383
398
  this.setState({
384
399
  customerList: list
385
400
  })
386
401
  }
387
402
  // 人脸识别
388
403
  facialRecognition = () => {
404
+ if (this.isFileSuccuse()) {
389
405
  this.setState({
390
406
  faceCustomerType: 1,
391
407
  titleModal: '人脸识别'
392
408
  })
393
- this.selectCustomer()
409
+ this.selectCustomer('facial')
410
+ }
394
411
  };
395
412
  ocrClick = () => {
413
+ if (this.isFileSuccuse()) {
396
414
  this.setState({
397
415
  faceCustomerType: 2,
398
416
  titleModal: 'OCR识别'
399
417
  })
400
- this.selectCustomer()
418
+ this.selectCustomer('ocr')
419
+ }
401
420
  };
402
421
  endSessionValue = () => {
403
422
  this.test_controller.LeaveRoom()
@@ -1045,7 +1064,7 @@ class Video extends Component {
1045
1064
  let outcanvas = document.createElement("canvas");
1046
1065
  outcanvas.width = canvas.width;
1047
1066
  outcanvas.height = canvas.height;
1048
- ctx.strokeStyle = "#db0011";
1067
+ ctx.strokeStyle = this.props.voiceColor;
1049
1068
  ctx.lineWidth = 2;
1050
1069
  ctx.clearRect(0, 0, canvas.width, canvas.height); //清理画布
1051
1070
  let dataArray = new Uint8Array(analyser.frequencyBinCount);
@@ -1285,11 +1304,8 @@ class Video extends Component {
1285
1304
  }
1286
1305
  };
1287
1306
  isFileSuccuse = () => {
1288
- if (!this.state.sessionId) {
1289
- return false
1290
- } else if (this.state.isSuspend) {
1291
- return false
1292
- } else if (!this.state.isCustomer) {
1307
+ if (!this.state.sessionId || this.state.isSuspend || !this.state.isCustomer) {
1308
+ message.success(this.props.prohibitPrompt)
1293
1309
  return false
1294
1310
  } else {
1295
1311
  return true
@@ -1591,6 +1607,8 @@ class Video extends Component {
1591
1607
  }
1592
1608
  console.log(sid)
1593
1609
  this.setState({
1610
+ clickedFacial: false,
1611
+ clickedOcr: false,
1594
1612
  faceCustomerUid: item.customId,
1595
1613
  isModalVisibleFacial: true,
1596
1614
  facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
@@ -1695,6 +1713,20 @@ class Video extends Component {
1695
1713
  })
1696
1714
  }
1697
1715
  }
1716
+ facialHandleVisibleChange=(value)=>{
1717
+ if(!value) {
1718
+ this.setState({
1719
+ clickedFacial: false
1720
+ })
1721
+ }
1722
+ }
1723
+ ocrHandleVisibleChange=(value)=>{
1724
+ if(!value) {
1725
+ this.setState({
1726
+ clickedOcr: false
1727
+ })
1728
+ }
1729
+ }
1698
1730
  render() {
1699
1731
  var pdfChildren
1700
1732
  if (this.props.children) {
@@ -1752,7 +1784,7 @@ class Video extends Component {
1752
1784
  />
1753
1785
  <audio id="audio1" autoPlay />
1754
1786
  <label style={{ display: 'none' }} id="feedId1" type="text" />
1755
- <div style={{ display: (this.state.isCustomer) ? '' : 'none', }} className='customerTitle'>客户</div>
1787
+ <div style={{ display: (this.state.isCustomer) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor }} className='customerTitle'>客户</div>
1756
1788
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView1" width="40" height="70"></canvas>
1757
1789
  </div>
1758
1790
  </div>
@@ -1792,7 +1824,7 @@ class Video extends Component {
1792
1824
  />
1793
1825
  <audio id="audio1" autoPlay />
1794
1826
  <label style={{ display: 'none' }} id="publish_streamId1" type="text" />
1795
- <div style={{ display: (this.state.isCustomer) ? '' : 'none', }} className='tellerTitle'>坐席</div>
1827
+ <div style={{ display: (this.state.isCustomer) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor}} className='tellerTitle'>坐席</div>
1796
1828
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClass" id="publish_volumeView" width="40" height="70"></canvas>
1797
1829
  </div>
1798
1830
 
@@ -1873,7 +1905,11 @@ class Video extends Component {
1873
1905
  suspendName={this.state.suspendName}
1874
1906
  cameraImg={this.state.cameraImg}
1875
1907
  customerList={this.state.customerList}
1908
+ clickedOcr={this.state.clickedOcr}
1909
+ clickedFacial={this.state.clickedFacial}
1876
1910
  suspend={this.suspend}
1911
+ facialHandleVisibleChange={this.facialHandleVisibleChange}
1912
+ ocrHandleVisibleChange={this.ocrHandleVisibleChange}
1877
1913
  voice={this.voice}
1878
1914
  cameraClick={this.cameraClick}
1879
1915
  sharedScreen={this.sharedScreen}
@@ -1951,5 +1987,9 @@ Video.defaultProps = {
1951
1987
  callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
1952
1988
  roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
1953
1989
  resourcePath: 'https://counter-web.leimondata.cn:7199',
1990
+ prohibitPrompt: '当前无客户',
1991
+ voiceColor: '#db0011',
1992
+ titleBackground: 'rgba(219, 0, 17, 0.1)',
1993
+ titleColor: '#DB0011'
1954
1994
  }
1955
1995
  export default Video
@@ -188,9 +188,9 @@ border-radius: 0px 0px 2px 2px;
188
188
  width: 80px;
189
189
  line-height: 30px;
190
190
  height: 30px;
191
- background: rgba(219, 0, 17, 0.1);
191
+ // background: rgba(219, 0, 17, 0.1);
192
192
  border-radius: 4px 0px 2px 0px;
193
- color: #DB0011;
193
+ // color: #DB0011;
194
194
  font-size: 14px;
195
195
  }
196
196
  .tellerTitle{
@@ -200,10 +200,9 @@ border-radius: 0px 0px 2px 2px;
200
200
  width: 80px;
201
201
  line-height: 30px;
202
202
  height: 30px;
203
- background: rgba(219, 0, 17, 0.1);
203
+ // background: rgba(219, 0, 17, 0.1);
204
204
  border-radius: 4px 0px 2px 0px;
205
- transform: rotateY(
206
- 180deg);
207
- color: #DB0011;
205
+ transform: rotateY(180deg);
206
+ // color: #DB0011;
208
207
  font-size: 14px;
209
208
  }