react_hsbc_teller 1.9.3 → 1.9.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": "1.9.3",
3
+ "version": "1.9.5",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -5,10 +5,18 @@ import Pdf from './pdf.js'
5
5
  class Demo extends Component {
6
6
  state = {
7
7
  shareMask: false,
8
- mtoken: "3c1b4badb7d7",
9
- roomId: "661841296389119",
10
- imRoomId: "iax56tSCD@conference.ls-im-xmpp.chinawp.dev.ali.cloud.cn.hsbc",
11
- sessionId: "iax56tSCD",
8
+ imRoomId
9
+ :
10
+ "IZLZMoTxj@conference.ls-im-xmpp.chinawp.dev.ali.cloud.cn.hsbc",
11
+ sessionId
12
+ :
13
+ "IZLZMoTxj",
14
+ mtoken
15
+ :
16
+ "bc084d8a922f",
17
+ roomId
18
+ :
19
+ "663912632731275",
12
20
  // roomId: '',
13
21
  // mtoken: '',
14
22
  // imRoomId: '',
@@ -31,7 +39,8 @@ sessionId: "iax56tSCD",
31
39
  microphoneSize: 50,
32
40
  fontSize: 14,
33
41
  fontFamily: 'auto',
34
- isTranscribing: false
42
+ isTranscribing: false,
43
+ userSide: 2
35
44
  }
36
45
  componentWillMount() {
37
46
  // if(window.localStorage.getItem('roomId')) {
@@ -158,6 +167,11 @@ createRoomCallback=(data)=>{
158
167
  joinRoomCallback=(data)=>{
159
168
  console.log('joinRoomCallback', data)
160
169
  }
170
+ handleChangeUserSide = (event) => {
171
+ this.setState({
172
+ userSide: event.target.value
173
+ })
174
+ }
161
175
  userExit =(val)=>{
162
176
      console.log(val)
163
177
  }
@@ -185,6 +199,7 @@ userExit =(val)=>{
185
199
  mtoken={this.state.mtoken}
186
200
  sessionId={this.state.sessionId}
187
201
  imRoomId={this.state.imRoomId}
202
+ userSide={this.state.userSide}
188
203
  prohibitPrompt={this.state.prohibitPrompt}
189
204
  voiceColor={this.state.voiceColor}
190
205
  titleBackground={this.state.titleBackground}
@@ -227,6 +242,7 @@ userExit =(val)=>{
227
242
  <div>sessionId: <input type="text" value={this.state.sessionId} onChange={this.handleChangeSessionId} /></div>
228
243
  <div>imRoomId: <input type="text" value={this.state.imRoomId} onChange={this.handleChangeImRoomId} /></div>
229
244
  <div>isTranscribing: <input type="text" value={this.state.isTranscribing} onChange={this.handleChangeisTranscribing} /></div>
245
+ <div>userSide: <input type="text" value={this.state.userSide} onChange={this.handleChangeUserSide} /></div>
230
246
 
231
247
  <button className="button" onClick={this.startVideo.bind(this)}>开启视频</button>
232
248
  </div>
@@ -351,7 +351,7 @@ class Video extends Component {
351
351
  saveLog = (val) => {
352
352
  axios({
353
353
  method: 'get',
354
- baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.3&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
354
+ baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.5&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
355
355
 
356
356
  }).then(res => {
357
357
 
@@ -774,28 +774,11 @@ class Video extends Component {
774
774
  })
775
775
  }
776
776
  };
777
- // contrastFaceVerify=()=>{
778
- // axios({
779
- // method: 'post',
780
- // url: 'http://182.92.184.31:8868/verify/face',
781
- // data: { // 这⾥data中的参数为requestBody参数,服务端需要使⽤@RequestBody注解进⾏获取
782
- // "username":"王明珍",
783
- // "num":"410425199510201037",
784
- // "fileBase64":this.state.facialImg.replace(/^data:image\/\w+;base64,/,"")
785
- // }
786
- // }).then((response) =>{
787
- // console.log(response.data);
788
- // if(response.data.code == 200){
789
- // this.messageClick('人脸识别成功','success')
790
- // this.setState({
791
- // isModalVisibleFacial: false
792
- // })
793
- // } else {
794
- // this.messageClick('人脸识别失败','error')
795
- // }
796
- // }).catch(function (error) {
797
- // })
798
- // }
777
+ errorCodeClick=(type,value)=>{
778
+ if(type == 'ocr'){
779
+
780
+ }
781
+ }
799
782
  contrastFaceVerify = async () => {
800
783
  try {
801
784
  let result = await API.contrastFaceVerify({
@@ -808,7 +791,7 @@ class Video extends Component {
808
791
  fileBase64: this.state.facialImg.replace(/^data:image\/\w+;base64,/, "")
809
792
  });
810
793
  console.log(result);
811
- if (result.code == 200) {
794
+ if (result.code == 200 || result.code == 201) {
812
795
  // this.messageClick('人脸识别成功','success')
813
796
  this.setState({
814
797
  loadingFace: false,
@@ -3621,6 +3604,7 @@ class Video extends Component {
3621
3604
  appAccount: this.props.tellerAccount,
3622
3605
  sessionId: this.state.sessionId,
3623
3606
  username: this.props.meetingInfo.host == '--' ? '' : this.props.meetingInfo.host,
3607
+ userSide: this.props.userSide,
3624
3608
  type: '2'
3625
3609
  });
3626
3610
  console.log(result);
@@ -3850,7 +3834,7 @@ class Video extends Component {
3850
3834
  }
3851
3835
  }
3852
3836
  componentWillMount() {
3853
- console.log('hsbc_teller_sdk', '1.9.3')
3837
+ console.log('hsbc_teller_sdk', '1.9.5')
3854
3838
  if (this.props.sessionId) {
3855
3839
  this.getRoomStatus({
3856
3840
  sessionId: this.props.sessionId
@@ -4231,8 +4215,8 @@ class Video extends Component {
4231
4215
  sessionId: this.state.sessionId,
4232
4216
  certificateType: this.state.certificateType,
4233
4217
  customerName: this.state.customerName,
4234
- startDate: this.state.certificateValidity ? this.state.certificateValidity.split('-')[0] : '',
4235
- endDate: this.state.certificateValidity ? this.state.certificateValidity.split('-')[1] : '',
4218
+ startDate: this.state.documentType == 'PASSPORT_CARD' ? '' : this.state.certificateValidity ? this.state.certificateValidity.split('-')[0] : '',
4219
+ endDate: this.state.documentType == 'PASSPORT_CARD' ? this.state.certificateValidity ? this.state.certificateValidity.split('-')[0]: '' : this.state.certificateValidity ? this.state.certificateValidity.split('-')[1] : '',
4236
4220
  });
4237
4221
  console.log('confirmCallback', result)
4238
4222
  if (result.code == 200) {
@@ -4325,11 +4309,40 @@ class Video extends Component {
4325
4309
  })
4326
4310
  }
4327
4311
  }
4312
+ if(this.state.documentType == 'HK_MO_RESIDENCE_CARD' || this.state.documentType == 'TW_RESIDENCE_CARD') {
4313
+ if (result.data.side == 'front') {
4314
+ this.setState({
4315
+ // isModalVisibleFacial: false
4316
+ idCardNumber: result.data.resident.idNum,
4317
+ idCardName: result.data.resident.name
4318
+ })
4319
+ this.ocrCallback(2)
4320
+ } else if (result.data.side == 'back') {
4321
+ console.log(result.data.resident.startDate, result.data.resident.endDate)
4322
+ this.setState({
4323
+ certificateValidity: result.data.resident.startDate + '-' + result.data.resident.endDate,
4324
+ loadingFace: false,
4325
+ cardFailReason: '',
4326
+ cardResuly: 'success',
4327
+ })
4328
+ }
4329
+ }
4328
4330
  if(this.state.documentType == 'PASSPORT_CARD') {
4329
4331
  this.setState({
4330
- idCardNumber: result.data.idCardNumber,
4331
- idCardName: result.data.idCardName,
4332
- certificateValidity: result.data.startDate + '-' + result.data.endDate,
4332
+ idCardNumber: result.data.passport.passportCode,
4333
+ idCardName: result.data.passport.nameEN,
4334
+ certificateValidity: result.data.passport.expiryDate,
4335
+ loadingFace: false,
4336
+ cardFailReason: '',
4337
+ cardResuly: 'success',
4338
+ })
4339
+ }
4340
+
4341
+ if(this.state.documentType == 'TW_PASS_CARD' || this.state.documentType == 'HK_MO_PASS_CARD') {
4342
+ this.setState({
4343
+ idCardNumber: result.data.permission.cardNum,
4344
+ idCardName: result.data.permission.nameEN,
4345
+ certificateValidity: result.data.permission.validDate,
4333
4346
  loadingFace: false,
4334
4347
  cardFailReason: '',
4335
4348
  cardResuly: 'success',
@@ -4350,13 +4363,14 @@ class Video extends Component {
4350
4363
  cardFailReason: err.response.message,
4351
4364
  cardResuly: 'fail',
4352
4365
  })
4366
+
4353
4367
  // this.messageClick('识别失败', 'error')
4354
4368
  }
4355
4369
  }
4356
4370
  handleOkFacial = () => {
4357
4371
  if (this.state.faceCustomerType == 2) {
4358
4372
  if (this.state.IDtypeFrontOrBack == '请截取证件头像面') {
4359
- if(this.state.documentType == 'PASSPORT_CARD') {
4373
+ if(this.state.documentType == 'PASSPORT_CARD' || this.state.documentType == 'TW_PASS_CARD' || this.state.documentType == 'HK_MO_PASS_CARD') {
4360
4374
  this.setState({
4361
4375
  loadingFace: true
4362
4376
  })
@@ -5762,7 +5776,9 @@ class Video extends Component {
5762
5776
  {otherAttendeesList}
5763
5777
  </li>
5764
5778
  }
5765
-
5779
+ <li>
5780
+ 请注意,若会议中需要客户出示证件,请客户使用手机的后置摄像头展示证件,由客户经理拍摄证件照片以完成客户身份核实。客户可点击会议主页面上的”切换摄像头“按钮切换手机摄像头
5781
+ </li>
5766
5782
 
5767
5783
  </ul>
5768
5784
  </div>
@@ -6258,12 +6274,6 @@ class Video extends Component {
6258
6274
  ]}>
6259
6275
  <Spin spinning={this.state.loadingFace} tip="识别中...">
6260
6276
  <div className="faceBody">
6261
- {/* {this.state.faceCustomerType == 2 &&
6262
- <Select defaultValue={this.state.defaultValue} style={{ width: 120,marginBottom: '20px' }} onChange={this.handleChangeOcr}>
6263
- <Option value="1">正面</Option>
6264
- <Option value="2">反面</Option>
6265
- </Select>
6266
- } */}
6267
6277
  {this.state.cardResuly == '' && <div className='faceCardImg'>
6268
6278
 
6269
6279
  {
@@ -6274,10 +6284,12 @@ class Video extends Component {
6274
6284
  this.state.faceResuly == '' && <span>
6275
6285
  <div>
6276
6286
  {
6277
- this.state.videoType == 'error' && <div className='errorClassFace'>
6278
- <img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>客户视频异常,请重试</div>
6287
+ this.state.videoType == 'error' && <div className='errorClassFace videoErrorClass'>
6288
+ <img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>
6289
+ 请点击“截图”拍摄客户人像的照片。若界面无客户头像显示,请检查网络并保持网络稳定后,点击“截图”重试
6290
+ </div>
6279
6291
  }
6280
- <video className="faceImg" id="publish_video_2" autoPlay muted={true}></video>
6292
+ <video disablePictureInPicture className="faceImg" id="publish_video_2" autoPlay muted={true}></video>
6281
6293
  </div>
6282
6294
  <img className="faceImg" src={this.state.facialImg} alt=""></img>
6283
6295
  </span>
@@ -6301,7 +6313,7 @@ class Video extends Component {
6301
6313
  <div className='imgDIV'>
6302
6314
  <img className="faceImgCard" src={this.state.facialImgFront} alt=""></img>
6303
6315
  {
6304
- this.state.documentType != 'PASSPORT_CARD' && <img className="faceImgCard faceImgCardTwo" src={this.state.facialImgBack} alt=""></img>
6316
+ this.state.documentType != 'PASSPORT_CARD' && this.state.documentType != 'TW_PASS_CARD' && this.state.documentType != 'HK_MO_PASS_CARD' && <img className="faceImgCard faceImgCardTwo" src={this.state.facialImgBack} alt=""></img>
6305
6317
  }
6306
6318
 
6307
6319
  </div>
@@ -6437,7 +6449,7 @@ class Video extends Component {
6437
6449
  <Radio value={'HK_MO_PASS_CARD'}>港澳来往大陆通行证</Radio>
6438
6450
  <Radio value={'HK_MO_RESIDENCE_CARD'}>港澳台居民居住证</Radio>
6439
6451
  <Radio value={'TW_RESIDENCE_CARD'}>台湾居民居住证</Radio>
6440
- <Radio value={'FOREIGNER_RESIDENCE_CARD'}>外国人永久居住证</Radio>
6452
+ {/* <Radio value={'FOREIGNER_RESIDENCE_CARD'}>外国人永久居住证</Radio> */}
6441
6453
  </Space>
6442
6454
  </Radio.Group>
6443
6455
  </div>
@@ -6567,6 +6579,7 @@ Video.defaultProps = {
6567
6579
  isTranscribing: false,
6568
6580
  shareMask: false,
6569
6581
  isOpenSound: false, // true开启进出音效 false不开启
6582
+ userSide: 2,
6570
6583
  logUrl: 'http://hsbc.cn-shanghai.log.aliyuncs.com/logstores/hsbc/track?APIVersion=0.6.0&app=meeting-ui',
6571
6584
  internalUrl: 'https://wp-staff-gateway.wealth-platform.uat.ali.cloud.cn.hsbc/meeting-ui/OHB/CN/HSBC?chnlID=OHB&locale=zh_CN&chnlCC=CN&chnlGMC=HSBC&targetFunc=supervisorMeeting&sourceFunc=rmMeeting'
6572
6585
  }
@@ -186,6 +186,7 @@
186
186
  border-radius: 4px;
187
187
  border:1px dashed #DDDDDD;
188
188
  margin: 24px;
189
+ margin-bottom: 3rem;
189
190
  flex:1;
190
191
 
191
192
  }
@@ -267,7 +268,7 @@
267
268
  bottom: 0;
268
269
  margin: auto;
269
270
  width: 500px;
270
- height: 150px;
271
+ height: 300px;
271
272
  font-size: 22px;
272
273
  color: #222222;
273
274
  font-weight: 600;
@@ -425,7 +426,7 @@
425
426
  .errorClassName{
426
427
  .ant-message-notice-content{
427
428
  min-width: 500px;
428
- height: 44px;
429
+ min-height: 44px;
429
430
  background: #F9F2F3;
430
431
  border: 1px #E5B2B5 solid;
431
432
  font-size: 16px;
@@ -464,7 +465,7 @@
464
465
  }
465
466
  .errorClassFace{
466
467
  min-width: 350px;
467
- height: 44px;
468
+ min-height: 44px;
468
469
  background: #F9F2F3;
469
470
  border: 1px #E5B2B5 solid;
470
471
  font-size: 16px;
@@ -479,6 +480,10 @@
479
480
  margin-bottom: 3px;
480
481
  }
481
482
  }
483
+ .videoErrorClass{
484
+ height: 60px;
485
+ margin: 15px;
486
+ }
482
487
  .successClassFace{
483
488
  min-width: 350px;
484
489
  height: 44px;