react_hsbc_teller 2.0.6 → 2.0.8

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.6",
3
+ "version": "2.0.8",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -57,6 +57,56 @@ class API extends Server{
57
57
  throw err;
58
58
  }
59
59
  }
60
+ /**
61
+ * 用途:人脸检测
62
+ * @url https://api.cangdu.org/shopro/data/products
63
+ * 返回http_code为200表示成功
64
+ * @method post
65
+ * @return {promise}
66
+ */
67
+ async faceDetection(params = {}){
68
+ try{
69
+ let result = await this.axios('post', '/hsbc/faceDetection', params);
70
+ if(result && result.code === 200){
71
+ return result.data||[];
72
+ }else{
73
+ let err = {
74
+ tip: '人脸检测失败',
75
+ response: result,
76
+ data: params,
77
+ // url: 'https://api.cangdu.org/shopro/data/products',
78
+ }
79
+ throw err;
80
+ }
81
+ }catch(err){
82
+ throw err;
83
+ }
84
+ }
85
+ /**
86
+ * 用途:录制过程打点
87
+ * @url https://api.cangdu.org/shopro/data/products
88
+ * 返回http_code为200表示成功
89
+ * @method post
90
+ * @return {promise}
91
+ */
92
+ async saveVideoPoint(params = {}){
93
+ try{
94
+ let result = await this.axios('post', '/hsbc/business/point', params);
95
+ if(result && result.code === 200){
96
+ return result.data||[];
97
+ }else{
98
+ let err = {
99
+ tip: '打点失败',
100
+ response: result,
101
+ data: params,
102
+ // url: 'https://api.cangdu.org/shopro/data/products',
103
+ }
104
+ throw err;
105
+ }
106
+ }catch(err){
107
+ throw err;
108
+ }
109
+ }
60
110
  async confirmCallback(params = {}){
61
111
  // return this.axios('get', '/lang/select/2', params);
62
112
  try{
@@ -154,6 +204,26 @@ class API extends Server{
154
204
  throw err;
155
205
  }
156
206
  }
207
+ async uploadLogCallback(params = {}){
208
+ // return this.axios('get', '/lang/select/2', params);
209
+ try{
210
+ let result = await this.axios('post', '/sessionLog/saveOrUpdate', params);
211
+ // console.log(result)
212
+ if(result && (result.data instanceof Object) && result.code === 200){
213
+ return result||[];
214
+ }else{
215
+ let err = {
216
+ tip: '服务异常',
217
+ response: result,
218
+ data: params,
219
+ // url: 'https://api.cangdu.org/shopro/data/products',
220
+ }
221
+ throw err;
222
+ }
223
+ }catch(err){
224
+ throw err;
225
+ }
226
+ }
157
227
  async retrieveCustomerInfoByActivityId(params = {}){
158
228
  // return this.axios('get', '/lang/select/2', params);
159
229
  try{
@@ -21,6 +21,7 @@ roomId
21
21
  // mtoken: '',
22
22
  // imRoomId: '',
23
23
  // sessionId: '',
24
+ pdfRendering: false,
24
25
  isVideo: false,
25
26
  tellerAccount: 'wmzTeller',
26
27
  // callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
@@ -40,23 +41,15 @@ roomId
40
41
  fontSize: 14,
41
42
  fontFamily: 'auto',
42
43
  isTranscribing: false,
43
- userSide: 2
44
+ userSide: 2,
45
+ meetingDuration: 1, // 会议时长,单位小时
46
+ recordMode: 1, // 录制模式 1远程录制 2网点录制
47
+ defaultBranchCode: "BranchCode",// 员工网点缩写
48
+ customerId: "testCustomerId", //客户号
49
+ salesBranchCode: 'salesBranchCode', //网点编号(分行号)
50
+ financialOffice: "defaultOfficeId", // 理财室
44
51
  }
45
52
  componentWillMount() {
46
- // if(window.localStorage.getItem('roomId')) {
47
- // this.setState({roomId: window.localStorage.getItem('roomId')});
48
- // }
49
- // if(window.localStorage.getItem('mtoken')) {
50
- // this.setState({mtoken: window.localStorage.getItem('mtoken')});
51
- // }
52
- // if(window.localStorage.getItem('sessionId')) {
53
- // this.setState({sessionId: window.localStorage.getItem('sessionId')});
54
- // }
55
- // if(window.localStorage.getItem('imRoomId')) {
56
- // this.setState({imRoomId: window.localStorage.getItem('imRoomId')});
57
- // this.startVideo()
58
- // }
59
-
60
53
  }
61
54
  handleChangeRoomId = (event) => {
62
55
  this.setState({roomId: event.target.value});
@@ -142,6 +135,17 @@ shareMaskClick=()=>{
142
135
  }
143
136
 
144
137
  }
138
+ pdfRenderingClick=()=>{
139
+ if(this.state.pdfRendering) {
140
+ this.setState({
141
+ pdfRendering: false
142
+ })
143
+ } else {
144
+ this.setState({
145
+ pdfRendering: true
146
+ })
147
+ }
148
+ }
145
149
  createRoomCallback=(data)=>{
146
150
  console.log('createRoomCallback', data)
147
151
  this.setState({roomId: data.data.roomId});
@@ -195,6 +199,7 @@ userExit =(val)=>{
195
199
  <div>
196
200
  <HSBC
197
201
  shareMask={this.state.shareMask}
202
+ pdfRendering={this.state.pdfRendering}
198
203
  roomId={this.state.roomId}
199
204
  mtoken={this.state.mtoken}
200
205
  sessionId={this.state.sessionId}
@@ -211,14 +216,23 @@ userExit =(val)=>{
211
216
  callbackUrl={this.state.callbackUrl}
212
217
  businessNumber={this.state.businessNumber}
213
218
  lang={this.state.lang}
219
+ isWeakSound={true}
214
220
  roomServerUrl={this.state.roomServerUrl}
215
221
  baseURL={this.state.baseURL}
216
222
  resourcePath={this.state.resourcePath}
217
223
  isTranscribing={this.state.isTranscribing}
224
+ meetingDuration={this.state.meetingDuration}
225
+ recordMode={this.state.recordMode}
226
+ defaultBranchCode={this.state.defaultBranchCode}
227
+ customerId={this.state.customerId}
228
+ salesBranchCode={this.state.salesBranchCode}
229
+ financialOffice={this.state.financialOffice}
218
230
  onLeaveRoom={this.onLeaveRoom}
219
231
  createRoomCallback={this.createRoomCallback}
220
232
  joinRoomCallback={this.joinRoomCallback}
221
233
  imgCallback={this.imgCallback}
234
+ sfpCallback={()=>{console.log('sfpCallback success')}}
235
+ OnNetworkWeak={(a, b, c)=>{console.log('OnNetworkWeak', a,b,c)}}
222
236
  userExit={this.userExit}
223
237
  staffPermission={this.staffPermission}
224
238
  >
@@ -226,6 +240,7 @@ userExit =(val)=>{
226
240
  <Pdf></Pdf>
227
241
  </HSBC>
228
242
  <button onClick={this.shareMaskClick.bind(this)}>遮罩层</button>
243
+ <button onClick={this.pdfRenderingClick.bind(this)}>{this.state.pdfRendering?'继续':'暂停'}渲染</button>
229
244
  </div>
230
245
  :
231
246
  <div>
@@ -2,6 +2,7 @@ import React, { Component } from "react";
2
2
 
3
3
  class pdf extends Component {
4
4
  state = {
5
+ testTime: '',
5
6
  isVideo: false,
6
7
  tellerAccount: '',
7
8
  callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
@@ -11,6 +12,12 @@ class pdf extends Component {
11
12
  baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
12
13
  resourcePath:'https://counter-web.leimondata.cn:7199',
13
14
  }
15
+ componentDidMount () {
16
+ this.countTimer()
17
+ }
18
+ componentWillUnmount() {
19
+ clearInterval(this.state.timer)
20
+ }
14
21
  startVideo = () => {
15
22
  this.setState({
16
23
  isVideo: true
@@ -53,9 +60,16 @@ handleResourcePath = (event) => {
53
60
  resourcePath: event.target.value
54
61
  })
55
62
  }
63
+ countTimer = () => {
64
+ this.state.timer = setInterval(() => {
65
+ this.setState({
66
+ testTime: new Date().toString()
67
+ })
68
+ }, 1000);
69
+ }
56
70
 
57
71
  render() {
58
- console.log('22',this.props)
72
+ // console.log('22',this.props)
59
73
  return (
60
74
  <div className="test" style={{width: this.props.width,height:this.props.height}}>
61
75
  {
@@ -68,6 +82,7 @@ handleResourcePath = (event) => {
68
82
  阿里资源服务地址:<input placeholder="请输入阿里资源服务地址" value={this.state.resourcePath} onChange={e => this.handleResourcePath(e)}></input>
69
83
 
70
84
  <button className="button" onClick={this.startVideo.bind(this)}>开启视频</button>
85
+ <div>{this.state.testTime}</div>
71
86
  </div>
72
87
  }
73
88
  </div>