react_hsbc_teller 2.0.52 → 2.0.54

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.52",
3
+ "version": "2.0.54",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -63,7 +63,7 @@ import MultiModule from '../multiModule/multiModule'//签字、抄录
63
63
  import axios from 'axios';
64
64
  import CryptoJS from "crypto-js";
65
65
 
66
- const SDK_VERISON = '2.0.52'
66
+ const SDK_VERISON = '2.0.54'
67
67
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
68
68
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
69
69
  const { Option } = Select;
@@ -708,30 +708,43 @@ class Video extends Component {
708
708
  // height: 180 * SCALE
709
709
  // }
710
710
  ]
711
+ // 变更需求:之前是从接口获取ios不同屏幕的布局适配
712
+ // 现在由于原生有竖屏投屏,跟客户沟通可改成正方形区域,宽高自适应
711
713
  Array.isArray(res) ?
712
714
  res.map((item) => {
713
715
  list.push({
714
716
  tag: item.tag,
715
- xPosition: (item.xaxis * SCALE),
716
- yPosition: (item.yaxis * SCALE),
717
- width: (item.width * SCALE),
718
- height: (item.height * SCALE)
717
+ xPosition: 860 * SCALE,
718
+ yPosition: 235 * SCALE,
719
+ width: (420 * SCALE),
720
+ height: (420 * SCALE)
719
721
  })
720
722
  }) :
721
723
  list.push({
722
724
  tag: 'VIDEO_SOURCE_SCREEN',
723
- xPosition: 960 * SCALE,
724
- yPosition: 535 * SCALE,
725
- width: 320 * SCALE,
726
- height: 180 * SCALE
725
+ xPosition: 860 * SCALE,
726
+ yPosition: 235 * SCALE,
727
+ width: (420 * SCALE),
728
+ height: (420 * SCALE)
727
729
  })
728
- // list.push({
729
- // tag: 'VIDEO_SOURCE_SCREEN_19_9',
730
- // xPosition: 960,
731
- // yPosition: 573,
732
- // width: 304,
733
- // height: 144
734
- // })
730
+ // Array.isArray(res) ?
731
+ // res.map((item) => {
732
+ // list.push({
733
+ // tag: item.tag,
734
+ // xPosition: (item.xaxis * SCALE),
735
+ // yPosition: (item.yaxis * SCALE),
736
+ // width: (item.width * SCALE),
737
+ // height: (item.height * SCALE)
738
+ // })
739
+ // }) :
740
+ // list.push({
741
+ // tag: 'VIDEO_SOURCE_SCREEN',
742
+ // xPosition: 960 * SCALE,
743
+ // yPosition: 535 * SCALE,
744
+ // width: 320 * SCALE,
745
+ // height: 180 * SCALE
746
+ // })
747
+
735
748
  const filePath = 'recordId_' + new Date().valueOf();
736
749
  const recordParam = {};
737
750
  recordParam.width = 1280 * SCALE;
@@ -4836,6 +4849,8 @@ class Video extends Component {
4836
4849
  // })
4837
4850
  } else {
4838
4851
  console.log('身份证ocr')
4852
+ const idCardName = this.state.idCardName
4853
+ const documentType = this.state.documentType
4839
4854
  // 身份证,进行人脸识别后再入库
4840
4855
  this.state.userIdCardResults[this.state.faceCustomerUid] = {
4841
4856
  idCardName: this.state.idCardName,
@@ -4873,6 +4888,14 @@ class Video extends Component {
4873
4888
  setTimeout(() => {
4874
4889
  this.publishVideoTwo()
4875
4890
  }, 0);
4891
+
4892
+ // 保存图片到本地
4893
+ setTimeout(() => {
4894
+ combineBase64Images(this.state.facialImgFront, this.state.facialImgBack, (base64Image)=>{
4895
+ saveBase64Image(base64Image, `${idCardName}-${documentType}`)
4896
+ })
4897
+ }, 100);
4898
+
4876
4899
  }
4877
4900
  }
4878
4901
  // ocr结果入库
@@ -4927,10 +4950,10 @@ class Video extends Component {
4927
4950
  if (this.state.documentType == 'HK_MO_RESIDENCE_CARD' || this.state.documentType == 'TW_RESIDENCE_CARD') {
4928
4951
  // 居住证正反面需要拼接成一张图
4929
4952
  combineBase64Images(this.state.facialImgFront, this.state.facialImgBack, (base64Image)=>{
4930
- saveBase64Image(base64Image, `${data.idCardName}-${this.state.documentType}`)
4953
+ saveBase64Image(base64Image, `${data.reviseIdCardName||data.idCardName}-${this.state.documentType}`)
4931
4954
  })
4932
4955
  } else {
4933
- saveBase64Image(this.state.facialImgFront, `${data.idCardName}-${this.state.documentType}`)
4956
+ saveBase64Image(this.state.facialImgFront, `${data.reviseIdCardName||data.idCardName}-${this.state.documentType}`)
4934
4957
  }
4935
4958
  } else {
4936
4959
  console.log('1')
@@ -5223,11 +5246,6 @@ class Video extends Component {
5223
5246
  if (this.state.isPictureInPicture) {
5224
5247
  this.pictureInPicture('Refresh')
5225
5248
  }
5226
- // console.log(this.state.facialImgFront)
5227
- // console.log(`${data.idCardName}-${this.state.documentType}`)
5228
- combineBase64Images(this.state.facialImgFront, this.state.facialImgBack, (base64Image)=>{
5229
- saveBase64Image(base64Image, `${data.idCardName}-${this.state.documentType}`)
5230
- })
5231
5249
  } else {
5232
5250
  console.log('1')
5233
5251
  this.messageClick('保持信息失败', 'error')
@@ -179,7 +179,7 @@ function saveBase64Image(base64Data, fileName) {
179
179
  // 创建一个a标签用于下载
180
180
  let link = document.createElement('a');
181
181
  link.href = url;
182
- link.download = fileName;
182
+ link.download = fileName + '.jpg';
183
183
  document.body.appendChild(link);
184
184
 
185
185
  // 触发下载