react_hsbc_teller 0.6.6 → 0.7.0

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.
@@ -11,27 +11,6 @@
11
11
  * @license MIT
12
12
  */
13
13
 
14
- /*!
15
- * html2canvas 1.4.0 <https://html2canvas.hertzen.com>
16
- * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
17
- * Released under MIT License
18
- */
19
-
20
- /*! *****************************************************************************
21
- Copyright (c) Microsoft Corporation.
22
-
23
- Permission to use, copy, modify, and/or distribute this software for any
24
- purpose with or without fee is hereby granted.
25
-
26
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
27
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
28
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
29
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
30
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
31
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
32
- PERFORMANCE OF THIS SOFTWARE.
33
- ***************************************************************************** */
34
-
35
14
  /*! *****************************************************************************
36
15
  Copyright (c) Microsoft Corporation.
37
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "0.6.6",
3
+ "version": "0.7.0",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -1,6 +1,26 @@
1
1
  import Server from './server';
2
2
 
3
3
  class API extends Server{
4
+ async sendEmail(params = {}){
5
+ // return this.axios('get', '/lang/select/2', params);
6
+ try{
7
+ let result = await this.axios('post', '/hsbc/sendEmail', params);
8
+ console.log(result)
9
+ if(result && (result.data instanceof Object) && result.code === 200){
10
+ return result||[];
11
+ }else{
12
+ let err = {
13
+ tip: '服务异常',
14
+ response: result,
15
+ data: params,
16
+ // url: 'https://api.cangdu.org/shopro/data/products',
17
+ }
18
+ throw err;
19
+ }
20
+ }catch(err){
21
+ throw err;
22
+ }
23
+ }
4
24
  async appGetUsername(params = {}){
5
25
  // return this.axios('get', '/lang/select/2', params);
6
26
  try{
@@ -3,6 +3,7 @@ import JKL from './JKL';
3
3
 
4
4
  let websock;
5
5
  let id;
6
+ let fromHostName;
6
7
  const xmlLang = 'zh';
7
8
  const version = '1.0';
8
9
  let islogin = false;
@@ -36,6 +37,9 @@ function websocketonopen() { // 连接建立之后执行send方法发送数据
36
37
  // 发送建立流请求
37
38
  const steam = {
38
39
  open: {
40
+ // '-to': 'im.uat.dsp.hsbcfts.com.cn',
41
+ // '-from': `${'web'}@${'im.uat.dsp.hsbcfts.com.cn'}`,
42
+
39
43
  '-to': JSON.parse(window.sessionStorage.getItem('sigData')).hostname,
40
44
  '-from': `${JSON.parse(window.sessionStorage.getItem('sigData')).account}@${JSON.parse(window.sessionStorage.getItem('sigData')).hostname}`,
41
45
  '-xmlns': 'urn:ietf:params:xml:ns:xmpp-framing',
@@ -84,7 +88,8 @@ function websocketonmessage(e) {
84
88
  } else if (undefined != jsondata.open) {
85
89
  // 记录id
86
90
  id = jsondata.open['-id'];
87
- console.log(id);
91
+ fromHostName = jsondata.open["-from"];
92
+ console.log('记录id',id,fromHostName);
88
93
  } else if (undefined != jsondata['stream:features']) {
89
94
  if (undefined != jsondata['stream:features'].mechanisms) {
90
95
  // 获取登录验证方式
@@ -159,7 +164,7 @@ function newopen() {
159
164
  '-xmlns': 'jabber:client',
160
165
  '-to': JSON.parse(window.sessionStorage.getItem('sigData')).hostname,
161
166
  '-version': version,
162
- '-from': `${JSON.parse(window.sessionStorage.getItem('sigData')).account}@${JSON.parse(window.sessionStorage.getItem('sigData')).hostname}`,
167
+ '-from': JSON.parse(window.sessionStorage.getItem('sigData')).account + '@' + fromHostName,
163
168
  '-id': id,
164
169
  '-xml:lang': xmlLang,
165
170
  },
@@ -184,7 +189,9 @@ function bind() {
184
189
  function auth(val) {
185
190
  // Base64编码
186
191
  console.log('www');
187
- const token = window.btoa(`${JSON.parse(window.sessionStorage.getItem('sigData')).account}@${JSON.parse(window.sessionStorage.getItem('sigData')).hostname}\0` + `${JSON.parse(window.sessionStorage.getItem('sigData')).openfireToken}`);
192
+ // const token = window.btoa('web'+'@'+ fromHostName+ '\0' + '123');
193
+
194
+ const token = window.btoa(JSON.parse(window.sessionStorage.getItem('sigData')).account + '@' + fromHostName + '\0' + JSON.parse(window.sessionStorage.getItem('sigData')).openfireToken);
188
195
  const message = {
189
196
  auth: {
190
197
  '-xmlns': 'urn:ietf:params:xml:ns:xmpp-sasl',
@@ -51,7 +51,7 @@ export default class foot extends Component {
51
51
  this.props.inspection()
52
52
  }
53
53
  render() {
54
- const {clickedOcr,clickedFacial,isTranscribing,img,cameraImg,screenName,suspendName,customerList,menus} = this.props
54
+ const {clickedOcr,clickedFacial,isTranscribing,img,cameraImg,screenName,suspendName,customerList,menus,voiceName} = this.props
55
55
  const content = (
56
56
  <div>
57
57
  {customerList.map((item,index)=>{
@@ -137,7 +137,7 @@ export default class foot extends Component {
137
137
  <div className="one">
138
138
  <img className="imgClass" src={img} alt="" />
139
139
  <div className="text">
140
- 静音
140
+ {voiceName}
141
141
  </div>
142
142
  </div>
143
143
 
@@ -22,7 +22,6 @@ import 'antd/lib/spin/style'
22
22
  import { Button } from '../../../node_modules/antd/lib/index';
23
23
  import CanvasDraw from "react-canvas-draw";
24
24
  import { FormattedMessage, injectIntl } from 'react-intl';
25
- import html2canvas from 'html2canvas';
26
25
  import axios from 'axios';
27
26
  const LEAVE_TYPE = {
28
27
  TELLER_EXIT: 1, // 坐席退出
@@ -54,6 +53,7 @@ class Video extends Component {
54
53
  cameraImg: cameraImgOpen,
55
54
  voiceStatue: false,
56
55
  voiceImg: voiceImgOpen,
56
+ voiceName: '静音',
57
57
  isCustomer: false,
58
58
  publishDevic: 1,
59
59
  isSharedScreen: false,
@@ -179,6 +179,12 @@ class Video extends Component {
179
179
  appId: result.appId,
180
180
  bizName: result.bizName
181
181
  });
182
+ // const data1={
183
+ // hostname: 'im.uat.dsp.hsbcfts.com.cn',
184
+ // webPort: '443',
185
+ // account: 'web',
186
+ // openfireToken: '123'
187
+ // }
182
188
  window.sessionStorage.setItem('sigData', JSON.stringify(result));
183
189
  if (data.sigType == 1) {
184
190
  this.handleEdit()
@@ -191,6 +197,9 @@ class Video extends Component {
191
197
  handleEdit = () => {
192
198
  console.log(JSON.parse(window.sessionStorage.getItem('sigData')));
193
199
  // eslint-disable-next-line no-undef
200
+ // initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
201
+ // initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + '15603' + '/ws/');
202
+
194
203
  initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
195
204
  const config_param = {};
196
205
  config_param.workspaceId = this.state.workSpaceId;
@@ -2201,7 +2210,8 @@ class Video extends Component {
2201
2210
  // 静音本地
2202
2211
  this.setState({
2203
2212
  voiceStatue: true,
2204
- voiceImg: voiceImgCloe
2213
+ voiceImg: voiceImgCloe,
2214
+ voiceName: '解除静音'
2205
2215
  });
2206
2216
  let sid = document.getElementById('publish_video1').name;
2207
2217
  if (!sid) {
@@ -2227,7 +2237,8 @@ class Video extends Component {
2227
2237
  // 打开本地
2228
2238
  this.setState({
2229
2239
  voiceStatue: false,
2230
- voiceImg: voiceImgOpen
2240
+ voiceImg: voiceImgOpen,
2241
+ voiceName: '静音'
2231
2242
  });
2232
2243
  let sid = document.getElementById('publish_video1').name;
2233
2244
  if (!sid) {
@@ -2387,7 +2398,8 @@ class Video extends Component {
2387
2398
  if (this.state.voiceStatue) {
2388
2399
  // 当前是音频
2389
2400
  this.setState({
2390
- voiceImg: voiceImgCloe
2401
+ voiceImg: voiceImgCloe,
2402
+ voiceName: '解除静音'
2391
2403
  });
2392
2404
  let sid = document.getElementById('publish_video1').name;
2393
2405
  if (!sid) {
@@ -2399,7 +2411,8 @@ class Video extends Component {
2399
2411
  // 当前是
2400
2412
  this.test_controller.SetLocalAudioEnable(1, parseInt(sid, 10));
2401
2413
  this.setState({
2402
- voiceImg: voiceImgOpen
2414
+ voiceImg: voiceImgOpen,
2415
+ voiceName: '静音'
2403
2416
  })
2404
2417
  }
2405
2418
  callNimIM('sendCustomCmdMsg', {
@@ -2497,7 +2510,10 @@ class Video extends Component {
2497
2510
  };
2498
2511
  invitationClick = () => {
2499
2512
  this.setState({
2500
- isModalVisibleInvitation: true
2513
+ isModalVisibleInvitation: true,
2514
+ employeeNumber: '',
2515
+ employeeName: '',
2516
+ employeeError: ''
2501
2517
  })
2502
2518
 
2503
2519
  }
@@ -2507,9 +2523,9 @@ class Video extends Component {
2507
2523
  return
2508
2524
  }
2509
2525
  try {
2510
- let result = await API.sendLink({
2511
- sessionId: this.state.sessionId,
2512
- userId: this.state.employeeNumber
2526
+ let result = await API.sendEmail({
2527
+ staffId: this.state.employeeNumber,
2528
+ activityId: this.props.businessNumber
2513
2529
  });
2514
2530
  if (result.code == 200) {
2515
2531
  this.messageClick('发送成功','success')
@@ -2691,8 +2707,8 @@ class Video extends Component {
2691
2707
  console.log(result)
2692
2708
  if (result.code == 200) {
2693
2709
  this.setState({
2694
- employeeName: result.data.username,
2695
- employeeError: '',
2710
+ employeeName: result.data.staffName,
2711
+ employeeError: result.data.staffName ? '' : '查无此人',
2696
2712
  })
2697
2713
  } else {
2698
2714
  this.messageClick('查询失败','error')
@@ -2700,7 +2716,7 @@ class Video extends Component {
2700
2716
  } catch (err) {
2701
2717
  console.log(err)
2702
2718
  this.setState({
2703
- employeeError: '未搜索到相关信息'
2719
+ employeeError: '查无此人'
2704
2720
  })
2705
2721
  }
2706
2722
  }
@@ -3344,6 +3360,7 @@ class Video extends Component {
3344
3360
  </div>
3345
3361
  </div>
3346
3362
  <Foot
3363
+ voiceName={this.state.voiceName}
3347
3364
  img={this.state.voiceImg}
3348
3365
  screenName={this.state.screenName}
3349
3366
  suspendName={this.state.suspendName}
@@ -3368,7 +3385,7 @@ class Video extends Component {
3368
3385
  switchExternal={this.switchExternal}
3369
3386
  inspection={this.inspection}
3370
3387
  ></Foot>
3371
- <Modal key={Math.random()} cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
3388
+ <Modal cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
3372
3389
  onCancel={this.handleCancel}>
3373
3390
  {
3374
3391
  this.state.isSuspend && <span>确定是否恢复会话?</span>
@@ -3377,15 +3394,19 @@ class Video extends Component {
3377
3394
  !this.state.isSuspend && <span>确定是否暂停会话?</span>
3378
3395
  }
3379
3396
  </Modal>
3380
- <Modal key={Math.random()} closable={false} centered={true} visible={this.state.isModalVisibleEnd} footer={[
3381
- <Button className="modelButtonCancel" onClick={this.handleCancelEnd}>取消</Button>,
3397
+ <Modal closable={false} centered={true} visible={this.state.isModalVisibleEnd} footer={[
3398
+ <div key='end'>
3399
+ <Button className="modelButtonCancel" onClick={this.handleCancelEnd}>取消</Button>
3382
3400
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkEnd}>确定</Button>
3401
+ </div>
3383
3402
  ]}>
3384
3403
  <div className='endModal'>确定是否结束会话?</div>
3385
3404
  </Modal>
3386
- <Modal key={Math.random()} title={this.state.titleModal} closable={false} centered={true} visible={this.state.isModalVisibleFacial} footer={[
3387
- <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>,
3405
+ <Modal title={this.state.titleModal} closable={false} centered={true} visible={this.state.isModalVisibleFacial} footer={[
3406
+ <div key='facial'>
3407
+ <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>
3388
3408
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkFacial}>确定</Button>
3409
+ </div>
3389
3410
  ]}>
3390
3411
  <div className="faceBody">
3391
3412
  <img className="faceImg" src={this.state.facialImg} alt=""></img>
@@ -3398,9 +3419,11 @@ class Video extends Component {
3398
3419
  </div>
3399
3420
 
3400
3421
  </Modal> */}
