react_hsbc_teller 2.0.12 → 2.0.14

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": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -492,7 +492,31 @@ class API extends Server{
492
492
  throw err;
493
493
  }
494
494
  }
495
-
495
+ /**
496
+ * 用途:查询分行名称
497
+ * @url https://api.cangdu.org/shopro/data/products
498
+ * 返回http_code为200表示成功
499
+ * @method post
500
+ * @return {promise}
501
+ */
502
+ async getBranchName(params = {}){
503
+ try{
504
+ let result = await this.axios('get', '/hsbc/getBranchName?branchCode=' + params.branchCode, params);
505
+ if(result && (result.data instanceof Object) && result.code === 200){
506
+ return result.data||[];
507
+ }else{
508
+ let err = {
509
+ tip: '分行名称获取失败',
510
+ response: result,
511
+ data: params,
512
+ // url: 'https://api.cangdu.org/shopro/data/products',
513
+ }
514
+ throw err;
515
+ }
516
+ }catch(err){
517
+ throw err;
518
+ }
519
+ }
496
520
  /**
497
521
  * 用途:人脸识别
498
522
  * @url https://elm.cangdu.org/v1/addimg/shop
@@ -53,7 +53,7 @@ import Step from '../components/step/step.jsx'
53
53
  import axios from 'axios';
54
54
  import CryptoJS from "crypto-js";
55
55
 
56
- const SDK_VERISON = '2.0.12'
56
+ const SDK_VERISON = '2.0.14'
57
57
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
58
58
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
59
59
  const { Option } = Select;
@@ -356,6 +356,7 @@ class Video extends Component {
356
356
  recordMode: this.props.recordMode,
357
357
  defaultBranchCode: this.props.defaultBranchCode,
358
358
  customerId: this.props.customerId,
359
+ customerType: this.props.customerType.toString(),
359
360
  salesBranchCode: this.props.salesBranchCode,
360
361
  financialOffice: this.props.financialOffice,
361
362
  roomId: this.state.channelId,
@@ -706,7 +707,7 @@ class Video extends Component {
706
707
  enable: true,
707
708
  xPosition: 640, // x 轴位置
708
709
  yPosition: 10, // y 轴位置
709
- text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.props.salesBranchCode || ''} ${this.props.financialOffice || ''}`,
710
+ text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.props.salesBranchCode || ''} ${this.state.branchName || ''} ${this.props.financialOffice || ''}`,
710
711
  fontSize: 16, // 字体⼤⼩
711
712
  url: '' // ⽔印图⽚ HTTP 地址
712
713
  },
@@ -1325,10 +1326,12 @@ class Video extends Component {
1325
1326
  }
1326
1327
 
1327
1328
  }
1329
+ cobj.fillStyle = '#333333';
1330
+ cobj.fillRect(0, 0, 640, baseStartHeight)
1328
1331
  // 录制中状态
1329
1332
  if (this.state.businessRecordId) {
1330
1333
  let str = '· 录制中'
1331
- cobj.fillStyle = '#F8F2F3';
1334
+ // cobj.fillStyle = '#F8F2F3';
1332
1335
  cobj.font = "normal lighter 30px sans-serif";
1333
1336
  // cobj.fillRect(0, 0, 640, recordBoxHeight)
1334
1337
  cobj.textAlign = 'center';
@@ -3448,6 +3451,21 @@ class Video extends Component {
3448
3451
  this.roomCallBack(2, '获取tiken失败', 'SYS-01')
3449
3452
  }
3450
3453
  }
3454
+ queryBranchName = async () => {
3455
+ try {
3456
+ let result = await API.getBranchName({
3457
+ branchCode: this.props.salesBranchCode
3458
+ })
3459
+ this.setState({
3460
+ branchName: result.branchName || ''
3461
+ })
3462
+ console.log('branchName', this.state.branchName)
3463
+ } catch (err) {
3464
+ console.error(err);
3465
+
3466
+ }
3467
+ }
3468
+
3451
3469
  getRoomStatus = async data => {
3452
3470
  try {
3453
3471
  let result = await API.getRoomStatus({
@@ -3599,6 +3617,20 @@ class Video extends Component {
3599
3617
  }
3600
3618
  componentWillMount() {
3601
3619
  console.log('hsbc_teller_sdk', SDK_VERISON)
3620
+ // window.document.startRecord = () => {
3621
+ // this.enableServerRecording();
3622
+ // }
3623
+ // window.document.stopRecord = (recordId) => {
3624
+ // this.test_controller.StopRemoteRecord(recordId || this.state.recordId)
3625
+ // }
3626
+ // window.document.detectNetworkWeak = () => {
3627
+ // console.log('detectNetworkWeak')
3628
+ // this.test_controller.detectNetworkWeak()
3629
+ // }
3630
+ // window.document.start = () => {
3631
+ // this.startFaceDetection();
3632
+ // this.startImageDetection();
3633
+ // }
3602
3634
  let arr = []
3603
3635
  for(let i=1;i<=12;i++){
3604
3636
  arr.push({
@@ -3632,6 +3664,10 @@ class Video extends Component {
3632
3664
  } else {
3633
3665
  this.addToScript()
3634
3666
  }
3667
+
3668
+ if (this.props.salesBranchCode) {
3669
+ this.queryBranchName()
3670
+ }
3635
3671
  }
3636
3672
 
3637
3673
  voice = () => {
@@ -5246,9 +5282,6 @@ class Video extends Component {
5246
5282
  networkStatus: '未知', // 网络状态 (已连接/未连接)
5247
5283
  cameraResult: this.state.cameraList.length>0 ? '合格': '不合格', // 摄像头检测
5248
5284
  microResult: this.state.microphoneList.length>0 ? '合格': '不合格', // 麦克风检测
5249
- jsHeapSizeLimit: '未知', // 上下文内可用堆的最大体积
5250
- totalJSHeapSize: '未知', // 已分配的堆体积
5251
- usedJSHeapSize: '未知', // 当前 JS 堆活跃段(segment)的体积
5252
5285
  lightResult: this.state.envInfo? this.state.envInfo.lightResult : '未知'
5253
5286
  }
5254
5287
 
@@ -5296,28 +5329,7 @@ class Video extends Component {
5296
5329
  }
5297
5330
 
5298
5331
  }
5299
- // 内存检测
5300
- if (performance.memory) {
5301
- const filterSize = (size) => {
5302
- if (!size) return ''
5303
- if (size < pow1024(1)) return size + ' B'
5304
- if (size < pow1024(2)) return (size / pow1024(1)).toFixed(2) + ' KB'
5305
- if (size < pow1024(3)) return (size / pow1024(2)).toFixed(2) + ' MB'
5306
- if (size < pow1024(4)) return (size / pow1024(3)).toFixed(2) + ' GB'
5307
- return (size / pow1024(4)).toFixed(2) + ' TB'
5308
- }
5309
5332
 
5310
- function pow1024(num) {
5311
- return Math.pow(1024, num)
5312
- }
5313
- envInfo.jsHeapSizeLimit = filterSize(performance.memory.jsHeapSizeLimit)
5314
- envInfo.totalJSHeapSize = filterSize(performance.memory.totalJSHeapSize)
5315
- envInfo.usedJSHeapSize = filterSize(performance.memory.usedJSHeapSize)
5316
- // console.log('上下文内可用堆的最大体积', envInfo.jsHeapSizeLimit)
5317
- // console.log('已分配的堆体积', envInfo.totalJSHeapSize)
5318
- // console.log('当前 JS 堆活跃段(segment)的体积', envInfo.usedJSHeapSize)
5319
- envInfo.memoryResult = '合格'
5320
- }
5321
5333
  // 背景曝光环境检测
5322
5334
  this.lightDetect()
5323
5335
 
@@ -5940,7 +5952,6 @@ class Video extends Component {
5940
5952
  const isEnvironmentOK = !this.state.loading &&
5941
5953
  this.state.envInfo.networkResult=='合格' &&
5942
5954
  this.state.envInfo.batteryResult=='合格' &&
5943
- this.state.envInfo.memoryResult=='合格' &&
5944
5955
  this.state.envInfo.cameraResult=='合格' &&
5945
5956
  this.state.envInfo.microResult=='合格' &&
5946
5957
  this.state.envInfo.lightResult=='合格'
@@ -6055,13 +6066,15 @@ class Video extends Component {
6055
6066
 
6056
6067
  </ul>
6057
6068
  </div>
6058
- {!this.state.loading && this.state.sessionId?
6059
- <QRCode
6060
- style={{'position': 'absolute', 'right': '10px', 'top': '-110px'}}
6069
+ {!this.state.loading && this.state.sessionType && this.state.sessionId?
6070
+ <div className='QRCode'>
6071
+ <QRCode
6061
6072
  value={this.state.sessionId} //value参数为生成二维码的链接
6062
- size={100} //二维码的宽高尺寸
6073
+ size={110} //二维码的宽高尺寸
6063
6074
  fgColor="#000000" //二维码的颜色
6064
- /> : null}
6075
+ />
6076
+ <div className='sessionDiv'>{this.state.sessionId.slice(0, 4)}-{this.state.sessionId.slice(4-this.state.sessionId.length)}</div>
6077
+ </div> : null}
6065
6078
  </div>
6066
6079
  }
6067
6080
 
@@ -6629,10 +6642,6 @@ class Video extends Component {
6629
6642
  key="2" className={this.state.envInfo.batteryResult=='不合格'? 'panel-error':''}>
6630
6643
  <p className='envClass'>电量:{this.state.envInfo.batteryLevel}({this.state.envInfo.batteryCharging})</p>
6631
6644
  </Panel>
6632
- <Panel header={<span>内存检测 - {this.state.envInfo.memoryResult} {this.state.envInfo.memoryResult=='不合格'? <img src={IconFail} />: <img src={IconSuccess} />}</span>}
6633
- key="1" className={this.state.envInfo.memoryResult=='不合格'? 'panel-error':''}>
6634
- <p className='envClass'>最大可用内存:{this.state.envInfo.jsHeapSizeLimit} ;当前已使用:{this.state.envInfo.usedJSHeapSize} </p>
6635
- </Panel>
6636
6645
  <Panel header={<span>摄像头设备 - {this.state.envInfo.cameraResult}{this.state.envInfo.cameraResult=='不合格'? <img src={IconFail} />: <img src={IconSuccess} />}</span>}
6637
6646
  key="3" className={this.state.envInfo.cameraResult=='不合格'? 'panel-error':''}>
6638
6647
  <div >
@@ -6717,6 +6726,7 @@ Video.defaultProps = {
6717
6726
  recordMode: 1, // 录制模式 1远程录制 2网点录制
6718
6727
  defaultBranchCode: "",// 员工网点缩写
6719
6728
  customerId: "", //客户号
6729
+ customerType: "", // 客户类型
6720
6730
  salesBranchCode: "", //网点编号(分行号)
6721
6731
  financialOffice: "", // 理财室
6722
6732
  staffName: '', // 坐席名称
@@ -276,6 +276,7 @@
276
276
  font-size: 22px;
277
277
  color: #222222;
278
278
  font-weight: 600;
279
+ transform: translateX(-100px);
279
280
  ul{
280
281
  li{
281
282
  list-style: none;
@@ -643,4 +644,22 @@ display: inline-flex;
643
644
  .imgDIV{
644
645
  margin: 0 !important;
645
646
  text-align:center;
646
- }
647
+ }
648
+ .QRCode{
649
+ position: absolute;
650
+ right: -200px;
651
+ top: 30px;
652
+ display: flex;
653
+ flex-direction: column;
654
+ align-items: center;
655
+ .sessionDiv{
656
+ background: #DB0011;
657
+ border-radius: 20px;
658
+ padding: 0 15px;
659
+ text-align: center;
660
+ line-height: 40px;
661
+ height: 40px;
662
+ color: white;
663
+ margin-top: 20px;
664
+ }
665
+ }