react_hsbc_teller 2.0.5 → 2.0.6-5.1

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 (71) hide show
  1. package/.babelrc +39 -39
  2. package/README.en.md +36 -36
  3. package/README.md +352 -52
  4. package/config/webpack.config.js +119 -119
  5. package/config/webpack.dev.js +108 -108
  6. package/config/webpack.prod.js +104 -104
  7. package/lib/hsbc.js +1 -1
  8. package/lib/hsbc.js.LICENSE.txt +24 -16
  9. package/package.json +110 -109
  10. package/packages/api/api.js +818 -570
  11. package/packages/api/server.js +50 -50
  12. package/packages/assets/img/icon_fail.jpg +0 -0
  13. package/packages/assets/img/icon_paper.png +0 -0
  14. package/packages/assets/img/icon_success.jpg +0 -0
  15. package/packages/assets/mp3/ipad_join_meeting.mp3 +0 -0
  16. package/packages/assets/mp3/ipad_leave_error.mp3 +0 -0
  17. package/packages/assets/mp3/ipad_leave_meeting.mp3 +0 -0
  18. package/packages/assets/mp3/ipad_low_power.mp3 +0 -0
  19. package/packages/assets/mp3/ipad_media_close.mp3 +0 -0
  20. package/packages/assets/mp3/media_error.mp3 +0 -0
  21. package/packages/assets/mp3/networkweak.mp3 +0 -0
  22. package/packages/assets/mp3/pip_close.mp3 +0 -0
  23. package/packages/assets/mp3/record_error.mp3 +0 -0
  24. package/packages/assets/mp3/share_stop_audio.mp3 +0 -0
  25. package/packages/common/index.esm.js +374 -374
  26. package/packages/demo/demo.js +307 -279
  27. package/packages/demo/index.js +3 -3
  28. package/packages/demo/pdf.js +94 -79
  29. package/packages/envconfig/envconfig.js +12 -12
  30. package/packages/index.js +2 -2
  31. package/packages/pages/components/step/step.jsx +25 -31
  32. package/packages/pages/foot/foot.jsx +235 -234
  33. package/packages/pages/foot/foot.less +85 -85
  34. package/packages/pages/header/header.jsx +15 -15
  35. package/packages/pages/header/header.less +51 -51
  36. package/packages/pages/index.jsx +52 -52
  37. package/packages/pages/multiModule/components/copy/agree.jsx +115 -0
  38. package/packages/pages/multiModule/components/copy/agree.less +105 -0
  39. package/packages/pages/multiModule/components/copy/copyTwo.jsx +682 -0
  40. package/packages/pages/multiModule/components/copy/copyTwo.less +180 -0
  41. package/packages/pages/multiModule/components/copy/copy_en.jsx +368 -0
  42. package/packages/pages/multiModule/components/copy/copy_en.less +145 -0
  43. package/packages/pages/multiModule/components/copy/copylist.jsx +291 -0
  44. package/packages/pages/multiModule/components/copy/copylist.less +83 -0
  45. package/packages/pages/multiModule/components/copy/risk.jsx +296 -0
  46. package/packages/pages/multiModule/components/copy/risk.less +123 -0
  47. package/packages/pages/multiModule/components/sign/signMy.jsx +308 -0
  48. package/packages/pages/multiModule/components/sign/signMy.less +128 -0
  49. package/packages/pages/multiModule/components/subscribe/subscribe.jsx +113 -0
  50. package/packages/pages/multiModule/components/subscribe/subscribe.less +82 -0
  51. package/packages/pages/multiModule/multiModule.jsx +26 -0
  52. package/packages/pages/multiModule/multiModule.less +20 -0
  53. package/packages/pages/sign/signMy.jsx +223 -221
  54. package/packages/pages/sign/signMy.less +129 -129
  55. package/packages/pages/video/video.jsx +7751 -6164
  56. package/packages/pages/video/video.less +718 -635
  57. package/packages/style/index.less +1 -1
  58. package/packages/style/reset.less +345 -345
  59. package/packages/utils/asrController.js +259 -0
  60. package/packages/utils/asyncComponent.jsx +26 -26
  61. package/packages/utils/mixin.js +27 -27
  62. package/packages/utils/setRem.js +10 -10
  63. package/packages/utils/utils.js +199 -0
  64. package/public/index.html +77 -77
  65. package/src/index.js +11 -11
  66. package/src/index.less +5 -5
  67. package/tsconfig.json +11 -11
  68. package/packages/common/JKL.js +0 -61
  69. package/packages/common/XML.js +0 -271
  70. package/packages/common/websocket.js +0 -267
  71. package/packages/utils/cell.js +0 -64
