react_hsbc_teller 2.0.23 → 2.0.25

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.
Files changed (27) hide show
  1. package/lib/hsbc.js +1 -1
  2. package/package.json +1 -1
  3. package/packages/api/api.js +91 -0
  4. package/packages/assets/mp3/ipad_leave_error.mp3 +0 -0
  5. package/packages/assets/mp3/ipad_low_power.mp3 +0 -0
  6. package/packages/assets/mp3/record_error.mp3 +0 -0
  7. package/packages/demo/demo.js +2 -0
  8. package/packages/pages/foot/foot.jsx +2 -2
  9. package/packages/pages/multiModule/components/copy/agree.jsx +115 -0
  10. package/packages/pages/multiModule/components/copy/agree.less +105 -0
  11. package/packages/pages/multiModule/components/copy/copyTwo.jsx +663 -0
  12. package/packages/pages/multiModule/components/copy/copyTwo.less +180 -0
  13. package/packages/pages/multiModule/components/copy/copy_en.jsx +365 -0
  14. package/packages/pages/multiModule/components/copy/copy_en.less +145 -0
  15. package/packages/pages/multiModule/components/copy/copylist.jsx +291 -0
  16. package/packages/pages/multiModule/components/copy/copylist.less +83 -0
  17. package/packages/pages/multiModule/components/copy/risk.jsx +294 -0
  18. package/packages/pages/multiModule/components/copy/risk.less +123 -0
  19. package/packages/pages/multiModule/components/sign/signMy.jsx +306 -0
  20. package/packages/pages/multiModule/components/sign/signMy.less +128 -0
  21. package/packages/pages/multiModule/components/subscribe/subscribe.jsx +113 -0
  22. package/packages/pages/multiModule/components/subscribe/subscribe.less +82 -0
  23. package/packages/pages/multiModule/multiModule.jsx +26 -0
  24. package/packages/pages/multiModule/multiModule.less +20 -0
  25. package/packages/pages/video/video.jsx +430 -166
  26. package/packages/utils/asrController.js +242 -0
  27. package/packages/utils/recorder.js +289 -0
