react_hsbc_teller 1.0.1 → 1.0.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.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -1,27 +1,212 @@
1
1
  import React, { Component } from "react";
2
- import PropTypes from "prop-types";
2
+ import HSBC from "../pages/index";
3
3
 
4
4
  class Demo extends Component {
5
- constructor(props) {
6
- super(props);
5
+ state = {
6
+ // imRoomId: "9K9ea1vOM@conference.ls-im-xmpp.chinawp.dev.ali.cloud.cn.hsbc",
7
+ // sessionId: "9K9ea1vOM",
8
+ // mtoken: "d4e648858b03",
9
+ // roomId: "645110140224386",
10
+ roomId: '',
11
+ mtoken: '',
12
+ imRoomId: '',
13
+ sessionId: '',
14
+ isVideo: false,
15
+ tellerAccount: '00000000',
16
+ callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
17
+ businessNumber: '',
18
+ lang: 'zh',
19
+ roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
20
+ baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
21
+ resourcePath: 'https://counter-web.leimondata.cn:7199',
22
+ // roomServerUrl: 'wss://app.uat.dsp.hsbcfts.com.cn/mpaas/mrtc/ws',
23
+ // baseURL:'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/zuul/api/leimon-counter-api',
24
+ // resourcePath:'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/js/',
25
+ prohibitPrompt: '无客户',
26
+ voiceColor: '#333',
27
+ titleBackground: '#40a9ff',
28
+ titleColor: '#faad14',
29
+ microphoneSize: 50,
30
+ fontSize: 14,
31
+ fontFamily: 'auto',
32
+ isTranscribing: false
33
+ }
34
+ componentWillMount() {
35
+ // if(window.localStorage.getItem('roomId')) {
36
+ // this.setState({roomId: window.localStorage.getItem('roomId')});
37
+ // }
38
+ // if(window.localStorage.getItem('mtoken')) {
39
+ // this.setState({mtoken: window.localStorage.getItem('mtoken')});
40
+ // }
41
+ // if(window.localStorage.getItem('sessionId')) {
42
+ // this.setState({sessionId: window.localStorage.getItem('sessionId')});
43
+ // }
44
+ // if(window.localStorage.getItem('imRoomId')) {
45
+ // this.setState({imRoomId: window.localStorage.getItem('imRoomId')});
46
+ // this.startVideo()
47
+ // }
48
+
49
+ }
50
+ handleChangeRoomId = (event) => {
51
+ this.setState({roomId: event.target.value});
52
+ window.localStorage.setItem('roomId', event.target.value)
53
+ }
54
+ handleChangeRToken = (event) => {
55
+ this.setState({mtoken: event.target.value});
56
+ window.localStorage.setItem('mtoken', event.target.value)
7
57
  }
58
+ handleChangeSessionId = (event) => {
59
+ this.setState({sessionId: event.target.value});
60
+ window.localStorage.setItem('sessionId', event.target.value)
61
+ }
62
+ handleChangeImRoomId = (event) => {
63
+ this.setState({imRoomId: event.target.value});
64
+ window.localStorage.setItem('imRoomId', event.target.value)
65
+ }
66
+ startVideo = () => {
67
+ this.setState({
68
+ isVideo: true
69
+ })
70
+ }
71
+ onLeaveRoom = (val) => {
72
+ console.log(val)
73
+ this.setState({
74
+ isVideo: false
75
+ })
76
+ }
77
+ handleChangeTeller = (event) => {
78
+ this.setState({
79
+ tellerAccount: event.target.value
80
+ })
81
+ }
82
+ handleChangeCall = (event) => {
83
+ this.setState({
84
+ callbackUrl: event.target.value
85
+ })
86
+ }
87
+ handleChangeBysiness = (event) => {
88
+ this.setState({
89
+ businessNumber: event.target.value
90
+ })
91
+ }
92
+
93
+ handleRoomServerUrl = (event) => {
94
+ this.setState({
95
+ roomServerUrl: event.target.value
96
+ })
97
+ }
98
+ handleBaseURL = (event) => {
99
+ this.setState({
100
+ baseURL: event.target.value
101
+ })
102
+ }
103
+ handleChangeisTranscribing = (event) => {
104
+ this.setState({
105
+ isTranscribing: event.target.value
106
+ })
107
+ }
108
+ handleResourcePath = (event) => {
109
+ this.setState({
110
+ resourcePath: event.target.value
111
+ })
112
+ }
113
+ imgCallback=(file)=>{
114
+ console.log(file)
115
+ }
116
+ createRoomCallback=(data)=>{
117
+ console.log('createRoomCallback', data)
118
+ this.setState({roomId: data.data.roomId});
119
+ window.localStorage.setItem('roomId', data.data.roomId)
120
+ this.setState({mtoken: data.data.mtoken});
121
+ window.localStorage.setItem('mtoken', data.data.mtoken)
122
+ this.setState({sessionId:data.data.sessionId});
123
+ window.localStorage.setItem('sessionId',data.data.sessionId)
124
+ this.setState({imRoomId: data.data.imRoomId});
125
+ window.localStorage.setItem('imRoomId', data.data.imRoomId)
126
+
127
+ }
128
+ joinRoomCallback=(data)=>{
129
+ console.log('joinRoomCallback', data)
130
+ }
8
131
  render() {
9
132
  return (
10
- <div>
11
- 演示文件1
12
- </div>
133
+ <div className="test">
134
+ {
135
+ this.state.isVideo ?
136
+ <HSBC
137
+ roomId={this.state.roomId}
138
+ mtoken={this.state.mtoken}
139
+ sessionId={this.state.sessionId}
140
+ imRoomId={this.state.imRoomId}
141
+ prohibitPrompt={this.state.prohibitPrompt}
142
+ voiceColor={this.state.voiceColor}
143
+ titleBackground={this.state.titleBackground}
144
+ titleColor={this.state.titleColor}
145
+ microphoneSize={this.state.microphoneSize}
146
+ fontSize={this.state.fontSize}
147
+ fontFamily={this.state.fontFamily}
148
+ tellerAccount={this.state.tellerAccount}
149
+ callbackUrl={this.state.callbackUrl}
150
+ businessNumber={this.state.businessNumber}
151
+ lang={this.state.lang}
152
+ roomServerUrl={this.state.roomServerUrl}
153
+ baseURL={this.state.baseURL}
154
+ resourcePath={this.state.resourcePath}
155
+ isTranscribing={this.state.isTranscribing}
156
+ onLeaveRoom={this.onLeaveRoom}
157
+ createRoomCallback={this.createRoomCallback}
158
+ joinRoomCallback={this.joinRoomCallback}
159
+ imgCallback={this.imgCallback}
160
+ >
161
+
162
+ {/* <Pdf></Pdf> */}
163
+ </HSBC>
164
+ :
165
+ <div>
166
+ 坐席账号:<input placeholder="请输入坐席账号" value={this.state.tellerAccount} onChange={e => this.handleChangeTeller(e)}></input>
167
+ 回调地址:<input placeholder="请输入回调地址" value={this.state.callbackUrl} onChange={e => this.handleChangeCall(e)}></input>
168
+ 全局流水号:<input placeholder="请输入全局流水号" value={this.state.businessNumber} onChange={e => this.handleChangeBysiness(e)}></input>
169
+ 阿里服务器地址:<input placeholder="请输入阿里服务器地址" value={this.state.roomServerUrl} onChange={e => this.handleRoomServerUrl(e)}></input>
170
+ 接口地址:<input placeholder="请输入接口地址" value={this.state.baseURL} onChange={e => this.handleBaseURL(e)}></input>
171
+ 阿里资源服务地址:<input placeholder="请输入阿里资源服务地址" value={this.state.resourcePath} onChange={e => this.handleResourcePath(e)}></input>
172
+
173
+
174
+ <div>roomId: <input type="text" value={this.state.roomId} onChange={this.handleChangeRoomId} /></div>
175
+ <div>rtoken: <input type="text" value={this.state.mtoken} onChange={this.handleChangeRToken} /></div>
176
+ <div>sessionId: <input type="text" value={this.state.sessionId} onChange={this.handleChangeSessionId} /></div>
177
+ <div>imRoomId: <input type="text" value={this.state.imRoomId} onChange={this.handleChangeImRoomId} /></div>
178
+ <div>isTranscribing: <input type="text" value={this.state.isTranscribing} onChange={this.handleChangeisTranscribing} /></div>
179
+
180
+ <button className="button" onClick={this.startVideo.bind(this)}>开启视频</button>
181
+ </div>
182
+ }
183
+ </div>
184
+ // <div>
185
+ // { this.state.isPlay?
186
+ // <HSBC
187
+ // tellerAccount={this.state.tellerAccount}
188
+ // roomId={this.state.roomId}
189
+ // mtoken={this.state.mtoken}
190
+ // sessionId={this.state.sessionId}
191
+ // imRoomId={this.state.imRoomId}
192
+ // name={this.state.name}
193
+ // lang={this.state.lang}
194
+ // onLeaveRoom={this.exitRoom}
195
+ // />
196
+ // :
197
+ // <div style={{padding: '20px'}}>
198
+ // <div>账号: <input type="text" value={this.state.tellerAccount} onChange={this.handleChangeAccount} /></div>
199
+ // <div>roomId: <input type="text" value={this.state.roomId} onChange={this.handleChangeRoomId} /></div>
200
+ // <div>rtoken: <input type="text" value={this.state.mtoken} onChange={this.handleChangeRToken} /></div>
201
+ // <div>sessionId: <input type="text" value={this.state.sessionId} onChange={this.handleChangeSessionId} /></div>
202
+ // <div>imRoomId: <input type="text" value={this.state.imRoomId} onChange={this.handleChangeImRoomId} /></div>
203
+ // <div>姓名(非必填): <input type="text" value={this.state.name} onChange={this.handleChangeName} /></div>
204
+ // <div>系统语言: <input type="text" value={this.state.lang} onChange={this.handleChangeLang} /></div>
205
+ // <div><button onClick={this.joinRoom} >加入房间</button></div>
206
+ // </div>}
207
+ // </div>
13
208
  );
14
209
  }
15
210
  }
16
211
 
17
- // 指定 props 的默认值:
18
- Demo.defaultProps = {
19
- type: "default",
20
- };
21
-
22
- Demo.propTypes = {
23
- type: PropTypes.string,
24
- onClick: PropTypes.func,
25
- };
26
-
27
212
  export default Demo;
package/packages/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  import "./style/index.less";
2
2
  export { default as HSBC } from "./pages/index";
3
+ // export { default as HSBC } from "./demo/demo";
@@ -50,8 +50,11 @@ export default class foot extends Component {
50
50
  inspection = ()=>{
51
51
  this.props.inspection()
52
52
  }
53
+ screenSwitching =()=>{
54
+ this.props.screenSwitching()
55
+ }
53
56
  render() {
54
- const {clickedOcr,clickedFacial,isTranscribing,img,cameraImg,screenName,suspendName,customerList,menus,voiceName} = this.props
57
+ const {clickedOcr,clickedFacial,img,cameraImg,isTranscribing ,screenName,suspendName,customerList,menus,voiceName} = this.props
55
58
  const content = (
56
59
  <div>
57
60
  {customerList.map((item,index)=>{
@@ -69,7 +72,7 @@ export default class foot extends Component {
69
72
  {
70
73
  menus.map((item,index)=>{
71
74
  return <div key={index}className='footHover'>
72
- {
75
+ {/* {
73
76
  isTranscribing &&
74
77
  <div className="one" onClick={this.transcribingClick.bind(this)}>
75
78
  <img className="imgClass"src={require("../../assets/img/icon_copy.png").default} alt="" />
@@ -77,7 +80,7 @@ export default class foot extends Component {
77
80
  签字
78
81
  </div>
79
82
  </div>
80
- }
83
+ } */}
81
84
  {
82
85
  item == 'SHARE' && <div className="one" onClick={this.sharedScreen.bind(this)}>
83
86
  <img className="imgClass" src={require("../../assets/img/Projection_screen.png").default} alt="" />
@@ -150,6 +153,14 @@ export default class foot extends Component {
150
153
  </div>
151
154
  </div>
152
155
  </div>
156
+ {/* <div className='footHover' onClick={this.screenSwitching.bind(this)}>
157
+ <div className="one">
158
+ <img className="imgClass" src={require("../../assets/img/inspection.png").default} alt="" />
159
+ <div className="text">
160
+ 切换投屏
161
+ </div>
162
+ </div>
163
+ </div> */}
153
164
  </div>
154
165
  {defaultList}
155
166