@@ -0,0 +1,82 @@
1
+ .subscribe{
2
+ min-height: 100%;
3
+ background: #fff;
4
+ .thehead{
5
+ display: flex;
6
+ justify-content: space-between;
7
+ padding: 14px 24px;
8
+ .title{
9
+ display: flex;
10
+ .title-color{
11
+ width: 2px;
12
+ height: 1.5rem;
13
+ background: #00847F;
14
+ margin-top: 3px;
15
+ }
16
+ .title-text{
17
+ font-size: 1.5rem;
18
+ color: #323232;
19
+ margin-left: 8px;
20
+ }
21
+
22
+ }
23
+ .qianshu{
24
+ width: 96px;
25
+ height: 32px;
26
+ background: #F9F2F3;
27
+ border-radius: 2px;
28
+ border: 1px solid #E5B2B5;
29
+ font-size: 14px;
30
+ color: #DB0011;
31
+ line-height: 32px;
32
+ text-align: center;
33
+ }
34
+ }
35
+ .contents{
36
+ display: flex;
37
+ flex-direction: column;
38
+ flex-wrap: wrap;
39
+ padding: 10px 24px;
40
+ .item-panel{
41
+ width: 100%;
42
+ min-height: 205px;
43
+ background: #FFFFFF;
44
+ border-radius: 4px;
45
+ border: 1px solid #E8E8E8;
46
+ overflow: hidden;
47
+ margin-top: 10px;
48
+ .item-header{
49
+ width: 100%;
50
+ height: 48px;
51
+ background: #FAFBFC;
52
+ border-radius: 4px 4px 0px 0px;
53
+ line-height: 48px;
54
+ font-size: 16px;
55
+ padding-left: 20px;
56
+ }
57
+ .item-info{
58
+ padding: 15px 22px;
59
+ .item-sub-title{
60
+ font-size: 12px;
61
+ font-weight: 400;
62
+ color: #969696;
63
+ &:not(:first-child){
64
+ margin-top: 20px;
65
+ }
66
+ }
67
+ .content-text{
68
+ font-size: 16px;
69
+ font-family: PingFangSC-Regular, PingFang SC;
70
+ font-weight: 400;
71
+ color: #666666;
72
+ line-height: 30px;
73
+ }
74
+ }
75
+
76
+ }
77
+
78
+ }
79
+
80
+
81
+
82
+ }
@@ -0,0 +1,26 @@
1
+ import React, { Component } from 'react';
2
+ import './multiModule.less'
3
+ import Copy from "./components/copy/copylist" //抄录
4
+ import Subscribe from "./components/subscribe/subscribe" //签署
5
+ class multiModule extends Component {
6
+ state = {
7
+ };
8
+ handleReceiveMsg = (msg) => {
9
+ this.props.handleReceiveMsg(JSON.stringify(msg))
10
+ }
11
+ finish = () => {
12
+ this.props.finish()
13
+ }
14
+ render() {
15
+ return (
16
+ <div id='multiModule' className="multiModule">
17
+ {/* <Subscribe /> */}
18
+ {this.props.moduleName=='copy'?<Copy data={this.props.data} handleReceiveMsg={this.handleReceiveMsg} finish={this.finish}/>:null}
19
+ {this.props.moduleName=='subscribe'?<Subscribe data={this.props.data} handleReceiveMsg={this.handleReceiveMsg} finish={this.finish}/>:null}
20
+ </div>
21
+ );
22
+ }
23
+
24
+ }
25
+
26
+ export default multiModule;
@@ -0,0 +1,20 @@
1
+ .multiModule{
2
+ height: 100%;
3
+ overflow-y: overlay;
4
+ text-align: left;
5
+ // border: 1px solid rebeccapurple;
6
+ // .ant-modal{
7
+ // top: 50%;
8
+ // transform: translateY(-50%);
9
+ // margin: auto;
10
+ // }
11
+ .ant-modal-wrap{
12
+ position: absolute;
13
+ }
14
+ }
15
+
16
+ .multiModule .endModal{
17
+ font-size: 16px;
18
+ padding: 30px 30px 0px 30px;
19
+ color: #333333;
20
+ }
@@ -1,221 +1,223 @@
1
- import React, { Component } from 'react';
2
- import { message } from 'antd';
3
- import './signMy.less'
4
- import { Button } from '../../../node_modules/antd/lib/index';
5
- class Sign extends Component {
6
- signCanvas = React.createRef();
7
- state = {
8
- canvasCtx: null,
9
- heightOne: '0px',
10
- widthOne: '0px',
11
- isModalVisibleEnd: false,
12
- isModalVisibleSubmit: false,
13
- isSignOk: false
14
- };
15
-
16
- componentDidMount() {
17
- setTimeout(() => {
18
-
19
- const canvas = this.refs.canvasF;
20
- canvas.width = document.getElementById('multiModule').offsetWidth
21
- canvas.height = document.getElementById('multiModule').offsetHeight
22
- this.state.canvasCtx = canvas.getContext('2d');
23
- this.state.stageInfo = canvas.getBoundingClientRect();
24
- this.state.canvasCtx.lineWidth = 7;
25
- this.state.canvasCtx.lineCap = "round";
26
- this.setState({
27
- isSignOk: false
28
- })
29
-
30
- canvas.addEventListener('touchstart', this.touchStart, { passive: false });
31
- canvas.addEventListener('touchmove', this.touchMove, { passive: false });
32
- canvas.addEventListener('touchend', this.touchEnd, { passive: false });
33
- }, 10);
34
-
35
-
36
- }
37
- componentWillUnmount () {
38
- const canvas = this.refs.canvasF;
39
- canvas.removeEventListener('touchstart', this.touchStart);
40
- canvas.removeEventListener('touchmove', this.touchMove);
41
- canvas.removeEventListener('touchend', this.touchEnd);
42
- }
43
-
44
- // 清空画布
45
- clearSign = async () => {
46
- this.setState({
47
- isSignOk: false
48
- })
49
- const canvas = this.refs.canvasF;
50
- // 清除画布
51
- this.state.canvasCtx.clearRect(
52
- 0,
53
- 0,
54
- canvas.width,
55
- canvas.height,
56
- );
57
- };
58
- touchStart=(ev)=> {
59
- this.setState({
60
- isSignOk: true
61
- })
62
- ev = ev || event
63
- ev.preventDefault()
64
- if (ev.touches.length == 1) {
65
- let obj = {
66
- x: ev.targetTouches[0].clientX,
67
- y: ev.targetTouches[0].clientY,
68
- }
69
- this.state.startX = obj.x
70
- this.state.startY = obj.y
71
- this.state.canvasCtx.beginPath()
72
- const canvas = this.refs.canvasF;
73
- this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
74
- this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
75
- this.state.canvasCtx.stroke()
76
- this.state.canvasCtx.closePath()
77
- // this.points.push(obj)
78
-
79
- }
80
- }
81
- touchMove=(ev)=>{
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.moveY = obj.y
90
- this.state.moveX = obj.x
91
- this.state.canvasCtx.beginPath()
92
- // strokeStyle = 'blue';
93
- const canvas = this.refs.canvasF;
94
- this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
95
- this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
96
- this.state.canvasCtx.stroke()
97
- this.state.canvasCtx.closePath()
98
- this.state.startY = obj.y
99
- this.state.startX = obj.x
100
- // this.points.push(obj)
101
- }
102
- }
103
- touchEnd=(ev)=> {
104
- ev = ev || event
105
- ev.preventDefault()
106
-
107
- if (ev.touches.length == 1) {
108
- let obj = {
109
- x: ev.targetTouches[0].clientX ,
110
- y: ev.targetTouches[0].clientY
111
- }
112
- this.state.canvasCtx.beginPath()
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.points.push(obj)
119
- }
120
- }
121
- // pc
122
- mouseDown=(ev) =>{
123
- this.setState({
124
- isSignOk: true
125
- })
126
- ev.preventDefault();
127
- const obj = {
128
- x: ev.pageX,
129
- y: ev.pageY,
130
- };
131
- const canvas = this.refs.canvasF;
132
- this.state.startX = obj.x;
133
- this.state.startY = obj.y;
134
- this.state.canvasCtx.beginPath();
135
- this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
136
- this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
137
- this.state.canvasCtx.stroke();
138
- this.state.canvasCtx.closePath();
139
- this.state.isDown = true;
140
-
141
- }
142
- mouseMove=(ev)=> {
143
- ev.preventDefault();
144
- if (this.state.isDown) {
145
- const obj = {
146
- x: ev.pageX,
147
- y: ev.pageY,
148
- };
149
- const canvas = this.refs.canvasF;
150
- 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) {
151
- this.state.isDown = false;
152
- }
153
- this.state.moveY = obj.y;
154
- this.state.moveX = obj.x;
155
- this.state.canvasCtx.beginPath();
156
-
157
- this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
158
- this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
159
- this.state.canvasCtx.stroke();
160
- this.state.canvasCtx.closePath();
161
- this.state.startY = obj.y;
162
- this.state.startX = obj.x;
163
- }
164
- }
165
- mouseUp=(ev)=> {
166
- ev.preventDefault();
167
- const obj = {
168
- x: ev.pageX,
169
- y: ev.pageY,
170
- };
171
- const canvas = this.refs.canvasF;
172
- this.state.canvasCtx.beginPath();
173
- this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
174
- this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
175
- this.state.canvasCtx.stroke();
176
- this.state.canvasCtx.closePath();
177
- this.state.isDown = false;
178
-
179
- }
180
- handleOkSign = async () => {
181
- if(this.state.isSignOk) {
182
- console.log(this.refs.canvasF.toDataURL())
183
-
184
- this.props.handleOkSign(this.refs.canvasF.toDataURL())
185
- }
186
- }
187
-
188
- render() {
189
- return (
190
- <div className="sign" id="multiModule">
191
- <canvas
192
- id="canvasF"
193
- className='canvasF'
194
- ref="canvasF"
195
- onMouseDown={this.mouseDown}
196
- onMouseMove={this.mouseMove}
197
- onMouseUp={this.mouseUp}
198
- ></canvas>
199
- <div className='signButton'>
200
- {
201
- !this.state.isSignOk && <Button className="modelButtonCancelNo">清除修改</Button>
202
- }
203
- {
204
- this.state.isSignOk && <Button className="modelButtonCancel" onClick={this.clearSign}>清除修改</Button>
205
- }
206
- {
207
- this.state.isSignOk && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSign}>确认提交</Button>
208
- }
209
- {
210
- !this.state.isSignOk && <Button className="modelButtonCancelNo" type="primary" danger >确认提交</Button>
211
- }
212
- </div>
213
- </div>
214
- );
215
- }
216
-
217
- }
218
- Sign.defaultProps = {
219
- }
220
-
221
- export default Sign;
1
+ import React, { Component } from 'react';
2
+ import { message } from 'antd';
3
+ import './signMy.less'
4
+ import { Button } from '../../../node_modules/antd/lib/index';
5
+ class Sign extends Component {
6
+ signCanvas = React.createRef();
7
+ state = {
8
+ canvasCtx: null,
9
+ heightOne: '0px',
10
+ widthOne: '0px',
11
+ isModalVisibleEnd: false,
12
+ isModalVisibleSubmit: false,
13
+ isSignOk: false
14
+ };
15
+
16
+ componentDidMount() {
17
+ setTimeout(() => {
18
+
19
+ const canvas = this.refs.canvasF;
20
+ canvas.width = document.getElementById('multiModule').offsetWidth
21
+ canvas.height = document.getElementById('multiModule').offsetHeight
22
+ this.state.canvasCtx = canvas.getContext('2d');
23
+ this.state.stageInfo = canvas.getBoundingClientRect();
24
+ this.state.canvasCtx.lineWidth = 7;
25
+ this.state.canvasCtx.lineCap = "round";
26
+ this.setState({
27
+ isSignOk: false
28
+ })
29
+
30
+ canvas.addEventListener('touchstart', this.touchStart, { passive: false });
31
+ canvas.addEventListener('touchmove', this.touchMove, { passive: false });
32
+ canvas.addEventListener('touchend', this.touchEnd, { passive: false });
33
+ }, 10);
34
+
35
+
36
+ }
37
+ componentWillUnmount () {
38
+ const canvas = this.refs.canvasF;
39
+ canvas.removeEventListener('touchstart', this.touchStart);
40
+ canvas.removeEventListener('touchmove', this.touchMove);
41
+ canvas.removeEventListener('touchend', this.touchEnd);
42
+ }
43
+
44
+ // 清空画布
45
+ clearSign = async () => {
46
+ this.setState({
47
+ isSignOk: false
48
+ })
49
+ const canvas = this.refs.canvasF;
50
+ // 清除画布
51
+ this.state.canvasCtx.clearRect(
52
+ 0,
53
+ 0,
54
+ canvas.width,
55
+ canvas.height,
56
+ );
57
+ };
58
+ touchStart=(ev)=> {
59
+ this.setState({
60
+ isSignOk: true
61
+ })
62
+ ev = ev || event
63
+ ev.preventDefault()
64
+ if (ev.touches.length == 1) {
65
+ let obj = {
66
+ x: ev.targetTouches[0].clientX,
67
+ y: ev.targetTouches[0].clientY,
68
+ }
69
+ this.state.startX = obj.x
70
+ this.state.startY = obj.y
71
+ this.state.canvasCtx.beginPath()
72
+ const canvas = this.refs.canvasF;
73
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
74
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
75
+ this.state.canvasCtx.stroke()
76
+ this.state.canvasCtx.closePath()
77
+ // this.points.push(obj)
78
+
79
+ }
80
+ }
81
+ touchMove=(ev)=>{
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.moveY = obj.y
90
+ this.state.moveX = obj.x
91
+ this.state.canvasCtx.beginPath()
92
+ // strokeStyle = 'blue';
93
+ const canvas = this.refs.canvasF;
94
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
95
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
96
+ this.state.canvasCtx.stroke()
97
+ this.state.canvasCtx.closePath()
98
+ this.state.startY = obj.y
99
+ this.state.startX = obj.x
100
+ // this.points.push(obj)
101
+ }
102
+ }
103
+ touchEnd=(ev)=> {
104
+ ev = ev || event
105
+ ev.preventDefault()
106
+
107
+ if (ev.touches.length == 1) {
108
+ let obj = {
109
+ x: ev.targetTouches[0].clientX ,
110
+ y: ev.targetTouches[0].clientY
111
+ }
112
+ this.state.canvasCtx.beginPath()
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.points.push(obj)
119
+ }
120
+ }
121
+ // pc
122
+ mouseDown=(ev) =>{
123
+ this.setState({
124
+ isSignOk: true
125
+ })
126
+ ev.preventDefault();
127
+ const obj = {
128
+ x: ev.pageX,
129
+ y: ev.pageY,
130
+ };
131
+ const canvas = this.refs.canvasF;
132
+ this.state.startX = obj.x;
133
+ this.state.startY = obj.y;
134
+ this.state.canvasCtx.beginPath();
135
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
136
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
137
+ this.state.canvasCtx.stroke();
138
+ this.state.canvasCtx.closePath();
139
+ this.state.isDown = true;
140
+
141
+ }
142
+ mouseMove=(ev)=> {
143
+ ev.preventDefault();
144
+ if (this.state.isDown) {
145
+ const obj = {
146
+ x: ev.pageX,
147
+ y: ev.pageY,
148
+ };
149
+ const canvas = this.refs.canvasF;
150
+ 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) {
151
+ this.state.isDown = false;
152
+ }
153
+ this.state.moveY = obj.y;
154
+ this.state.moveX = obj.x;
155
+ this.state.canvasCtx.beginPath();
156
+
157
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
158
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
159
+ this.state.canvasCtx.stroke();
160
+ this.state.canvasCtx.closePath();
161
+ this.state.startY = obj.y;
162
+ this.state.startX = obj.x;
163
+ }
164
+ }
165
+ mouseUp=(ev)=> {
166
+ if (!this.state.isDown) return;
167
+ ev.preventDefault();
168
+ const obj = {
169
+ x: ev.pageX,
170
+ y: ev.pageY,
171
+ };
172
+ const canvas = this.refs.canvasF;
173
+ this.state.canvasCtx.beginPath();
174
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
175
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
176
+ this.state.canvasCtx.stroke();
177
+ this.state.canvasCtx.closePath();
178
+ this.state.isDown = false;
179
+
180
+ }
181
+ handleOkSign = async () => {
182
+ if(this.state.isSignOk) {
183
+ console.log(this.refs.canvasF.toDataURL())
184
+
185
+ this.props.handleOkSign(this.refs.canvasF.toDataURL())
186
+ }
187
+ }
188
+
189
+ render() {
190
+ return (
191
+ <div className="sign" id="multiModule">
192
+ <canvas
193
+ id="canvasF"
194
+ className='canvasF'
195
+ ref="canvasF"
196
+ onMouseDown={this.mouseDown}
197
+ onMouseMove={this.mouseMove}
198
+ onMouseUp={this.mouseUp}
199
+ onMouseLeave={() => { this.state.isDown = false }}
200
+ ></canvas>
201
+ <div className='signButton'>
202
+ {
203
+ !this.state.isSignOk && <Button className="modelButtonCancelNo">清除修改</Button>
204
+ }
205
+ {
206
+ this.state.isSignOk && <Button className="modelButtonCancel" onClick={this.clearSign}>清除修改</Button>
207
+ }
208
+ {
209
+ this.state.isSignOk && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSign}>确认提交</Button>
210
+ }
211
+ {
212
+ !this.state.isSignOk && <Button className="modelButtonCancelNo" type="primary" danger >确认提交</Button>
213
+ }
214
+ </div>
215
+ </div>
216
+ );
217
+ }
218
+
219
+ }
220
+ Sign.defaultProps = {
221
+ }
222
+
223
+ export default Sign;