@@ -0,0 +1,123 @@
1
+ .risk{
2
+ height: 100%;
3
+ background: #fff;
4
+ position: relative;
5
+ display: flex;
6
+ flex-direction: column;
7
+ .thehead{
8
+ display: flex;
9
+ justify-content: space-between;
10
+ padding: 14px 24px ;
11
+ .title{
12
+ display: flex;
13
+ .title-color{
14
+ width: 2px;
15
+ height: 1.5rem;
16
+ background: #00847F;
17
+ margin-top: 0.25rem;
18
+ }
19
+ .title-text{
20
+ font-size: 1.5rem;
21
+ color: #323232;
22
+ margin-left: 8px;
23
+ font-weight: 500;
24
+ }
25
+
26
+ }
27
+ .btns{
28
+ display: flex;
29
+ }
30
+ .qianshu{
31
+ width: 96px;
32
+ height: 2rem;
33
+ background: #F9F2F3;
34
+ border-radius: 2px;
35
+ border: 1px solid #E5B2B5;
36
+ font-size: 14px;
37
+ color: #DB0011;
38
+ line-height: 2rem;
39
+ text-align: center;
40
+ }
41
+ .reset{
42
+ width: 96px;
43
+ height: 2rem;
44
+ background: white;
45
+ border-radius: 2px;
46
+ border: 1px solid #DCDCDC;
47
+ font-size: 14px;
48
+ color: #646464;
49
+ line-height: 2rem;
50
+ text-align: center;
51
+ margin-right: 8px;
52
+ }
53
+ }
54
+
55
+ .content{
56
+ // min-height: 300px;
57
+ border-radius: 4px;
58
+ border:1.5px dashed #646464;
59
+ margin: 24px;
60
+ position: relative;
61
+ width: fit-content;
62
+ height: fit-content;
63
+ box-sizing: border-box;
64
+ align-self: center;
65
+ // left: 50%;
66
+ // top: 35%;
67
+ // transform: translate(-50%,-50%);
68
+ // flex:1;
69
+ }
70
+ .signHere{
71
+ font-size: 30px;
72
+ font-weight: 500;
73
+ // white-space: nowrap;
74
+ color: #c0bcbc;
75
+ position: absolute;
76
+ top: 50%;
77
+ left: 50%;
78
+ transform: translate(-50%, -50%);
79
+ pointer-events: none;
80
+ width: 90%;
81
+ max-height: 98%;
82
+ }
83
+
84
+ }
85
+ .modalEndTitle{
86
+ font-size: 20px;
87
+ }
88
+ .modalEnd{
89
+ font-size: 15px;
90
+ margin-left: 20px;
91
+ margin-top: 15px;
92
+ }
93
+
94
+ .footRisk{
95
+ margin: auto;
96
+ margin-bottom: 15px;
97
+ .btns{
98
+ display: flex;
99
+ }
100
+ .qianshu{
101
+ height: 2.5rem;
102
+ line-height: 2.5rem;
103
+ width: 6rem;
104
+ font-size: 1.1rem;
105
+ background: #F9F2F3;
106
+ border-radius: 2px;
107
+ border: 1px solid #E5B2B5;
108
+ color: #DB0011;
109
+ text-align: center;
110
+ }
111
+ .reset{
112
+ height: 2.5rem;
113
+ line-height: 2.5rem;
114
+ width: 6rem;
115
+ font-size: 1.1rem;
116
+ background: white;
117
+ border-radius: 2px;
118
+ border: 1px solid #DCDCDC;
119
+ color: #646464;
120
+ text-align: center;
121
+ margin-right: 8px;
122
+ }
123
+ }
@@ -0,0 +1,306 @@
1
+ import React, { Component } from 'react';
2
+ import { message } from 'antd';
3
+ import { FormattedMessage, injectIntl } from 'react-intl';
4
+ import './signMy.less'
5
+ import Modal from "antd/lib/modal";
6
+ import 'antd/lib/modal/style'
7
+ import { Button } from '../../../../../node_modules/antd/lib/index';
8
+ @injectIntl
9
+ class Sign extends Component {
10
+ signCanvas = React.createRef();
11
+ state = {
12
+ canvasCtx: null,
13
+ heightOne: '0px',
14
+ widthOne: '0px',
15
+ isModalVisibleEnd: false,
16
+ isModalVisibleSubmit: false,
17
+ isSignOk: false
18
+ };
19
+
20
+ componentDidMount() {
21
+ setTimeout(() => {
22
+ // console.log(document.getElementById('multiModule').offsetWidth)
23
+ let canvasWidth = document.getElementById('multiModule').offsetWidth - 40
24
+ let canvasHeight = canvasWidth * (Number(this.props.height)) / (Number(this.props.length))
25
+
26
+ // 适应竖长图
27
+ if(canvasHeight > document.getElementById('multiModule').offsetHeight - 120){
28
+ canvasHeight = document.getElementById('multiModule').offsetHeight - 120
29
+ canvasWidth = canvasHeight * (Number(this.props.length)) / (Number(this.props.height))
30
+ }
31
+
32
+ const canvas = this.refs.canvasF;
33
+ canvas.height =canvasHeight || this.refs.canvasHW.offsetHeight;
34
+ canvas.width = canvasWidth || this.refs.canvasHW.offsetWidth;
35
+ this.setState({
36
+ heightOne: canvas.height + 'px',
37
+ widthOne: canvas.width + 'px'
38
+ })
39
+ this.state.canvasCtx = canvas.getContext('2d');
40
+ this.state.stageInfo = canvas.getBoundingClientRect();
41
+ this.state.canvasCtx.lineWidth = 7;
42
+ this.state.canvasCtx.lineCap = "round";
43
+ // this.state.isSignOk = false
44
+ this.setState({
45
+ isSignOk: false
46
+ })
47
+
48
+ canvas.addEventListener('touchstart', this.touchStart, { passive: false });
49
+ canvas.addEventListener('touchmove', this.touchMove, { passive: false });
50
+ canvas.addEventListener('touchend', this.touchEnd, { passive: false });
51
+ }, 10);
52
+
53
+
54
+ }
55
+ componentWillUnmount () {
56
+ const canvas = this.refs.canvasF;
57
+ canvas.removeEventListener('touchstart', this.touchStart);
58
+ canvas.removeEventListener('touchmove', this.touchMove);
59
+ canvas.removeEventListener('touchend', this.touchEnd);
60
+ }
61
+
62
+ // 清空画布
63
+ clearSign = async () => {
64
+ this.setState({
65
+ isSignOk: false
66
+ })
67
+ // this.state.isSignOk = false
68
+ const canvas = this.refs.canvasF;
69
+ // 清除画布
70
+ this.state.canvasCtx.clearRect(
71
+ 0,
72
+ 0,
73
+ canvas.width,
74
+ canvas.height,
75
+ );
76
+ };
77
+ touchStart=(ev)=> {
78
+ this.setState({
79
+ isSignOk: true
80
+ })
81
+ // this.state.isSignOk = true
82
+ ev = ev || event
83
+ ev.preventDefault()
84
+ if (ev.touches.length == 1) {
85
+ let obj = {
86
+ x: ev.targetTouches[0].clientX,
87
+ y: ev.targetTouches[0].clientY,
88
+ }
89
+ this.state.startX = obj.x
90
+ this.state.startY = obj.y
91
+ this.state.canvasCtx.beginPath()
92
+ const canvas = this.refs.canvasF;
93
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
94
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
95
+ this.state.canvasCtx.stroke()
96
+ this.state.canvasCtx.closePath()
97
+ // this.points.push(obj)
98
+
99
+ }
100
+ }
101
+ touchMove=(ev)=>{
102
+ ev = ev || event
103
+ ev.preventDefault()
104
+ if (ev.touches.length == 1) {
105
+ let obj = {
106
+ x: ev.targetTouches[0].clientX,
107
+ y: ev.targetTouches[0].clientY
108
+ }
109
+ this.state.moveY = obj.y
110
+ this.state.moveX = obj.x
111
+ this.state.canvasCtx.beginPath()
112
+ // strokeStyle = 'blue';
113
+ const canvas = this.refs.canvasF;
114
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
115
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
116
+ this.state.canvasCtx.stroke()
117
+ this.state.canvasCtx.closePath()
118
+ this.state.startY = obj.y
119
+ this.state.startX = obj.x
120
+ // this.points.push(obj)
121
+ }
122
+ }
123
+ touchEnd=(ev)=> {
124
+ ev = ev || event
125
+ ev.preventDefault()
126
+
127
+ if (ev.touches.length == 1) {
128
+ let obj = {
129
+ x: ev.targetTouches[0].clientX ,
130
+ y: ev.targetTouches[0].clientY
131
+ }
132
+ this.state.canvasCtx.beginPath()
133
+ const canvas = this.refs.canvasF;
134
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
135
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
136
+ this.state.canvasCtx.stroke()
137
+ this.state.canvasCtx.closePath()
138
+ // this.points.push(obj)
139
+ }
140
+ }
141
+ // pc
142
+ mouseDown=(ev) =>{
143
+ this.setState({
144
+ isSignOk: true
145
+ })
146
+ // this.state.isSignOk = true
147
+ ev.preventDefault();
148
+ const obj = {
149
+ x: ev.pageX,
150
+ y: ev.pageY,
151
+ };
152
+ const canvas = this.refs.canvasF;
153
+ this.state.startX = obj.x;
154
+ this.state.startY = obj.y;
155
+ this.state.canvasCtx.beginPath();
156
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
157
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
158
+ this.state.canvasCtx.stroke();
159
+ this.state.canvasCtx.closePath();
160
+ this.state.isDown = true;
161
+
162
+ }
163
+ mouseMove=(ev)=> {
164
+ ev.preventDefault();
165
+ if (this.state.isDown) {
166
+ const obj = {
167
+ x: ev.pageX,
168
+ y: ev.pageY,
169
+ };
170
+ const canvas = this.refs.canvasF;
171
+ if(obj.x - canvas.getBoundingClientRect().left<0 || obj.x - canvas.getBoundingClientRect().left> canvas.width || obj.y - canvas.getBoundingClientRect().top< 0 || obj.y - canvas.getBoundingClientRect().top> canvas.height) {
172
+ this.state.isDown = false;
173
+ }
174
+ this.state.moveY = obj.y;
175
+ this.state.moveX = obj.x;
176
+ this.state.canvasCtx.beginPath();
177
+
178
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
179
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
180
+ this.state.canvasCtx.stroke();
181
+ this.state.canvasCtx.closePath();
182
+ this.state.startY = obj.y;
183
+ this.state.startX = obj.x;
184
+ }
185
+ }
186
+ mouseUp=(ev)=> {
187
+ ev.preventDefault();
188
+ const obj = {
189
+ x: ev.pageX,
190
+ y: ev.pageY,
191
+ };
192
+ const canvas = this.refs.canvasF;
193
+ this.state.canvasCtx.beginPath();
194
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
195
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
196
+ this.state.canvasCtx.stroke();
197
+ this.state.canvasCtx.closePath();
198
+ this.state.isDown = false;
199
+
200
+ }
201
+ commit = async () => {
202
+ if(this.state.isSignOk) {
203
+ console.log(this.refs.canvasF.toDataURL())
204
+
205
+ this.props.finish(this.refs.canvasF.toDataURL())
206
+
207
+ } else {
208
+ this.setState({
209
+ isModalVisibleSubmit: true
210
+ }) }
211
+ }
212
+ exit = () => {
213
+ this.setState({
214
+ isModalVisibleEnd: true
215
+ })
216
+ }
217
+ handleCancelEnd = () => {
218
+ this.setState({
219
+ isModalVisibleEnd: false
220
+ })
221
+ }
222
+ handleOkEnd = () => {
223
+ this.setState({
224
+ isModalVisibleEnd: false
225
+ })
226
+ this.props.exit()
227
+ }
228
+ handleSubmit=()=>{
229
+ this.setState({
230
+ isModalVisibleSubmit: false
231
+ })
232
+ }
233
+ render() {
234
+ return (
235
+ <div className="sign">
236
+ <div className="thehead">
237
+ <div className="title">
238
+ <div className="title-color"></div>
239
+ <div className="title-text">{this.props.title}</div>
240
+ </div>
241
+ <div className='btns'>
242
+ <div className="reset" onClick={this.exit}><FormattedMessage id="exit" /></div>
243
+ </div>
244
+ </div>
245
+ <div className="content" ref="canvasHW" style={{height: this.state.heightOne,width: this.state.widthOne}}>
246
+ <canvas
247
+ id="canvasF"
248
+ className='canvasF'
249
+ ref="canvasF"
250
+ // onTouchStart={this.touchStart}
251
+ // onTouchMove={this.touchMove}
252
+ // onTouchEnd={this.touchEnd}
253
+ onMouseDown={this.mouseDown}
254
+ onMouseMove={this.mouseMove}
255
+ onMouseUp={this.mouseUp}
256
+ ></canvas>
257
+ {
258
+ !this.state.isSignOk && <div className="signHere"><FormattedMessage id="plzSign" /></div>
259
+
260
+ }
261
+ </div>
262
+ <div className='footRisk'>
263
+ <div className='btns'>
264
+ <div className="reset" onClick={this.clearSign}><FormattedMessage id="clearScreen" /></div>
265
+ <div className="qianshu" onClick={this.commit}><FormattedMessage id="commit" /></div>
266
+
267
+ </div>
268
+ </div>
269
+ <Modal transitionName="" maskTransitionName="" getContainer={document.getElementById('multiModule')} destroyOnClose={true} closable={false} centered={true} visible={this.state.isModalVisibleSubmit} footer={[<div key='end'>
270
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleSubmit}><FormattedMessage id="ok" /></Button>
271
+ </div>
272
+ ]}>
273
+ <div className='endModal'>
274
+ <div className='modalEndTitle'>
275
+ <FormattedMessage id="message" />
276
+ </div>
277
+ <div className='modalEnd'>
278
+ <FormattedMessage id="signatureNot" />
279
+ </div>
280
+ </div>
281
+ </Modal>
282
+ <Modal transitionName="" maskTransitionName="" getContainer={document.getElementById('multiModule')} destroyOnClose={true} closable={false} centered={true} visible={this.state.isModalVisibleEnd} footer={[<div key='end'>
283
+ <Button className="modelButtonCancel" onClick={this.handleCancelEnd}><FormattedMessage id="cancel" /></Button>
284
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkEnd}><FormattedMessage id="ok" /></Button>
285
+ </div>
286
+ ]}>
287
+ <div className='endModal'>
288
+ <div className='modalEndTitle'>
289
+ <FormattedMessage id="whether" />
290
+ </div>
291
+ <div className='modalEnd'>
292
+ <FormattedMessage id="progress" />
293
+ </div>
294
+ </div>
295
+ </Modal>
296
+ </div>
297
+ );
298
+ }
299
+
300
+ }
301
+ Sign.defaultProps = {
302
+ length: '100%',
303
+ height: '100%'
304
+ }
305
+
306
+ export default Sign;
@@ -0,0 +1,128 @@
1
+ .sign{
2
+ // min-height: 100%;
3
+ height: 100%;
4
+ background: #fff;
5
+ position: relative;
6
+ display: flex;
7
+ flex-direction: column;
8
+
9
+ .thehead{
10
+ display: flex;
11
+ justify-content: space-between;
12
+ padding: 14px 24px ;
13
+ .title{
14
+ display: flex;
15
+ .title-color{
16
+ width: 2px;
17
+ height: 1.5rem;
18
+ background: #00847F;
19
+ margin-top: 0.25rem;
20
+ }
21
+ .title-text{
22
+ font-size: 1.5rem;
23
+ color: #323232;
24
+ margin-left: 8px;
25
+ font-weight: 500;
26
+ }
27
+
28
+ }
29
+ .btns{
30
+ display: flex;
31
+ }
32
+ .qianshu{
33
+ width: 96px;
34
+ height: 2rem;
35
+ background: #F9F2F3;
36
+ border-radius: 2px;
37
+ border: 1px solid #E5B2B5;
38
+ font-size: 14px;
39
+ color: #DB0011;
40
+ line-height: 2rem;
41
+ text-align: center;
42
+ }
43
+ .reset{
44
+ width: 96px;
45
+ height: 2rem;
46
+ background: white;
47
+ border-radius: 2px;
48
+ border: 1px solid #DCDCDC;
49
+ font-size: 14px;
50
+ color: #646464;
51
+ line-height: 2rem;
52
+ text-align: center;
53
+ margin-right: 8px;
54
+ }
55
+ }
56
+
57
+ .content{
58
+ // min-height: 300px;
59
+ border-radius: 4px;
60
+ border:1.5px dashed #646464;
61
+ margin: auto;
62
+ position: relative;
63
+ // flex:1;
64
+
65
+ .canvasF{
66
+ z-index: 10;
67
+ position: absolute;
68
+ margin: auto;
69
+ }
70
+ }
71
+ .signHere{
72
+ font-size: 50px;
73
+ font-weight: 500;
74
+ color: #646464;
75
+ position: absolute;
76
+ top: 50%;
77
+ left: 50%;
78
+ transform: translate(-50%, -50%);
79
+ -moz-user-select:none;/*火狐*/
80
+ -webkit-user-select:none;/*webkit浏览器*/
81
+ -ms-user-select:none;/*IE10*/
82
+ -khtml-user-select:none;/*早期浏览器*/
83
+ user-select:none;
84
+ opacity: 0.2;
85
+ pointer-events: none;
86
+ }
87
+
88
+ }
89
+ .modalEndTitle{
90
+ font-size: 20px;
91
+ }
92
+ .modalEnd{
93
+ font-size: 15px;
94
+ margin-left: 20px;
95
+ margin-top: 15px;
96
+ }
97
+
98
+
99
+ .footRisk{
100
+ margin: auto;
101
+ margin-top: 15px;
102
+ .btns{
103
+ display: flex;
104
+ }
105
+ .qianshu{
106
+ height: 2.5rem;
107
+ line-height: 2.5rem;
108
+ width: 6rem;
109
+ font-size: 1.1rem;
110
+ background: #F9F2F3;
111
+ border-radius: 2px;
112
+ border: 1px solid #E5B2B5;
113
+ color: #DB0011;
114
+ text-align: center;
115
+ }
116
+ .reset{
117
+ height: 2.5rem;
118
+ line-height: 2.5rem;
119
+ width: 6rem;
120
+ font-size: 1.1rem;
121
+ background: white;
122
+ border-radius: 2px;
123
+ border: 1px solid #DCDCDC;
124
+ color: #646464;
125
+ text-align: center;
126
+ margin-right: 8px;
127
+ }
128
+ }
@@ -0,0 +1,113 @@
1
+ import React, { Component } from "react";
2
+ import Sign from "../sign/signMy"; //签字
3
+ import "./subscribe.less";
4
+ import API from "@/api/api";
5
+ import { FormattedMessage, injectIntl } from "react-intl";
6
+ import Modal from "antd/lib/modal";
7
+ import 'antd/lib/modal/style'
8
+ import { Button } from '../../../../../node_modules/antd/lib/index';
9
+ import { message } from 'antd';
10
+ @injectIntl
11
+ class subscribe extends Component {
12
+ state = {
13
+ data: {
14
+ sessionId: "r7Sjf5Afj",
15
+ appAccount: "ts002",
16
+ transactionId: "20220221 - Q0001063343",
17
+ appointmentId: "100219197",
18
+ step: "ssq-customer",
19
+ title:
20
+ "[0xe5][0x94][0xa4][0xe9][0x86][0x92][0xe5][0xae][0xa2][0xe6][0x88][0xb7][0xe7][0xad][0xbe]",
21
+ length: "337",
22
+ height: "177",
23
+ list: [
24
+ {
25
+ productName: [],
26
+ file: [
27
+ {
28
+ docId: "6b381985-1c9a-4859-92a2-a63e8c315b8a",
29
+ docType: "GEN-RPQ",
30
+ docText:
31
+ "[0xe9][0xa3][0x8e][0xe9][0x99][0xa9][0xe8][0xaf][0x84][0xe4][0xbc][0xb0][0xe9][0x97][0xae][0xe5][0x8d][0xb7]",
32
+ transactionNumber: "20220221 - Q0001063343",
33
+ appointmentId: "100219197",
34
+ },
35
+ ],
36
+ },
37
+ ],
38
+ callbackUrl: "http://47.102.126.132:8720/hsbc/callback",
39
+ },
40
+ showSign: true,
41
+ isModalVisibleSubmitError: false
42
+ };
43
+ sign = () => {
44
+ this.setState({
45
+ showSign: true,
46
+ });
47
+ };
48
+ exit = () => {
49
+ this.props.handleReceiveMsg({
50
+ 'typeId': 121305,
51
+ 'sessionId': window.imRoom.sessionId,
52
+ })
53
+ this.props.finish();
54
+ };
55
+ finish = async (fileBase64) => {
56
+ // console.log({ ...this.props.data, file: fileBase64 })
57
+ let result = await API.signFileCallback({
58
+ ...this.props.data,
59
+ fileBase64: fileBase64.replace('data:image/png;base64,',''),
60
+ });
61
+ if(result.code == 500) {
62
+ this.setState({
63
+ isModalVisibleSubmitError: true
64
+ })
65
+ } else{
66
+ message.success(this.props.intl.formatMessage({id: 'signSuccess'}),);
67
+ this.props.handleReceiveMsg({
68
+ 'typeId': 1216,
69
+ 'sessionId': window.imRoom.sessionId,
70
+ 'userId': window.imRoom.userId
71
+ })
72
+ this.setState({
73
+ showSign: false,
74
+ });
75
+ this.props.finish();
76
+ }
77
+
78
+ };
79
+ handleSubmit=()=>{
80
+ this.setState({
81
+ isModalVisibleSubmitError: false
82
+ })
83
+ }
84
+ componentWillMount() {
85
+ // 初始化数据
86
+ let data = this.props.data || this.state.data;
87
+ this.setState({
88
+ data: data,
89
+ });
90
+ }
91
+ render() {
92
+ return (
93
+ <div style={{height: '99%'}}>
94
+ <Sign title={this.state.data.title} length={this.state.data.length} height={this.state.data.height} exit={this.exit} finish={this.finish} />
95
+ <Modal destroyOnClose={true} getContainer={document.getElementById('multiModule')} closable={false} centered={true} visible={this.state.isModalVisibleSubmitError} footer={[<div key='end'>
96
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleSubmit}><FormattedMessage id="ok" /></Button>
97
+ </div>
98
+ ]}>
99
+ <div className='endModal'>
100
+ <div className='modalEndTitle'>
101
+ <FormattedMessage id="message" />
102
+ </div>
103
+ <div className='modalEnd'>
104
+ <FormattedMessage id="submission" />
105
+ </div>
106
+ </div>
107
+ </Modal>
108
+ </div>
109
+ )
110
+ }
111
+ }
112
+
113
+ export default subscribe;