react_hsbc_teller 1.8.3 → 1.8.4

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.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -1,9 +1,45 @@
1
1
  import Server from './server';
2
2
 
3
3
  class API extends Server{
4
+ // /hsbc/getAuthorizeResult/{activityId}/{appAccount}
5
+ async getAuthorizeResult(params = {}){
6
+ try{
7
+ let result = await this.axios('get', '/hsbc/getAuthorizeResult/'+params.activityId + '/' + params.appAccount, params);
8
+ if(result && result.code === 200){
9
+ return result||'';
10
+ }else{
11
+ let err = {
12
+ tip: '服务异常',
13
+ response: result,
14
+ data: params,
15
+ // url: 'https://api.cangdu.org/shopro/data/products',
16
+ }
17
+ throw err;
18
+ }
19
+ }catch(err){
20
+ throw err;
21
+ }
22
+ }
23
+ async saveAuthorize(params = {}){
24
+ try{
25
+ let result = await this.axios('post', '/hsbc/saveAuthorize', params);
26
+ if(result && result.code === 200){
27
+ return result||'';
28
+ }else{
29
+ let err = {
30
+ tip: '服务异常',
31
+ response: result,
32
+ data: params,
33
+ // url: 'https://api.cangdu.org/shopro/data/products',
34
+ }
35
+ throw err;
36
+ }
37
+ }catch(err){
38
+ throw err;
39
+ }
40
+ }
4
41
  // /hsbc/getToken
5
42
  async getToken(params = {}){
6
- // return this.axios('get', '/lang/select/2', params);
7
43
  try{
8
44
  let result = await this.axios('post', '/hsbc/getToken', params);
9
45
  if(result && result.code === 200){
@@ -28,6 +28,9 @@ export default class Server {
28
28
  timeout: 30000,
29
29
  params: null,
30
30
  data: params,
31
+ // headers: {
32
+ // Authorization: window.sessionStorage.getItem('authTokenHSBC') ? window.sessionStorage.getItem('authTokenHSBC') : '',
33
+ // },
31
34
  withCredentials: true, //是否携带cookies发起请求
32
35
  validateStatus:(status)=>{
33
36
  return status >= 200 && status < 300;
@@ -137,14 +137,15 @@ export default class foot extends Component {
137
137
  </Popover>
138
138
  }
139
139
  {
140
- item == 'OCR' && <Popover content={content} trigger="click" visible={clickedOcr} onVisibleChange={this.ocrHandleVisibleChange}>
140
+ item == 'OCR' &&
141
+ // <Popover content={content} trigger="click" visible={clickedOcr} onVisibleChange={this.ocrHandleVisibleChange}>
141
142
  <div className="one" onClick={this.ocrClick.bind(this)}>
142
143
  <img className="imgClass" src={require("../../assets/img/icon_ocr.png").default} alt="" />
143
144
  <div className="text">
144
145
  OCR识别
145
146
  </div>
146
147
  </div>
147
- </Popover>
148
+ // </Popover>
148
149
  }
149
150
  {
150
151
  item == 'INVITE' && <div className="one" onClick={this.invitationClick.bind(this)}>
@@ -26,6 +26,15 @@ import Spin from "antd/lib/spin";
26
26
  import 'antd/lib/spin/style'
27
27
  import Select from "antd/lib/select";
28
28
  import 'antd/lib/select/style'
29
+
30
+ import Radio from "antd/lib/radio";
31
+ import 'antd/lib/radio/style'
32
+
33
+
34
+ import Space from "antd/lib/space";
35
+ import 'antd/lib/space/style'
36
+
37
+
29
38
  import styled from 'styled-components';
30
39
  import { Button } from '../../../node_modules/antd/lib/index';
31
40
  import SignMy from '../sign/signMy.jsx'
@@ -302,7 +311,14 @@ class Video extends Component {
302
311
  curryControl: 'pen', // 工具类型
303
312
  },
304
313
  zIndexNum: -1,
305
- selectSpan: 'pen'
314
+ selectSpan: 'pen',
315
+ isModalVisibleCustomer: false,
316
+ customerSelect: '',
317
+ documentType: '',
318
+ isCustomerSelect: true,
319
+ customerTitleName: '客户身份识别',
320
+ certificateType: 'identityCard',
321
+ customerName: ''
306
322
  };
307
323
  // eslint-disable-next-line no-undef
308
324
  test_controller = '';
@@ -310,7 +326,7 @@ class Video extends Component {
310
326
  saveLog=(val)=>{
311
327
  axios({
312
328
  method: 'post',
313
- baseURL: `http://${this.props.project}.${this.props.endpoint}/logstores/${this.props.logstore}/track`,
329
+ baseURL: this.props.logUrl,
314
330
  headers: {
315
331
  'x-log-apiversion': '0.6.0',
316
332
  'x-log-bodyrawsize': '1234',
@@ -383,6 +399,7 @@ class Video extends Component {
383
399
  roomId: this.state.channelId
384
400
  }
385
401
  })
402
+ // this.getToken()
386
403
  // this.saveLog()
387
404
  } catch (err) {
388
405
  console.error(err);
@@ -1028,10 +1045,17 @@ class Video extends Component {
1028
1045
  })
1029
1046
  }
1030
1047
  }
1048
+ console.log(list)
1049
+ this.setState({
1050
+ customerList: list
1051
+ })
1031
1052
  if (list.length > 0) {
1032
1053
  if (val == 'ocr') {
1033
1054
  this.setState({
1034
- clickedOcr: true
1055
+ isModalVisibleCustomer: true,
1056
+ isCustomerSelect: true,
1057
+ customerSelect: '',
1058
+ customerTitleName: '客户身份识别'
1035
1059
  })
1036
1060
  } else if (val == 'facial') {
1037
1061
  this.setState({
@@ -1041,9 +1065,6 @@ class Video extends Component {
1041
1065
  } else {
1042
1066
  this.messageClick('当前暂无客户','error')
1043
1067
  }
1044
- this.setState({
1045
- customerList: list
1046
- })
1047
1068
  }
1048
1069
  messageClick=(value,valueOne)=>{
1049
1070
  console.log(value,valueOne)
@@ -2021,9 +2042,6 @@ class Video extends Component {
2021
2042
  this.test_controller.OnGetDevicesSuccess = (devicesInfo) => {
2022
2043
  console.log('devicesInfo' + JSON.stringify(devicesInfo));
2023
2044
  const obj = [
2024
- // {actionid: '0133d06019b8fe9426818ae7573ccfc31c150e09138e7f5ccfda03d6e224ffd4', groupId: '9c0334ba5cba71b60acb3ec6669c3aac78371ec9d9e33d2e8af72a758d895d27', actionname: 'Integrated Camera (13d3:56fb)'},
2025
-
2026
- // {actionid: '4695c628677498d876074b941c16f6921d4e57534b50bfc2cb973da84e0e2622', groupId: '0d86c9467f096440ed74449192be5fafea59ac469866975f30b61fe964e2a80e', actionname: 'C2D Camera (0416:5035)'}
2027
2045
  ];
2028
2046
  const obj1 = [];
2029
2047
  const obj2 = [];
@@ -2261,6 +2279,15 @@ class Video extends Component {
2261
2279
  this.test_controller.OnSendTextMsgFailed =(msgId, code, msg)=>{
2262
2280
  console.log('发送失败',msgId,code, msg)
2263
2281
  }
2282
+ this.test_controller.OnReceiveTextMsg = (uid, msg)=>{
2283
+ console.log('收到手机端消息',uid, msg, JSON.parse(msg).typeId,JSON.parse(msg).data.sessionId,this.state.sessionId)
2284
+ if(JSON.parse(msg).typeId == 33001 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
2285
+ if(JSON.parse(msg).type == 1) {
2286
+ this.saveAuthorize(JSON.parse(msg).data.userId)
2287
+ this.customerFaceClick(this.state.customerList[this.state.customerSelect])
2288
+ }
2289
+ }
2290
+ }
2264
2291
  this.test_controller.StreamFilterHandler = async (publish_tag, stream, stream_type, publish_device, media_type) =>{
2265
2292
  console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
2266
2293
  if (stream_type == "subscribe") {
@@ -2388,16 +2415,6 @@ class Video extends Component {
2388
2415
  this.timer = setInterval(
2389
2416
  () => {
2390
2417
  if(!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0.1) {
2391
- // this.test_controller.SendTextMsg(JSON.stringify({
2392
- // 'typeId': 3200,
2393
- // 'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
2394
- // "data": {
2395
- // 'sessionId': this.state.sessionId,
2396
- // 'userId': this.props.tellerAccount,
2397
- // 'data': (new Date()).valueOf()
2398
- // }
2399
-
2400
- // }))
2401
2418
  callNimIM('sendCustomCmdMsg', {
2402
2419
  customId: this.state.imRoomId,
2403
2420
  content: JSON.stringify({
@@ -3692,12 +3709,31 @@ userType:'1'
3692
3709
  console.log('isSharedScreen', this.state.isSharedScreen,this.state.laveRoomSharedScreen)
3693
3710
 
3694
3711
  }
3712
+ getToken = async () =>{
3713
+ try{
3714
+ let result = await API.getToken({
3715
+ sessionId: this.state.sessionId ? this.state.sessionId : this.props.sessionId,
3716
+ roomId: this.state.channelId ? this.state.channelId : this.props.roomId
3717
+ })
3718
+ window.sessionStorage.setItem('authTokenHSBC',result)
3719
+ rateList = []
3720
+ this.rateAll().then((res)=>{
3721
+ Array.isArray(res) ? res.map((item)=>{
3722
+ rateList.push(item.tag)
3723
+ }) : rateList = []
3724
+ console.log('rateList',rateList)
3725
+ })
3726
+ }catch (err) {
3727
+ this.roomCallBack(2, '获取tiken失败','SYS-01')
3728
+ }
3729
+ }
3695
3730
  getRoomStatus = async data => {
3696
3731
  try {
3697
3732
  let result = await API.getRoomStatus({
3698
3733
  sessionId: data.sessionId
3699
3734
  });
3700
3735
  if (result.code == 200 && result.data.roomStatus == 1) {
3736
+ // this.getToken()
3701
3737
  this.addToScript()
3702
3738
 
3703
3739
  } else {
@@ -4155,6 +4191,8 @@ userType:'1'
4155
4191
  appAccount: this.state.faceCustomerUid,
4156
4192
  idCardNumber: this.state.idCardNumber,
4157
4193
  sessionId: this.state.sessionId,
4194
+ certificateType: this.state.certificateType,
4195
+ customerName: this.state.customerName
4158
4196
  });
4159
4197
  console.log('confirmCallback',result)
4160
4198
  if (result.code == 200) {
@@ -4310,6 +4348,9 @@ userType:'1'
4310
4348
 
4311
4349
  if (result.code == 200) {
4312
4350
  this.messageClick('查询客户信息成功','success')
4351
+ this.setState({
4352
+ isModalVisibleCustomer: false
4353
+ })
4313
4354
  } else {
4314
4355
  this.messageClick('查询客户信息失败','error')
4315
4356
  }
@@ -4368,6 +4409,7 @@ userType:'1'
4368
4409
  console.log(sid)
4369
4410
  this.state.customOcrSid = sid
4370
4411
  this.state.faceCustomerUid = item.customId,
4412
+ this.state.customerName = item.name
4371
4413
  this.setState({
4372
4414
  clickedFacial: false,
4373
4415
  clickedOcr: false,
@@ -5137,25 +5179,123 @@ userType:'1'
5137
5179
  this.sendNotification()
5138
5180
  }
5139
5181
  }
5140
- // shouldComponentUpdate(nextProps,nextState){
5141
- // console.log('componentDidUpdate',nextProps,nextState)
5142
- // if(nextProps.shareMask != nextState.shareMaskState){
5143
- // this.state.shareMaskState = nextProps.shareMask
5144
- // this.sendNotification()
5145
- // }
5146
- // }
5147
- // static getDerivedStateFromProps(props, state) {
5148
- // console.log('getDerivedStateFromProps',props,state,props.shareMask)
5149
- // if(props.shareMask!==state.shareMaskState){
5150
- // // this.sendNotification()
5151
- // return {
5152
-
5153
- // shareMaskState:shareMask,
5182
+ onChangeOCRCustomer=(e) => {
5183
+ console.log(e)
5184
+ this.setState({
5185
+ customerSelect: e.target.value
5186
+ })
5187
+ }
5188
+ handleCancelCustomer=()=>{
5189
+ this.setState({
5190
+ isModalVisibleCustomer: false
5191
+ })
5192
+ }
5193
+ handleOkCustomer=()=>{
5194
+ if(this.state.isCustomerSelect) {
5195
+ if(this.state.customerList[this.state.customerSelect].tourist) {
5196
+ this.customerFaceClick(this.state.customerList[this.state.customerSelect])
5197
+ } else {
5198
+ this.setState({
5199
+ isCustomerSelect: false,
5200
+ customerTitleName: this.state.customerList[this.state.customerSelect].name
5201
+ })
5202
+ }
5203
+
5204
+ } else {
5205
+ this.getAuthorizeResult(this.state.customerList[this.state.customerSelect].customId).then((res)=>{
5206
+ if(res) {
5207
+ this.customerFaceClick(this.state.customerList[this.state.customerSelect])
5208
+ } else {
5209
+ if(this.state.documentType == 0) {
5210
+ this.test_controller.SendTextMsg(JSON.stringify({
5211
+ 'typeId': 3300,
5212
+ "data": {
5213
+ 'sessionId': this.state.sessionId,
5214
+ 'title': '为了有效确认客户身份,请您配合进行我行的身份识别和核验。请您阅读以下内容,若您同意,请您之后在摄像头前出示您的身份证件,我行将对您的身份证件拍照并采集证件信息;同时,我行会对您进行脸部拍照,采集您的脸部图像。',
5215
+ 'list': [
5216
+ {
5217
+ 'id': 1,
5218
+ 'content': '您是否授权汇丰中国对您的证件以及脸部进行拍照,采集并留存您的证件信息以及脸部图像以便我行进行身份识别?'
5219
+ },
5220
+ {
5221
+ 'id': 2,
5222
+ 'content': '为了通过人脸对比进行身份识别和核验,我行需要将您的姓名、身份证件号码和脸部图像发送给中国人民银行或全国公民身份证号码查询服务中心授权的第三方,并由第三方进一步发送至中国人民银行或全国公民身份证号码查询服务中心进行人脸对比或信息核对。'
5223
+ }
5224
+ ]
5225
+ }
5226
+
5227
+ }))
5228
+ } else if(this.state.documentType == 1) {
5229
+ this.test_controller.SendTextMsg(JSON.stringify({
5230
+ 'typeId': 3300,
5231
+ "data": {
5232
+ 'sessionId': this.state.sessionId,
5233
+ 'title': '为了有效确认客户身份,请您配合进行我行的身份识别。请您阅读以下内容,若您同意,请您之后在摄像头前出示您的身份证件,我行将对您的身份证件拍照并采集证件信息;',
5234
+ 'list': [
5235
+ {
5236
+ 'id': 1,
5237
+ 'content': '您是否授权汇丰中国对您的证件进行拍照,采集并留存您的证件信息以便我行进行身份确认?'
5238
+ }
5239
+ ]
5240
+ }
5241
+
5242
+ }))
5243
+ }
5244
+
5154
5245
 
5155
- // }
5156
- // }
5157
- // return null
5158
- // }
5246
+ }
5247
+ })
5248
+ this.setState({
5249
+ isModalVisibleCustomer: false,
5250
+ })
5251
+ // this.customerFaceClick(this.state.customerList[this.state.customerSelect])
5252
+ }
5253
+
5254
+ }
5255
+ onChangeDocumentType=(e)=>{
5256
+ this.setState({
5257
+ documentType: e.target.value
5258
+ })
5259
+ }
5260
+ getAuthorizeResult= async (appAccount) => {
5261
+ try {
5262
+ let result = await API.getAuthorizeResult({
5263
+ activityId: this.props.businessNumber,
5264
+ appAccount: appAccount,
5265
+ });
5266
+ console.log(result)
5267
+ if (result.code == 200 && result.data.ifAuthorize) {
5268
+ console.log('成功')
5269
+ return true
5270
+ } else {
5271
+
5272
+ // this.messageClick('保存失败','error')
5273
+ return false
5274
+ }
5275
+ } catch (err) {
5276
+ console.log(err)
5277
+ return false
5278
+ }
5279
+ }
5280
+ saveAuthorize= async (appAccount) => {
5281
+ try {
5282
+ let result = await API.saveAuthorize({
5283
+ activityId: this.props.businessNumber,
5284
+ authorizeType: this.state.documentType==0 ? 'ID' : 'NID',
5285
+ appAccount: appAccount,
5286
+ idCardAuthorize: this.state.documentType==0 ? 'YES' : '',
5287
+ pictureAuthorize: 'YES'
5288
+ });
5289
+ console.log(result)
5290
+ if (result.code == 200) {
5291
+ console.log('成功')
5292
+ } else {
5293
+ // this.messageClick('保存失败','error')
5294
+ }
5295
+ } catch (err) {
5296
+ console.log(err)
5297
+ }
5298
+ }
5159
5299
  render() {
5160
5300
  const { meetingInfo,isTranscribing } = this.props
5161
5301
  var pdfChildren
@@ -5828,13 +5968,12 @@ userType:'1'
5828
5968
  <Option value="2">反面</Option>
5829
5969
  </Select>
5830
5970
  } */}
5831
- {
5832
- !this.state.idCardName &&<div className='faceCardImg'>
5971
+ <div className='faceCardImg'>
5833
5972
  <img className="faceImg" src={this.state.facialImg} alt=""></img>
5834
5973
  </div>
5835
- }
5836
5974
  {
5837
5975
  this.state.idCardName &&<div className='resuleCard'>
5976
+ <div>证件信息确认</div>
5838
5977
  <div><span>客户姓名</span> <input type="text" value={this.state.idCardName} onChange={this.handleChangeIdCardName} /></div>
5839
5978
  <div><span>身份证号</span> <input type="text" value={this.state.idCardNumber} onChange={this.handleChangeIdCardNumber} /></div>
5840
5979
  </div>
@@ -5843,13 +5982,52 @@ userType:'1'
5843
5982
 
5844
5983
  </div>
5845
5984
  </Modal>
5846
- {/* <Modal title={this.state.titleModal} cancelText="取消" okText="确定" visible={this.state.isModalVisibleFacial}
5847
- onOk={this.handleOkFacial} onCancel={this.handleCancelFacial}>
5848
- <div className="faceBody">
5849
- <img className="faceImg" src={this.state.facialImg} alt=""></img>
5985
+ <Modal title={this.state.customerTitleName} closable={false} centered={true} visible={this.state.isModalVisibleCustomer}
5986
+ footer={[
5987
+ <div key='end'>
5988
+ <Button className="modelButtonCancel" onClick={this.handleCancelCustomer}>取消</Button>
5989
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkCustomer}>下一步</Button>
5990
+ </div>
5991
+ ]}>
5992
+ <div>
5993
+ <div className='selectCustomer'>
5994
+ {
5995
+ this.state.isCustomerSelect &&<div>
5996
+ <div>
5997
+ 请选择进行身份识别的客户
5998
+ </div>
5999
+ <div>
6000
+ <Radio.Group onChange={this.onChangeOCRCustomer} value={this.state.customerSelect}>
6001
+ <Space direction="vertical">
6002
+ {
6003
+ this.state.customerList.map((item,index)=>{
6004
+ return <Radio value={index}>{item.name}</Radio>
6005
+ })
6006
+ }
6007
+ </Space>
6008
+ </Radio.Group>
6009
+ </div>
6010
+ </div>
6011
+ }
6012
+ {
6013
+ !this.state.isCustomerSelect &&<div>
6014
+ <div>
6015
+ 请您确认您的身份证件类型
6016
+ </div>
6017
+ <div>
6018
+ <Radio.Group onChange={this.onChangeDocumentType} value={this.state.documentType}>
6019
+ <Space direction="vertical">
6020
+ <Radio value={0}>身份证:或外国人永久居住证;或港澳台居民居住证</Radio>
6021
+ <Radio value={1}>护照:或台湾来往大陆通行证;或港澳来往大陆通行证</Radio>
6022
+ </Space>
6023
+ </Radio.Group>
6024
+ </div>
6025
+ </div>
6026
+ }
6027
+ </div>
5850
6028
  </div>
5851
6029
 
5852
- </Modal> */}
6030
+ </Modal>
5853
6031
  <Modal className="modelClass" title="邀请参会人员" closable={false} centered={true} visible={this.state.isModalVisibleInvitation} footer={[
5854
6032
  <div key='invitation'>
5855
6033
  <Button className="modelButtonCancel" onClick={this.handleCancelInvitation}>取消</Button>
@@ -5969,9 +6147,7 @@ sessionId: "",
5969
6147
  isTranscribing: false,
5970
6148
  shareMask: false,
5971
6149
  isOpenSound: false, // true开启进出音效 false不开启
5972
- endpoint: 'cn-shanghai.log.aliyuncs.com',
5973
- project: 'hsbc',
5974
- logstore: 'hsbc',
6150
+ logUrl: 'http://hsbc.cn-shanghai.log.aliyuncs.com/logstores/hsbc/track',
5975
6151
  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'
5976
6152
  }
5977
6153
  export default Video
@@ -155,9 +155,9 @@
155
155
  }
156
156
  .faceBody{
157
157
  text-align: center;
158
- height: 200px;
158
+ height: 100%;
159
159
  .faceCardImg{
160
- height: 100%;
160
+ // height: 100%;
161
161
  }
162
162
  .resuleCard{
163
163
  text-align: -webkit-left;
@@ -519,4 +519,8 @@
519
519
  }
520
520
  .speakerTitle{
521
521
  color: red;
522
- }
522
+ }
523
+ .selectCustomer{
524
+ font-size: 16px;
525
+ margin-left: 40px;
526
+ }