ydb-components-material 0.1.108 → 0.1.109

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 (128) hide show
  1. package/build/docs/404.html +3 -3
  2. package/build/docs/_demos/:uuid +3 -3
  3. package/build/docs/colorful-button.html +3 -3
  4. package/build/docs/colorful-input.html +3 -3
  5. package/build/docs/index.html +3 -3
  6. package/build/docs/static/add.fb69e154.svg +1 -0
  7. package/build/docs/static/close_black.d2efc5af.svg +1 -0
  8. package/build/docs/{umi.0bdb74c5.css → umi.2e42e1a7.css} +1 -1
  9. package/build/docs/umi.9e1659ce.js +1 -0
  10. package/build/docs/~demos/:uuid.html +3 -3
  11. package/build/docs/~demos/colorful-button-demo.html +3 -3
  12. package/build/docs/~demos/colorful-input-demo.html +3 -3
  13. package/build/lowcode/3.js +2 -2
  14. package/build/lowcode/4.js +1 -1
  15. package/build/lowcode/5.js +1 -1
  16. package/build/lowcode/assets-daily.json +11 -11
  17. package/build/lowcode/assets-dev.json +2 -2
  18. package/build/lowcode/assets-prod.json +11 -11
  19. package/build/lowcode/index.js +1 -1
  20. package/build/lowcode/meta.js +1 -1
  21. package/build/lowcode/preview.js +9 -9
  22. package/build/lowcode/render/default/1.js +2 -2
  23. package/build/lowcode/render/default/2.js +1 -1
  24. package/build/lowcode/render/default/3.js +1 -1
  25. package/build/lowcode/render/default/view.css +1 -1
  26. package/build/lowcode/render/default/view.js +6 -6
  27. package/build/lowcode/view.css +1 -1
  28. package/build/lowcode/view.js +6 -6
  29. package/dist/1.js +2 -2
  30. package/dist/2.js +1 -1
  31. package/dist/3.js +1 -1
  32. package/dist/BizComps.css +1 -1
  33. package/dist/BizComps.js +21 -21
  34. package/dist/BizComps.js.map +1 -1
  35. package/es/components/file-item/index.js +2 -15
  36. package/es/components/file-list/icon/add.svg +1 -0
  37. package/es/components/file-list/icon/close_black.svg +1 -0
  38. package/es/components/file-list/index.d.ts +2 -0
  39. package/es/components/file-list/index.js +7 -1
  40. package/es/components/file-list/item.d.ts +2 -0
  41. package/es/components/file-list/item.js +30 -7
  42. package/es/components/file-list/seal.js +4 -2
  43. package/es/components/file-list/sign.js +4 -2
  44. package/es/components/file-list/signerInfo.d.ts +4 -0
  45. package/es/components/file-list/signerInfo.js +257 -0
  46. package/es/components/file-list/signerInfo.scss +152 -0
  47. package/es/components/guide/compoents/materials/materialsList.js +2 -8
  48. package/es/components/sign/index.d.ts +18 -0
  49. package/es/components/sign/index.js +1 -0
  50. package/es/components/sign/index.scss +0 -0
  51. package/es/components/sign-file/file.js +225 -0
  52. package/es/components/sign-file/icon/checked.svg +1 -0
  53. package/es/components/sign-file/icon/close.svg +1 -0
  54. package/es/components/sign-file/icon/del.svg +1 -0
  55. package/es/components/sign-file/icon/download.svg +1 -0
  56. package/es/components/sign-file/icon/download_pc.svg +1 -0
  57. package/es/components/sign-file/icon/file.svg +1 -0
  58. package/es/components/sign-file/icon/icon_errorMsg.svg +1 -0
  59. package/es/components/sign-file/icon/icon_warning.svg +1 -0
  60. package/es/components/sign-file/icon/preview.svg +1 -0
  61. package/es/components/sign-file/icon/preview_pc.svg +1 -0
  62. package/es/components/sign-file/icon/upload.svg +1 -0
  63. package/es/components/sign-file/icon/view.svg +1 -0
  64. package/es/components/sign-file/index.d.ts +20 -0
  65. package/es/components/sign-file/index.js +430 -0
  66. package/es/components/sign-file/index.scss +420 -0
  67. package/es/components/sign-file/seal.d.ts +3 -0
  68. package/es/components/sign-file/seal.js +220 -0
  69. package/es/components/sign-file/sealUtil.js +252 -0
  70. package/es/components/sign-file/sign.d.ts +3 -0
  71. package/es/components/sign-file/sign.js +136 -0
  72. package/es/components/sign-file/signUtil.js +367 -0
  73. package/es/index.d.ts +2 -2
  74. package/es/index.js +1 -1
  75. package/es/style.js +1 -0
  76. package/lib/components/file-item/index.js +2 -15
  77. package/lib/components/file-list/icon/add.svg +1 -0
  78. package/lib/components/file-list/icon/close_black.svg +1 -0
  79. package/lib/components/file-list/index.d.ts +2 -0
  80. package/lib/components/file-list/index.js +7 -1
  81. package/lib/components/file-list/item.d.ts +2 -0
  82. package/lib/components/file-list/item.js +30 -7
  83. package/lib/components/file-list/seal.js +4 -2
  84. package/lib/components/file-list/sign.js +4 -2
  85. package/lib/components/file-list/signerInfo.d.ts +4 -0
  86. package/lib/components/file-list/signerInfo.js +263 -0
  87. package/lib/components/file-list/signerInfo.scss +152 -0
  88. package/lib/components/guide/compoents/materials/materialsList.js +2 -8
  89. package/lib/components/sign/index.d.ts +18 -0
  90. package/lib/components/sign/index.js +3 -0
  91. package/lib/components/sign/index.scss +0 -0
  92. package/lib/components/sign-file/file.js +234 -0
  93. package/lib/components/sign-file/icon/checked.svg +1 -0
  94. package/lib/components/sign-file/icon/close.svg +1 -0
  95. package/lib/components/sign-file/icon/del.svg +1 -0
  96. package/lib/components/sign-file/icon/download.svg +1 -0
  97. package/lib/components/sign-file/icon/download_pc.svg +1 -0
  98. package/lib/components/sign-file/icon/file.svg +1 -0
  99. package/lib/components/sign-file/icon/icon_errorMsg.svg +1 -0
  100. package/lib/components/sign-file/icon/icon_warning.svg +1 -0
  101. package/lib/components/sign-file/icon/preview.svg +1 -0
  102. package/lib/components/sign-file/icon/preview_pc.svg +1 -0
  103. package/lib/components/sign-file/icon/upload.svg +1 -0
  104. package/lib/components/sign-file/icon/view.svg +1 -0
  105. package/lib/components/sign-file/index.d.ts +20 -0
  106. package/lib/components/sign-file/index.js +437 -0
  107. package/lib/components/sign-file/index.scss +420 -0
  108. package/lib/components/sign-file/seal.d.ts +3 -0
  109. package/lib/components/sign-file/seal.js +226 -0
  110. package/lib/components/sign-file/sealUtil.js +254 -0
  111. package/lib/components/sign-file/sign.d.ts +3 -0
  112. package/lib/components/sign-file/sign.js +142 -0
  113. package/lib/components/sign-file/signUtil.js +369 -0
  114. package/lib/index.d.ts +2 -2
  115. package/lib/index.js +3 -3
  116. package/lib/style.js +1 -0
  117. package/lowcode/file-list/meta.ts +30 -4
  118. package/lowcode/sign-file/meta.ts +209 -0
  119. package/lowcode_es/file-list/meta.js +29 -4
  120. package/lowcode_es/meta.js +3 -2
  121. package/lowcode_es/sign-file/meta.d.ts +22 -0
  122. package/lowcode_es/sign-file/meta.js +192 -0
  123. package/lowcode_lib/file-list/meta.js +29 -4
  124. package/lowcode_lib/meta.js +7 -6
  125. package/lowcode_lib/sign-file/meta.d.ts +22 -0
  126. package/lowcode_lib/sign-file/meta.js +197 -0
  127. package/package.json +3 -3
  128. package/build/docs/umi.f685e4ec.js +0 -1
