react_hsbc_teller 0.1.5 → 0.1.9

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.1.5",
3
+ "version": "0.1.9",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -84,6 +84,7 @@
84
84
  "webpackbar": "^4.0.0"
85
85
  },
86
86
  "dependencies": {
87
+ "@babel/plugin-proposal-decorators": "^7.16.4",
87
88
  "antd": "^4.16.13",
88
89
  "axios": "0.19.0",
89
90
  "react": "^17.0.1",
@@ -4,9 +4,9 @@
4
4
  let baseURL;
5
5
  // let imgUrl = '//elm.cangdu.org/img/';
6
6
  if(process.env.NODE_ENV === 'development'){
7
- baseURL = 'http://47.102.126.132:8082/api/leimon-counter-api';
7
+ baseURL = 'https://counter-web.leimondata.cn:18082/api/leimon-counter-api';
8
8
  }else{
9
- baseURL = 'http://47.102.126.132:8082/api/leimon-counter-api';
9
+ baseURL = 'https://counter-web.leimondata.cn:18082/api/leimon-counter-api';
10
10
  }
11
11
 
12
12
 
@@ -45,9 +45,7 @@ export default class foot extends Component {
45
45
  }
46
46
  customerFaceClick=(item)=>{
47
47
  this.setState({
48
- clicked: false
49
- })
50
- this.setState({
48
+ clicked: false,
51
49
  clickedOcr: false
52
50
  })
53
51
  this.props.customerFaceClick(item)
@@ -88,7 +86,7 @@ export default class foot extends Component {
88
86
  <div className="one" onClick={this.transcribingClick.bind(this)}>
89
87
  <img src={require("../../assets/img/icon_copy.png").default} alt="" />
90
88
  <div className="text">
91
- 抄录
89
+ 签字
92
90
  </div>
93
91
  </div>
94
92
  }
@@ -5,7 +5,10 @@ import { IntlProvider } from 'react-intl';
5
5
 
6
6
  class Main extends Component {
7
7
  state = {
8
- langPackage: {}
8
+ langPackage: {
9
+ en: {},
10
+ zh: {},
11
+ }
9
12
  };
10
13
 
11
14
  // 获取语言包
@@ -22,12 +25,16 @@ class Main extends Component {
22
25
  }
23
26
  componentWillMount() {
24
27
  localStorage.setItem("a_lang", this.props.lang)
25
- this.setState({langPackage: JSON.parse(localStorage.getItem("langData"))})
28
+ if (localStorage.getItem("langData")){
29
+ this.setState({langPackage: JSON.parse(localStorage.getItem("langData"))})
30
+ }
31
+ // console.log(JSON.parse(localStorage.getItem("langData")))
26
32
  this.updateLanguage()
27
33
  }
28
34
 
29
35
  render() {
30
36
  const lang = this.props.lang
37
+ // console.log(this.state.langPackage[lang])
31
38
  return (
32
39
  <IntlProvider locale={lang} messages={this.state.langPackage[lang]}>
33
40
  <Video {...this.props}></Video>
@@ -16,6 +16,8 @@ import Modal from "antd/lib/modal";
16
16
  import 'antd/lib/modal/style'
17
17
  import message from "antd/lib/message";
18
18
  import 'antd/lib/message/style'
19
+ import Spin from "antd/lib/spin";
20
+ import 'antd/lib/spin/style'
19
21
  import { Button } from '../../../node_modules/antd/lib/index';
20
22
  import CanvasDraw from "react-canvas-draw";
21
23
  import { FormattedMessage, injectIntl } from 'react-intl';
@@ -23,12 +25,12 @@ const LEAVE_TYPE = {
23
25
  TELLER_EXIT: '1', // 坐席退出
24
26
  ROOM_DESTROYED: '-1', // 房间异常
25
27
  }
26
-
28
+ @injectIntl
27
29
  class Video extends Component {
28
30
  signCanvas = React.createRef();
29
31
  state = {
32
+ loading: false,
30
33
  isModalVisibleSign: false,
31
- signData: {},
32
34
  titleModal: '人脸识别',
33
35
  faceCustomerType: 1, // 1无感人脸,2ocr
34
36
  faceCustomerUid: '',
@@ -36,8 +38,6 @@ class Video extends Component {
36
38
  employeeNumber: '',
37
39
  employeeName: '',
38
40
  isModalVisibleInvitation: false,
39
- isTranscribing: false,
40
- transcribingData: '',
41
41
  isPDF: false,
42
42
  roomCustomerList: [],
43
43
  facialImg: '',
@@ -86,9 +86,7 @@ class Video extends Component {
86
86
  });
87
87
  console.log(result);
88
88
  this.setState({
89
- imRoomId: result.imRoomId
90
- });
91
- this.setState({
89
+ imRoomId: result.imRoomId,
92
90
  sessionId: result.sessionId
93
91
  });
94
92
  // eslint-disable-next-line no-undef
@@ -108,15 +106,8 @@ class Video extends Component {
108
106
  console.log(result);
109
107
  window.sessionStorage.setItem('alimpassSig', result.mpsSig);
110
108
  this.setState({
111
- workSpaceId: result.workSpaceId
112
- });
113
- this.setState({
114
- appId: result.appId
115
- });
116
- this.setState({
117
- bizName: result.bizName
118
- });
119
- this.setState({
109
+ workSpaceId: result.workSpaceId,
110
+ appId: result.appId,
120
111
  bizName: result.bizName
121
112
  });
122
113
  window.sessionStorage.setItem('sigData', JSON.stringify(result));
@@ -379,18 +370,14 @@ class Video extends Component {
379
370
  // 人脸识别
380
371
  facialRecognition = () => {
381
372
  this.setState({
382
- faceCustomerType: 1
383
- })
384
- this.setState({
373
+ faceCustomerType: 1,
385
374
  titleModal: '人脸识别'
386
375
  })
387
376
  this.selectCustomer()
388
377
  };
389
378
  ocrClick = () => {
390
379
  this.setState({
391
- faceCustomerType: 2
392
- })
393
- this.setState({
380
+ faceCustomerType: 2,
394
381
  titleModal: 'OCR识别'
395
382
  })
396
383
  this.selectCustomer()
@@ -527,22 +514,6 @@ class Video extends Component {
527
514
  if (Mival.sessionId == this.state.sessionId) {
528
515
  this.endSession('customerHangUp')
529
516
  }
530
- } else if (Mival.typeId == 1214) {
531
- console.log(Mival);
532
- if (Mival.sessionId == this.state.sessionId) {
533
- this.setState({
534
- transcribingData: Mival
535
- });
536
- this.setState({
537
- isTranscribing: true
538
- })
539
- }
540
-
541
- } else if (Mival.typeId == 1216) {
542
- this.setState({
543
- signData: Mival.callbackUrl,
544
- isModalVisibleSign: true
545
- })
546
517
  }
547
518
  };
548
519
 
@@ -646,8 +617,10 @@ class Video extends Component {
646
617
 
647
618
  this.test_controller.OnCreateRoomSucc = (room_id, rtoken) => {
648
619
  console.log('创建房间成功', room_id, rtoken);
649
- this.setState({ channelId: room_id });
650
- this.setState({ rtoken: rtoken });
620
+ this.setState({
621
+ channelId: room_id,
622
+ rtoken: rtoken
623
+ });
651
624
  this.createRoom()
652
625
  };
653
626
  // 创建房间失败
@@ -927,16 +900,12 @@ class Video extends Component {
927
900
  })
928
901
  });
929
902
  this.setState({
930
- isSharedScreen: true
931
- });
932
- this.setState({
903
+ isSharedScreen: true,
933
904
  screenName: '取消共享'
934
- })
935
- } else {
936
- this.setState({
937
- isSharedScreen: false
938
905
  });
906
+ } else {
939
907
  this.setState({
908
+ isSharedScreen: false,
940
909
  screenName: '投屏'
941
910
  });
942
911
  callNimIM('sendCustomCmdMsg', {
@@ -1115,36 +1084,37 @@ class Video extends Component {
1115
1084
  }
1116
1085
  }
1117
1086
  addToScript = () => {
1087
+ this.setState({
1088
+ loading: true,
1089
+ })
1118
1090
  const _dependScripts = [
1119
- "http://dns.leimon.xyz/log4b.js",
1120
- "http://dns.leimon.xyz/meeting_api_util.js",
1121
- "http://dns.leimon.xyz/mcu.js",
1122
- "http://dns.leimon.xyz/client_record.js",
1123
- "http://dns.leimon.xyz/meeting_vod.js",
1124
- "http://dns.leimon.xyz/remote_record.js",
1125
- "http://dns.leimon.xyz/meeting_invite.js",
1126
- "http://dns.leimon.xyz/meeting_im.js",
1127
- "http://dns.leimon.xyz/meeting_camera_stream.js",
1128
- "http://dns.leimon.xyz/meeting_file_stream.js",
1129
- "http://dns.leimon.xyz/meeting_desk_stream.js",
1130
- "http://dns.leimon.xyz/meeting_html_stream.js",
1131
- "http://dns.leimon.xyz/meeting_beautify_stream.js",
1132
- "http://dns.leimon.xyz/stream.js",
1133
- "http://dns.leimon.xyz/room.js",
1134
- "http://dns.leimon.xyz/backgroundBlur.js",
1135
- "http://dns.leimon.xyz/meeting_api.js",
1136
- "http://dns.leimon.xyz/html2image.js",
1137
- "http://dns.leimon.xyz/reconnecting-websocket.min.js",
1138
- "http://dns.leimon.xyz/mtc_api.js",
1139
- "http://dns.leimon.xyz/BandwidthHandler.js",
1091
+ "https://counter-web.leimondata.cn:7199/log4b.js",
1092
+ "https://counter-web.leimondata.cn:7199/meeting_api_util.js",
1093
+ "https://counter-web.leimondata.cn:7199/mcu.js",
1094
+ "https://counter-web.leimondata.cn:7199/client_record.js",
1095
+ "https://counter-web.leimondata.cn:7199/meeting_vod.js",
1096
+ "https://counter-web.leimondata.cn:7199/remote_record.js",
1097
+ "https://counter-web.leimondata.cn:7199/meeting_invite.js",
1098
+ "https://counter-web.leimondata.cn:7199/meeting_im.js",
1099
+ "https://counter-web.leimondata.cn:7199/meeting_camera_stream.js",
1100
+ "https://counter-web.leimondata.cn:7199/meeting_file_stream.js",
1101
+ "https://counter-web.leimondata.cn:7199/meeting_desk_stream.js",
1102
+ "https://counter-web.leimondata.cn:7199/meeting_html_stream.js",
1103
+ "https://counter-web.leimondata.cn:7199/meeting_beautify_stream.js",
1104
+ "https://counter-web.leimondata.cn:7199/stream.js",
1105
+ "https://counter-web.leimondata.cn:7199/room.js",
1106
+ "https://counter-web.leimondata.cn:7199/backgroundBlur.js",
1107
+ "https://counter-web.leimondata.cn:7199/meeting_api.js",
1108
+ "https://counter-web.leimondata.cn:7199/html2image.js",
1109
+ "https://counter-web.leimondata.cn:7199/reconnecting-websocket.min.js",
1110
+ "https://counter-web.leimondata.cn:7199/mtc_api.js",
1111
+ "https://counter-web.leimondata.cn:7199/BandwidthHandler.js",
1140
1112
  "https://gw.alipayobjects.com/os/lib/recordrtc/5.5.9/RecordRTC.min.js",
1141
- "https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.2",
1142
- "https://cdn.jsdelivr.net/npm/@tensorflow-models/body-pix@2.0",
1143
- "http://dns.leimon.xyz/pdf.js",
1144
- "http://dns.leimon.xyz/EBML.js",
1145
- "http://dns.leimon.xyz/adapter.js",
1146
- "http://dns.leimon.xyz/beauty.js",
1147
- "http://dns.leimon.xyz/getMediaInfo.js",
1113
+ "https://counter-web.leimondata.cn:7199/pdf.js",
1114
+ "https://counter-web.leimondata.cn:7199/EBML.js",
1115
+ "https://counter-web.leimondata.cn:7199/adapter.js",
1116
+ "https://counter-web.leimondata.cn:7199/beauty.js",
1117
+ "https://counter-web.leimondata.cn:7199/getMediaInfo.js",
1148
1118
  ]
1149
1119
  const that = this
1150
1120
  let i = 0
@@ -1168,6 +1138,9 @@ class Video extends Component {
1168
1138
  script.onload = () => {
1169
1139
  that.test_controller = new McuController();
1170
1140
  that.mountClick()
1141
+ that.setState({
1142
+ loading: false,
1143
+ })
1171
1144
  }
1172
1145
  }
1173
1146
  } else {
@@ -1208,9 +1181,7 @@ class Video extends Component {
1208
1181
  if (!this.state.voiceStatue) {
1209
1182
  // 静音本地
1210
1183
  this.setState({
1211
- voiceStatue: true
1212
- });
1213
- this.setState({
1184
+ voiceStatue: true,
1214
1185
  voiceImg: voiceImgCloe
1215
1186
  });
1216
1187
  let sid = document.getElementById('publish_video1').name;
@@ -1232,9 +1203,7 @@ class Video extends Component {
1232
1203
  } else if (this.state.voiceStatue) {
1233
1204
  // 打开本地
1234
1205
  this.setState({
1235
- voiceStatue: false
1236
- });
1237
- this.setState({
1206
+ voiceStatue: false,
1238
1207
  voiceImg: voiceImgOpen
1239
1208
  });
1240
1209
  let sid = document.getElementById('publish_video1').name;
@@ -1270,9 +1239,7 @@ class Video extends Component {
1270
1239
  if (this.isFileSuccuse()) {
1271
1240
  if (!this.state.audioed) {
1272
1241
  this.setState({
1273
- audioed: true
1274
- });
1275
- this.setState({
1242
+ audioed: true,
1276
1243
  cameraImg: cameraImgCloe
1277
1244
  });
1278
1245
  let sid = document.getElementById('publish_video1').name;
@@ -1294,9 +1261,7 @@ class Video extends Component {
1294
1261
  })
1295
1262
  } else if (this.state.audioed) {
1296
1263
  this.setState({
1297
- audioed: false
1298
- });
1299
- this.setState({
1264
+ audioed: false,
1300
1265
  cameraImg: cameraImgOpen
1301
1266
  });
1302
1267
  let sid = document.getElementById('publish_video1').name;
@@ -1329,14 +1294,10 @@ class Video extends Component {
1329
1294
  publish_config.video_profile_type = 5;
1330
1295
  this.test_controller.ChangeMediaStream(publish_config);
1331
1296
  this.setState({
1332
- publishDevic: 1
1333
- });
1334
- this.setState({
1297
+ publishDevic: 1,
1298
+ isSharedScreen: false,
1335
1299
  screenName: '投屏'
1336
1300
  });
1337
- this.setState({
1338
- isSharedScreen: false
1339
- })
1340
1301
  } else {
1341
1302
  publish_config.media_type = 1;
1342
1303
  publish_config.publish_device = 2;
@@ -1353,9 +1314,7 @@ class Video extends Component {
1353
1314
  if (this.state.isSuspend) {
1354
1315
  // 代表此时按钮是恢复会话,把isSuspend改成true变成暂停会话
1355
1316
  this.setState({
1356
- isSuspend: false
1357
- });
1358
- this.setState({
1317
+ isSuspend: false,
1359
1318
  suspendName: '暂停'
1360
1319
  });
1361
1320
  let sid = document.getElementById('publish_video1').name;
@@ -1414,9 +1373,7 @@ class Video extends Component {
1414
1373
  console.log(data)
1415
1374
  });
1416
1375
  this.setState({
1417
- isSuspend: true
1418
- });
1419
- this.setState({
1376
+ isSuspend: true,
1420
1377
  suspendName: '恢复'
1421
1378
  });
1422
1379
  callNimIM('sendCustomCmdMsg', {
@@ -1472,10 +1429,10 @@ class Video extends Component {
1472
1429
  isModalVisibleFacial: false
1473
1430
  })
1474
1431
  };
1432
+ // 坐席签字
1475
1433
  transcribingClick = () => {
1476
- callNimIM('sendCustomCmdMsg', {
1477
- customId: this.state.imRoomId,
1478
- content: JSON.stringify(this.state.transcribingData)
1434
+ this.setState({
1435
+ isModalVisibleSign: true,
1479
1436
  })
1480
1437
  };
1481
1438
  invitationClick = () => {
@@ -1530,20 +1487,18 @@ class Video extends Component {
1530
1487
  }
1531
1488
  console.log(sid)
1532
1489
  this.setState({
1533
- faceCustomerUid: item.customId
1534
- })
1535
- this.setState({
1536
- isModalVisibleFacial: true
1537
- })
1538
- this.setState({
1490
+ faceCustomerUid: item.customId,
1491
+ isModalVisibleFacial: true,
1539
1492
  facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
1540
1493
  })
1541
1494
  }
1542
1495
  componentWillReceiveProps(props) {
1543
- this.setState({ channelId: props.roomId });
1544
- this.setState({ rtoken: props.mtoken });
1545
- this.setState({ sessionId: props.sessionId });
1546
- this.setState({ imRoomId: props.imRoomId });
1496
+ this.setState({
1497
+ channelId: props.roomId,
1498
+ rtoken: props.mtoken,
1499
+ sessionId: props.sessionId,
1500
+ imRoomId: props.imRoomId
1501
+ });
1547
1502
  }
1548
1503
  queryStaff = async () => {
1549
1504
  try {
@@ -1566,7 +1521,6 @@ class Video extends Component {
1566
1521
  try {
1567
1522
  let result = await API.counterSign({
1568
1523
  sessionId: this.state.sessionId,
1569
- callbackUrl: this.state.signData,
1570
1524
  file: data.file
1571
1525
  });
1572
1526
  console.log(result)
@@ -1574,7 +1528,6 @@ class Video extends Component {
1574
1528
  message.success('签字成功')
1575
1529
  this.setState({
1576
1530
  isModalVisibleSign: false,
1577
- signData: ''
1578
1531
  })
1579
1532
  } else {
1580
1533
  message.success('签字失败')
@@ -1591,7 +1544,9 @@ class Video extends Component {
1591
1544
  render() {
1592
1545
 
1593
1546
  return (
1547
+
1594
1548
  <div className="all">
1549
+ <Spin spinning={this.state.loading} tip="视频初始化中...">
1595
1550
  <Header></Header>
1596
1551
  <div className="health">
1597
1552
  <div className="wrapper">
@@ -1736,7 +1691,6 @@ class Video extends Component {
1736
1691
  screenName={this.state.screenName}
1737
1692
  suspendName={this.state.suspendName}
1738
1693
  cameraImg={this.state.cameraImg}
1739
- isTranscribing={this.state.isTranscribing}
1740
1694
  customerList={this.state.customerList}
1741
1695
  suspend={this.suspend}
1742
1696
  voice={this.voice}
@@ -1805,8 +1759,9 @@ class Video extends Component {
1805
1759
  <video className="mixedvideo" id="mixedvideo" autoPlay muted={true} width="0" height="0"
1806
1760
  webkit-playsinline="true" playsInline={true} x5-playsinline="x5-playsinline"
1807
1761
  x-webkit-airplay="true"></video>
1808
-
1762
+ </Spin>
1809
1763
  </div>
1764
+
1810
1765
  );
1811
1766
  }
1812
1767
  }
@@ -1816,4 +1771,4 @@ Video.defaultProps = {
1816
1771
  callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
1817
1772
 
1818
1773
  }
1819
- export default injectIntl(Video);
1774
+ export default Video
@@ -77,7 +77,7 @@
77
77
  }
78
78
  .health{
79
79
  margin: 20px;
80
- height: calc(100vh - 15px);
80
+ height: calc(100vh - 5px);
81
81
  }
82
82
  .all{
83
83
  height: 100%;
package/tsconfig.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "experimentalDecorators": true,
3
4
  "outDir": "./dist/",
4
5
  "sourceMap": true,
5
6
  "noImplicitAny": true,