3401
- <Modal key={Math.random()} className="modelClass" title="新增预约" closable={false} centered={true} visible={this.state.isModalVisibleInvitation} footer={[
3402
- <Button className="modelButtonCancel" onClick={this.handleCancelInvitation}>取消</Button>,
3422
+ <Modal className="modelClass" title="新增预约" closable={false} centered={true} visible={this.state.isModalVisibleInvitation} footer={[
3423
+ <div key='invitation'>
3424
+ <Button className="modelButtonCancel" onClick={this.handleCancelInvitation}>取消</Button>
3403
3425
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkInvitation}>确定</Button>
3426
+ </div>
3404
3427
  ]}>
3405
3428
  <div>
3406
3429
  <div className="invitationDiv">
@@ -3420,9 +3443,11 @@ class Video extends Component {
3420
3443
  }
3421
3444
 
3422
3445
  </Modal>
3423
- <Modal key={Math.random()} title="签字白板" closable={false} centered={true} visible={this.state.isModalVisibleSign} footer={
3446
+ <Modal title="签字白板" closable={false} centered={true} visible={this.state.isModalVisibleSign} footer={
3424
3447
  [
3448
+ <div key='okSign'>
3425
3449
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSign}>确定</Button>
3450
+ </div>
3426
3451
  ]
3427
3452
  }>
3428
3453
  <div className="content">
@@ -3437,9 +3462,11 @@ class Video extends Component {
3437
3462
  ></CanvasDraw>
3438
3463
  </div>
3439
3464
  </Modal>
3440
- <Modal key={Math.random()} title="设备检测" closable={false} centered={true} visible={this.state.isModalVisibleInspection} footer={[
3441
- <Button className="modelButtonCancel" onClick={this.handleCancelInspection}>取消</Button>,
3465
+ <Modal title="设备检测" closable={false} centered={true} visible={this.state.isModalVisibleInspection} footer={[
3466
+ <div key='inspection'>
3467
+ <Button className="modelButtonCancel" onClick={this.handleCancelInspection}>取消</Button>
3442
3468
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkInspection}>确定</Button>
3469
+ </div>
3443
3470
  ]}>
3444
3471
  <div className="inspection">
3445
3472
  <div>摄像头设备:</div>
package/src/index.js CHANGED
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import ReactDOM from "react-dom";
3
3
  import "./index.less";
4
4
  import '@babel/polyfill';
5
- import { HSBC } from "../lib/hsbc";
6
- // import {HSBC} from "../packages";
5
+ // import { HSBC } from "../lib/hsbc";
6
+ import {HSBC} from "../packages";
7
7
 
8
8
  ReactDOM.render(
9
9
  <div className="hsbc"><HSBC></HSBC></div>,