@@ -0,0 +1,420 @@
1
+ .sign_file_main {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ justify-content: space-between;
6
+ .sign_btn {
7
+ height: 40px;
8
+ border-radius: 50px;
9
+ opacity: 1;
10
+ width: 90%;
11
+ margin: 0 auto;
12
+ color: #fff;
13
+ font-size: 16px;
14
+ font-weight: 500;
15
+ text-align: center;
16
+ line-height: 40px;
17
+ background: linear-gradient(90deg, #73aeff 0%, #1678ff 100%);
18
+ }
19
+ .sign_file_item {
20
+ border-radius: 8px;
21
+ opacity: 1;
22
+ background: #F7F7F7;
23
+ padding: 12px;
24
+ width: 100%;
25
+
26
+ .file {
27
+ display: flex;
28
+ justify-content: space-between;
29
+ align-items: center;
30
+
31
+ .file_img {
32
+ width: 80px;
33
+ height: 80px;
34
+ border-radius: 4px;
35
+ position: relative;
36
+ border-radius: 8px;
37
+ position: relative;
38
+ display: flex;
39
+ justify-content: center;
40
+ align-items: center;
41
+ background: #fff;
42
+ font-size: 12px;
43
+ color: #666666;
44
+ flex-direction: column;
45
+
46
+ .filed {
47
+ display: flex;
48
+ justify-content: center;
49
+ align-items: center;
50
+ flex-direction: column;
51
+ }
52
+
53
+ .small_img {
54
+ width: 100%;
55
+
56
+ }
57
+
58
+ .add {
59
+ display: flex;
60
+ flex-direction: column;
61
+ justify-content: center;
62
+ align-items: center;
63
+ border: 1px dashed #BFDAFF;
64
+ border-radius: 4px;
65
+ width: 100%;
66
+ height: 100%;
67
+ .add_icon {
68
+ width: 14px;
69
+ margin-left: -5px;
70
+ }
71
+ color: #1678FF;
72
+ }
73
+
74
+ .del {
75
+ position: absolute;
76
+ width: 16px;
77
+ height: 16px;
78
+ top: -6px;
79
+ right: -6px;
80
+ z-index: 3;
81
+ }
82
+
83
+ .error_msg {
84
+ position: absolute;
85
+ top: 30px;
86
+ right: 22px;
87
+ }
88
+
89
+ .mask {
90
+ // display: none !important;
91
+ border-radius: 8px;
92
+ position: absolute;
93
+ top: 0;
94
+ left: 0;
95
+ width: 100%;
96
+ height: 100%;
97
+ // opacity: 0.5;
98
+ background: #2222227d;
99
+ display: flex;
100
+ justify-content: center;
101
+ align-items: center;
102
+ color: #fff;
103
+ z-index: 3;
104
+
105
+ .checked {
106
+ display: flex;
107
+ align-items: center;
108
+
109
+ img {
110
+ width: 14px;
111
+ height: 14px;
112
+ margin-right: 3px;
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ .blocks {
119
+ margin-right: auto;
120
+ margin-left: 20px;
121
+ height: 80px;
122
+ display: flex;
123
+ flex-direction: column;
124
+ justify-content: space-between;
125
+ flex: 1;
126
+
127
+ .status {
128
+ display: flex;
129
+ gap: 12px;
130
+
131
+ .status_item {
132
+ width: 44px;
133
+ height: 20px;
134
+ border-radius: 4px;
135
+ background: #EFDEBD;
136
+ color: #C38A38;
137
+ font-size: 12px;
138
+ text-align: center;
139
+ line-height: 20px;
140
+ }
141
+ }
142
+
143
+ .btns {
144
+ display: flex;
145
+ gap: 24px;
146
+ font-size: 14px;
147
+ color: #1678FF;
148
+
149
+ .btn {
150
+ display: flex;
151
+ gap: 4px;
152
+ }
153
+ }
154
+ }
155
+
156
+
157
+ .operation {
158
+ display: flex;
159
+ flex-direction: column;
160
+ justify-content: space-between;
161
+ padding: 4px 0;
162
+ height: 80px;
163
+ }
164
+ .operation_pc {
165
+ display: flex;
166
+ flex-direction: row-reverse;
167
+ height: 80px;
168
+ align-items: end;
169
+ }
170
+ .btn {
171
+ display: flex;
172
+ flex-direction: row;
173
+ justify-content: end;
174
+
175
+ .img_btn {
176
+ margin-left: 8px;
177
+ width: 68px;
178
+ height: 26px;
179
+ border-radius: 4px;
180
+ opacity: 1;
181
+ box-sizing: border-box;
182
+ border: 1px solid #1678FF;
183
+ color: #1678FF;
184
+ font-size: 13px;
185
+ line-height: 26px;
186
+ text-align: center;
187
+ cursor: pointer;
188
+ }
189
+
190
+ }
191
+ .operation_btn {
192
+ cursor: pointer;
193
+ margin-left: 8px;
194
+ width: 68px;
195
+ height: 26px;
196
+ border-radius: 4px;
197
+ opacity: 1;
198
+ box-sizing: border-box;
199
+ background: linear-gradient(90deg, #73AEFF 0%, #1678FF 100%);
200
+ color: #fff;
201
+ font-size: 13px;
202
+ line-height: 26px;
203
+ text-align: center;
204
+ }
205
+ }
206
+
207
+ .file_item_bottom {
208
+ margin-top: 12px;
209
+ border-top: 1px solid #EAEAEA;
210
+ display: flex;
211
+ display: flex;
212
+ justify-content: space-evenly;
213
+ align-items: center;
214
+ padding-top: 12px;
215
+
216
+ .line {
217
+ width: 1px;
218
+ height: 20px;
219
+ background-color: #EAEAEA;
220
+ }
221
+
222
+ .icon_text {
223
+ display: flex;
224
+ align-items: center;
225
+ font-size: 14px;
226
+ color: #1678FF;
227
+
228
+ img {
229
+ width: 16px;
230
+ height: 11px;
231
+ margin-right: 5px;
232
+
233
+ }
234
+ }
235
+ }
236
+
237
+ .img_view {
238
+ position: absolute;
239
+ top: 0;
240
+ left: 0;
241
+ width: 100%;
242
+ height: 100%;
243
+ background-color: rgba(0, 0, 0, 0.5);
244
+ display: flex;
245
+ justify-content: center;
246
+ align-items: center;
247
+
248
+ .close {
249
+ width: 17px;
250
+ height: 17px;
251
+ color: #fff;
252
+ position: absolute;
253
+ top: 40px;
254
+ right: 20px;
255
+ }
256
+
257
+ .view {
258
+ width: 100%;
259
+ height: auto;
260
+ }
261
+ }
262
+
263
+ .material_lib {
264
+ width: 100%;
265
+ height: 100%;
266
+ position: fixed;
267
+ top: 0;
268
+ left: 0;
269
+ z-index: 88;
270
+ background-color: rgba(0, 0, 0, 0.5);
271
+
272
+ .material_lib_content {
273
+ width: 100%;
274
+ position: absolute;
275
+ bottom: 0;
276
+ left: 0;
277
+ background-color: #F5F5F5;
278
+ border-radius: 16px 16px 0px 0px;
279
+
280
+ .material_lib_title {
281
+ border-radius: 16px 16px 0px 0px;
282
+ background-color: #fff;
283
+ font-size: 16px;
284
+ color: #333333;
285
+ line-height: 54px;
286
+ text-align: center;
287
+ }
288
+
289
+ .tips {
290
+ padding: 12px;
291
+ background: #FFF6E8;
292
+ font-size: 14px;
293
+ line-height: 24px;
294
+ color: #F29655;
295
+ display: flex;
296
+ align-items: flex-start;
297
+
298
+ img {
299
+ width: 14px;
300
+ height: 14px;
301
+ margin-right: 8px;
302
+ margin-top: 5px;
303
+ }
304
+ }
305
+
306
+ .list {
307
+ padding: 12px 12px 0 12px;
308
+ width: 100%;
309
+ background-color: #F5F5F5;
310
+ // margin-bottom: 14px;
311
+ max-height: 300px;
312
+ overflow: auto;
313
+
314
+ .item {
315
+ padding: 16px 12px;
316
+ border-radius: 8px;
317
+ background: #FFF;
318
+ display: flex;
319
+ align-items: center;
320
+ color: #333333;
321
+ font-size: 14px;
322
+ width: 100%;
323
+ margin-bottom: 12px;
324
+
325
+ .preview_icon {
326
+ margin-left: auto;
327
+ display: flex;
328
+ align-items: center;
329
+ color: #1678FF;
330
+
331
+ img {
332
+ width: 16px;
333
+ margin-right: 4px;
334
+ }
335
+ }
336
+ }
337
+ }
338
+
339
+ .more {
340
+ color: #1678FF;
341
+ text-align: center;
342
+ height: 30px;
343
+ line-height: 30px;
344
+ margin-bottom: 70px;
345
+ background-color: #F5F5F5;
346
+ }
347
+
348
+ .bottom_btn {
349
+ background-color: #fff;
350
+ height: 64px;
351
+ display: flex;
352
+ align-items: center;
353
+ justify-content: space-around;
354
+ position: fixed;
355
+ bottom: 0;
356
+ left: 0;
357
+ right: 0;
358
+
359
+ .btn {
360
+ width: 169px;
361
+ height: 40px;
362
+ border-radius: 50px;
363
+ font-size: 16px;
364
+ line-height: 40px;
365
+ text-align: center;
366
+ }
367
+
368
+ .cancel {
369
+ background-color: #fff;
370
+ border: 1px solid #E7E7E7;
371
+ color: #333;
372
+ }
373
+
374
+ .ok {
375
+ background: linear-gradient(90deg, #73AEFF 0%, #1678FF 100%);
376
+ color: #fff;
377
+ }
378
+ }
379
+ }
380
+ }
381
+
382
+ .preview {
383
+ width: 100%;
384
+ height: 100%;
385
+ position: fixed;
386
+ top: 0;
387
+ left: 0;
388
+ background: rgba(0, 0, 0, 0.5);
389
+ display: flex;
390
+ justify-content: center;
391
+ align-items: center;
392
+ z-index: 99;
393
+ .close {
394
+ position: absolute;
395
+ top: 20px;
396
+ right: 20px;
397
+ }
398
+ }
399
+
400
+ .sealPage {
401
+ position: fixed;
402
+ top: 0;
403
+ left: 0;
404
+ width: 100%;
405
+ height: 100%;
406
+ z-index: 99;
407
+ background: rgba(0, 0, 0, 0.5);
408
+ }
409
+ .sign_page {
410
+ position: fixed;
411
+ top: 0;
412
+ left: 0;
413
+ width: 100%;
414
+ height: 100%;
415
+ z-index: 99;
416
+ background: rgba(0, 0, 0, 0.5);
417
+ }
418
+
419
+ }
420
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare function SealPage(props: any): JSX.Element;
3
+ export default SealPage;
@@ -0,0 +1,220 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+ import React, { useEffect, useState, useRef } from 'react';
5
+ import { initSealPageMethod } from "./sealUtil";
6
+ import { signFileDownApi, getSignFileApi, fileUploadApi } from "../../api";
7
+ // import { uploadFilePromise, dataURLtoBlob } from './file.js'
8
+
9
+ function SealPage(props) {
10
+ var userInfo = props.userInfo,
11
+ file = props.file,
12
+ getSealRes = props.getSealRes,
13
+ handleClose = props.handleClose,
14
+ tokenTY = props.tokenTY,
15
+ baseUrl = props.baseUrl,
16
+ env = props.env,
17
+ isPC = props.isPC,
18
+ accessToken = props.accessToken;
19
+ var _useState = useState(''),
20
+ srcUrl = _useState[0],
21
+ setSrcUrl = _useState[1];
22
+ var _useState2 = useState(''),
23
+ orderId = _useState2[0],
24
+ setOrderId = _useState2[1];
25
+ var timerRef = useRef(null);
26
+ var elementRef = useRef(null);
27
+ var handleRes = /*#__PURE__*/function () {
28
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
29
+ var fileObj, res, pageUrl, orderIdVal;
30
+ return _regeneratorRuntime.wrap(function (_context) {
31
+ while (1) switch (_context.prev = _context.next) {
32
+ case 0:
33
+ console.log('file', file, userInfo);
34
+ fileObj = file; // 有旧的 URL 说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
35
+ if (file.oldUrl) {
36
+ fileObj.url = file.oldUrl;
37
+ }
38
+ // 传递配置参数给工具函数
39
+ _context.next = 1;
40
+ return initSealPageMethod(fileObj, userInfo, {
41
+ tokenTY: tokenTY,
42
+ baseUrl: baseUrl,
43
+ env: env,
44
+ isPC: isPC,
45
+ accessToken: accessToken
46
+ });
47
+ case 1:
48
+ res = _context.sent;
49
+ if (res) {
50
+ _context.next = 2;
51
+ break;
52
+ }
53
+ handleClose();
54
+ return _context.abrupt("return");
55
+ case 2:
56
+ pageUrl = res.pageUrl, orderIdVal = res.orderId;
57
+ console.log('pageUrl', pageUrl);
58
+ setSrcUrl(pageUrl);
59
+ setOrderId(orderIdVal);
60
+ // console.log(res)
61
+ case 3:
62
+ case "end":
63
+ return _context.stop();
64
+ }
65
+ }, _callee);
66
+ }));
67
+ return function handleRes() {
68
+ return _ref.apply(this, arguments);
69
+ };
70
+ }();
71
+
72
+ // 将返回的文件重新上传
73
+ var uploadNewFile = /*#__PURE__*/function () {
74
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fileData) {
75
+ var params, uploadRes, finalFile;
76
+ return _regeneratorRuntime.wrap(function (_context2) {
77
+ while (1) switch (_context2.prev = _context2.next) {
78
+ case 0:
79
+ console.log('fileData', fileData);
80
+ params = {
81
+ materiaBase: 'data:application/pdf;base64,' + fileData,
82
+ open: true
83
+ };
84
+ console.log('params', params);
85
+ _context2.next = 1;
86
+ return fileUploadApi(params, {
87
+ tokenTY: tokenTY,
88
+ baseUrl: baseUrl,
89
+ env: env,
90
+ isPC: isPC,
91
+ accessToken: accessToken
92
+ });
93
+ case 1:
94
+ uploadRes = _context2.sent;
95
+ console.log('重新上传的文件', uploadRes);
96
+ if (uploadRes.code === 200) {
97
+ handleClose();
98
+ finalFile = _extends({
99
+ name: file.name,
100
+ url: uploadRes.data.fileUrl,
101
+ oldUrl: file.url,
102
+ isSealed: true
103
+ }, uploadRes.data);
104
+ getSealRes(finalFile);
105
+ }
106
+ case 2:
107
+ case "end":
108
+ return _context2.stop();
109
+ }
110
+ }, _callee2);
111
+ }));
112
+ return function uploadNewFile(_x) {
113
+ return _ref2.apply(this, arguments);
114
+ };
115
+ }();
116
+
117
+ // 下载文件
118
+ var signFileDown = function signFileDown(filePath) {
119
+ signFileDownApi({
120
+ fileUrl: filePath
121
+ }, {
122
+ tokenTY: tokenTY,
123
+ baseUrl: baseUrl,
124
+ env: env,
125
+ isPC: isPC,
126
+ accessToken: accessToken
127
+ }).then(function (res) {
128
+ if (res.code === 200) {
129
+ uploadNewFile(res.data);
130
+ }
131
+ });
132
+ };
133
+
134
+ // 电子签章 - 移动端签批 获取移动端签章结果 (文件地址)
135
+ var getSignFileFun = function getSignFileFun() {
136
+ // uni.showLoading({ title: '加载中' })
137
+
138
+ var params = {
139
+ orderId: orderId
140
+ };
141
+ getSignFileApi(params, {
142
+ tokenTY: tokenTY,
143
+ baseUrl: baseUrl,
144
+ env: env,
145
+ isPC: isPC,
146
+ accessToken: accessToken
147
+ }).then(function (res) {
148
+ if (!res) {
149
+ return;
150
+ }
151
+ console.log(res, '签章之后的数据');
152
+ var _res$data = res.data,
153
+ signStatus = _res$data.signStatus,
154
+ signFiles = _res$data.signFiles;
155
+ if (signStatus === 6) {
156
+ // 签署成功
157
+ handleClearInterval();
158
+ if (signFiles && signFiles.length) {
159
+ // 下载该文件
160
+ signFileDown(signFiles[0].filePath);
161
+ }
162
+ }
163
+ // uni.hideLoading()
164
+ })["catch"](function (err) {
165
+ console.log(err);
166
+ });
167
+ };
168
+ var handleClearInterval = function handleClearInterval() {
169
+ clearInterval(timerRef.current);
170
+ timerRef.current = null;
171
+ };
172
+ useEffect(function () {
173
+ if (orderId) {
174
+ handleClearInterval();
175
+ timerRef.current = setInterval(function () {
176
+ getSignFileFun();
177
+ }, 3000);
178
+ }
179
+ return function () {
180
+ handleClearInterval();
181
+ };
182
+ }, [orderId]);
183
+ var handleTouchMove = function handleTouchMove(e) {
184
+ e.preventDefault(); // 只有在 passive: false 时才能调用
185
+ console.log('Touch move');
186
+ };
187
+ var handleTouchStart = function handleTouchStart(e) {
188
+ console.log('Touch start - passive', e.touches[0].clientX);
189
+ };
190
+ useEffect(function () {
191
+ var element = elementRef.current;
192
+ if (!element) return;
193
+
194
+ // 添加被动事件监听器
195
+ element.addEventListener('touchstart', handleTouchStart, {
196
+ passive: true
197
+ });
198
+ element.addEventListener('touchmove', handleTouchMove, {
199
+ passive: false // 如果需要 preventDefault
200
+ });
201
+ return function () {
202
+ element.removeEventListener('touchstart', handleTouchStart);
203
+ element.removeEventListener('touchmove', handleTouchMove);
204
+ };
205
+ }, []);
206
+ useEffect(function () {
207
+ handleRes();
208
+ }, [userInfo, file]);
209
+ return /*#__PURE__*/React.createElement("div", {
210
+ className: "sealPage",
211
+ ref: elementRef
212
+ }, /*#__PURE__*/React.createElement("iframe", {
213
+ src: srcUrl,
214
+ id: "iframe",
215
+ frameborder: "0",
216
+ height: "100%",
217
+ width: "100%"
218
+ }));
219
+ }
220
+ export default SealPage;