react_hsbc_teller 1.9.33 → 1.9.35

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.9.33",
3
+ "version": "1.9.35",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -69,7 +69,7 @@ countTimer = () => {
69
69
  }
70
70
 
71
71
  render() {
72
- console.log('22',this.props)
72
+ // console.log('22',this.props)
73
73
  return (
74
74
  <div className="test" style={{width: this.props.width,height:this.props.height}}>
75
75
  {
@@ -47,7 +47,7 @@ import Step from '../components/step/step.jsx'
47
47
  import axios from 'axios';
48
48
  import CryptoJS from "crypto-js";
49
49
 
50
- const SDK_VERISON = '1.9.33'
50
+ const SDK_VERISON = '1.9.35'
51
51
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
52
52
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
53
53
  const { Option } = Select;
@@ -72,6 +72,8 @@ let isSuccuseHs = false
72
72
  let isGraffiti = false
73
73
  let strokeColor = '#333'
74
74
  let clearTime
75
+ let beautyMode = 'none'
76
+ let hsMode = 'none'
75
77
  let CanvasHome = styled.div`
76
78
  position: fixed;
77
79
  z-index: ${props => props.zIndexNum};
@@ -117,7 +119,7 @@ function clearStreamRemain() {
117
119
  };
118
120
  async function startBeauty(stream) {
119
121
  await beautyInit();
120
- beautyStart(stream, "none");
122
+ beautyStart(stream, beautyMode);
121
123
  }
122
124
  async function startMix(stream, onState) {
123
125
  var drawCanvas = document.getElementById('canvas');
@@ -133,21 +135,25 @@ async function startHs(stream) {
133
135
 
134
136
  await hsInit();
135
137
 
136
- hsStart(stream, 'none');
138
+ hsStart(stream, hsMode);
137
139
 
138
140
  }
139
141
 
140
142
  async function stopHs() {
141
- var stop_stream = true;//控制是否内部来进行关闭流
142
- var stream = hsStop(stop_stream);
143
- if (stream != null && stream != undefined) {
144
- stream.getTracks().forEach((track) => {
145
- track.stop();
146
- });
147
- stream = null;
143
+ try {
144
+ var stop_stream = true;//控制是否内部来进行关闭流
145
+ var stream = hsStop(stop_stream);
146
+ if (stream != null && stream != undefined) {
147
+ stream.getTracks().forEach((track) => {
148
+ track.stop();
149
+ });
150
+ stream = null;
151
+ }
152
+ isSuccuseHs = false
153
+ } catch (err) {
154
+ console.log('stopHs Error')
155
+ console.log(err)
148
156
  }
149
- isSuccuseHs = false
150
-
151
157
  }
152
158
  async function mixStopClick() {
153
159
  var stop_stream = true;//控制是否内部来进行关闭流
@@ -1779,10 +1785,12 @@ class Video extends Component {
1779
1785
  console.log('tag1', stream)
1780
1786
  let newStream = stream;
1781
1787
  if (stream.getVideoTracks()[0]) {
1782
- await startBeauty(newStream);
1783
- newStream = beautyCaptureStream();
1784
- await startHs(newStream);
1785
- newStream = hsCaptureStream();
1788
+ if (this.state.beautyType || isSuccuseHs){
1789
+ await startBeauty(newStream);
1790
+ newStream = beautyCaptureStream();
1791
+ await startHs(newStream);
1792
+ newStream = hsCaptureStream();
1793
+ }
1786
1794
  // 清理原始流
1787
1795
  newStream.oninactive = function () {
1788
1796
  clearOriginStream(stream);
@@ -4633,16 +4641,39 @@ class Video extends Component {
4633
4641
  this.setState({
4634
4642
  beautyName: '开启美颜'
4635
4643
  })
4644
+ beautyMode = 'none'
4636
4645
  beautySetMode('none')
4646
+ beautyStop()
4647
+ if(!isSuccuseHs) {
4648
+ stopHs()
4649
+ }
4637
4650
  } else {
4638
4651
  this.state.beautyType = true
4652
+ beautyMode = 'beauty'
4639
4653
  beautySetMode('beauty')
4640
4654
  this.setState({
4641
4655
  beautyName: '关闭美颜'
4642
4656
  })
4643
4657
  }
4658
+ this.changeMediaStream();
4644
4659
 
4645
4660
  }
4661
+ changeMediaStream = () => {
4662
+ let publish_config = {}
4663
+ publish_config.sid = document.getElementById('publish_video1').name
4664
+ publish_config.media_type = 1
4665
+ publish_config.publish_device = 1
4666
+ // publish_config.videoSource = this.state.cameraValue
4667
+ // publish_config.audioSource = this.state.microphoneValue
4668
+ publish_config.need_volume_analyser = true
4669
+ publish_config.video_profile_type = 100
4670
+ publish_config.video_profile_diy = { width: 640, height: 360, frameRate: 15, bitrate: 400 }
4671
+ // publish_config.publish_video_id = 'publish_video1'
4672
+ // publish_config.publish_streamId_id = 'publish_streamId1'
4673
+ // publish_config.publish_tag = 'tag1'
4674
+ this.test_controller.ChangeMediaStream(publish_config)
4675
+ }
4676
+
4646
4677
  componentDidMount() {
4647
4678
  var box = document.getElementById("whiteboardDIV");
4648
4679
  var box1 = document.getElementById("operate")
@@ -4794,11 +4825,18 @@ class Video extends Component {
4794
4825
  if (!isSuccuseHs) {
4795
4826
 
4796
4827
  hsSetMode('blur')
4828
+ hsMode = 'blur'
4797
4829
  isSuccuseHs = true
4798
4830
  } else {
4799
4831
  hsSetMode('none')
4832
+ hsMode = 'none'
4800
4833
  isSuccuseHs = false
4834
+ stopHs()
4835
+ if(!this.state.beautyType) {
4836
+ beautyStop()
4837
+ }
4801
4838
  }
4839
+ this.changeMediaStream();
4802
4840
  }
4803
4841
  virtualization = () => {
4804
4842
  this.virtualizationClick()
@@ -4825,6 +4863,17 @@ class Video extends Component {
4825
4863
  return false;
4826
4864
  }
4827
4865
  }
4866
+ isHKPassValidTime=(value)=>{
4867
+ if (!value.split('.') || value.split('.').length < 3 || value.split('.').some(el => el == '')) return false;
4868
+ let start = new Date('2020.01.01').valueOf();
4869
+ let end = new Date('2023.12.31').valueOf();
4870
+ var time = new Date(value).valueOf();
4871
+ if(start<=time && end >= time ){
4872
+ return true;
4873
+ }else{
4874
+ return false;
4875
+ }
4876
+ }
4828
4877
  handleChangeCertificateValidity = (event) => {
4829
4878
  // 护照只有起始日期,单独处理
4830
4879
  if (this.state.documentType == 'PASSPORT_CARD' && event.target.value.split('.').length >2) {
@@ -4845,6 +4894,12 @@ class Video extends Component {
4845
4894
  certificateValidity: event.target.value,
4846
4895
  certificateValidityType: true
4847
4896
  });
4897
+ } else if (this.state.documentType == 'HK_MO_PASS_CARD' && this.isHKPassValidTime(event.target.value.split('-')[1])){
4898
+ // 疫情政策对港澳来往通行证放宽限制,有效期限从2020.1.1到2023.12.31都算有效
4899
+ this.setState({
4900
+ certificateValidity: event.target.value,
4901
+ certificateValidityType: true
4902
+ });
4848
4903
  } else {
4849
4904
  this.setState({
4850
4905
  certificateValidity: event.target.value,