ydb-components-material 0.1.108 → 0.1.110

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.af2a87c1.js +1 -0
  9. package/build/docs/{umi.0bdb74c5.css → umi.e486411a.css} +1 -1
  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 +32 -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 +274 -0
  46. package/es/components/file-list/signerInfo.scss +179 -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 +444 -0
  66. package/es/components/sign-file/index.scss +422 -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 +32 -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 +280 -0
  87. package/lib/components/file-list/signerInfo.scss +179 -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 +451 -0
  107. package/lib/components/sign-file/index.scss +422 -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,422 @@
1
+ .sign_file_main {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ padding: 20px 0;
6
+ flex: 1;
7
+ justify-content: space-between;
8
+ .sign_btn {
9
+ height: 40px;
10
+ border-radius: 50px;
11
+ opacity: 1;
12
+ width: 90%;
13
+ margin: 0 auto;
14
+ color: #fff;
15
+ font-size: 16px;
16
+ font-weight: 500;
17
+ text-align: center;
18
+ line-height: 40px;
19
+ background: linear-gradient(90deg, #73aeff 0%, #1678ff 100%);
20
+ }
21
+ .sign_file_item {
22
+ border-radius: 8px;
23
+ opacity: 1;
24
+ background: #ffffff;
25
+ padding: 12px;
26
+ width: 100%;
27
+
28
+ .file {
29
+ display: flex;
30
+ justify-content: space-between;
31
+ align-items: center;
32
+
33
+ .file_img {
34
+ width: 80px;
35
+ height: 80px;
36
+ border-radius: 4px;
37
+ position: relative;
38
+ border-radius: 8px;
39
+ position: relative;
40
+ display: flex;
41
+ justify-content: center;
42
+ align-items: center;
43
+ background: #fff;
44
+ font-size: 12px;
45
+ color: #666666;
46
+ flex-direction: column;
47
+
48
+ .filed {
49
+ display: flex;
50
+ justify-content: center;
51
+ align-items: center;
52
+ flex-direction: column;
53
+ }
54
+
55
+ .small_img {
56
+ height: 80px;
57
+
58
+ }
59
+
60
+ .add {
61
+ display: flex;
62
+ flex-direction: column;
63
+ justify-content: center;
64
+ align-items: center;
65
+ border: 1px dashed #BFDAFF;
66
+ border-radius: 4px;
67
+ width: 100%;
68
+ height: 100%;
69
+ .add_icon {
70
+ width: 14px;
71
+ margin-left: -5px;
72
+ }
73
+ color: #1678FF;
74
+ }
75
+
76
+ .del {
77
+ position: absolute;
78
+ width: 16px;
79
+ height: 16px;
80
+ top: -6px;
81
+ right: -6px;
82
+ z-index: 3;
83
+ }
84
+
85
+ .error_msg {
86
+ position: absolute;
87
+ top: 30px;
88
+ right: 22px;
89
+ }
90
+
91
+ .mask {
92
+ // display: none !important;
93
+ border-radius: 8px;
94
+ position: absolute;
95
+ top: 0;
96
+ left: 0;
97
+ width: 100%;
98
+ height: 100%;
99
+ // opacity: 0.5;
100
+ background: #2222227d;
101
+ display: flex;
102
+ justify-content: center;
103
+ align-items: center;
104
+ color: #fff;
105
+ z-index: 3;
106
+
107
+ .checked {
108
+ display: flex;
109
+ align-items: center;
110
+
111
+ img {
112
+ width: 14px;
113
+ height: 14px;
114
+ margin-right: 3px;
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ .blocks {
121
+ margin-right: auto;
122
+ margin-left: 20px;
123
+ height: 80px;
124
+ display: flex;
125
+ flex-direction: column;
126
+ justify-content: space-between;
127
+ flex: 1;
128
+
129
+ .status {
130
+ display: flex;
131
+ gap: 12px;
132
+
133
+ .status_item {
134
+ width: 44px;
135
+ height: 20px;
136
+ border-radius: 4px;
137
+ background: #EFDEBD;
138
+ color: #C38A38;
139
+ font-size: 12px;
140
+ text-align: center;
141
+ line-height: 20px;
142
+ }
143
+ }
144
+
145
+ .btns {
146
+ display: flex;
147
+ gap: 24px;
148
+ font-size: 14px;
149
+ color: #1678FF;
150
+
151
+ .btn {
152
+ display: flex;
153
+ gap: 4px;
154
+ }
155
+ }
156
+ }
157
+
158
+
159
+ .operation {
160
+ display: flex;
161
+ flex-direction: column;
162
+ justify-content: space-between;
163
+ padding: 4px 0;
164
+ height: 80px;
165
+ }
166
+ .operation_pc {
167
+ display: flex;
168
+ flex-direction: row-reverse;
169
+ height: 80px;
170
+ align-items: end;
171
+ }
172
+ .btn {
173
+ display: flex;
174
+ flex-direction: row;
175
+ justify-content: end;
176
+
177
+ .img_btn {
178
+ margin-left: 8px;
179
+ width: 68px;
180
+ height: 26px;
181
+ border-radius: 4px;
182
+ opacity: 1;
183
+ box-sizing: border-box;
184
+ border: 1px solid #1678FF;
185
+ color: #1678FF;
186
+ font-size: 13px;
187
+ line-height: 26px;
188
+ text-align: center;
189
+ cursor: pointer;
190
+ }
191
+
192
+ }
193
+ .operation_btn {
194
+ cursor: pointer;
195
+ margin-left: 8px;
196
+ width: 68px;
197
+ height: 26px;
198
+ border-radius: 4px;
199
+ opacity: 1;
200
+ box-sizing: border-box;
201
+ background: linear-gradient(90deg, #73AEFF 0%, #1678FF 100%);
202
+ color: #fff;
203
+ font-size: 13px;
204
+ line-height: 26px;
205
+ text-align: center;
206
+ }
207
+ }
208
+
209
+ .file_item_bottom {
210
+ margin-top: 12px;
211
+ border-top: 1px solid #EAEAEA;
212
+ display: flex;
213
+ display: flex;
214
+ justify-content: space-evenly;
215
+ align-items: center;
216
+ padding-top: 12px;
217
+
218
+ .line {
219
+ width: 1px;
220
+ height: 20px;
221
+ background-color: #EAEAEA;
222
+ }
223
+
224
+ .icon_text {
225
+ display: flex;
226
+ align-items: center;
227
+ font-size: 14px;
228
+ color: #1678FF;
229
+
230
+ img {
231
+ width: 16px;
232
+ height: 11px;
233
+ margin-right: 5px;
234
+
235
+ }
236
+ }
237
+ }
238
+
239
+ .img_view {
240
+ position: absolute;
241
+ top: 0;
242
+ left: 0;
243
+ width: 100%;
244
+ height: 100%;
245
+ background-color: rgba(0, 0, 0, 0.5);
246
+ display: flex;
247
+ justify-content: center;
248
+ align-items: center;
249
+
250
+ .close {
251
+ width: 17px;
252
+ height: 17px;
253
+ color: #fff;
254
+ position: absolute;
255
+ top: 40px;
256
+ right: 20px;
257
+ }
258
+
259
+ .view {
260
+ width: 100%;
261
+ height: auto;
262
+ }
263
+ }
264
+
265
+ .material_lib {
266
+ width: 100%;
267
+ height: 100%;
268
+ position: fixed;
269
+ top: 0;
270
+ left: 0;
271
+ z-index: 88;
272
+ background-color: rgba(0, 0, 0, 0.5);
273
+
274
+ .material_lib_content {
275
+ width: 100%;
276
+ position: absolute;
277
+ bottom: 0;
278
+ left: 0;
279
+ background-color: #F5F5F5;
280
+ border-radius: 16px 16px 0px 0px;
281
+
282
+ .material_lib_title {
283
+ border-radius: 16px 16px 0px 0px;
284
+ background-color: #fff;
285
+ font-size: 16px;
286
+ color: #333333;
287
+ line-height: 54px;
288
+ text-align: center;
289
+ }
290
+
291
+ .tips {
292
+ padding: 12px;
293
+ background: #FFF6E8;
294
+ font-size: 14px;
295
+ line-height: 24px;
296
+ color: #F29655;
297
+ display: flex;
298
+ align-items: flex-start;
299
+
300
+ img {
301
+ width: 14px;
302
+ height: 14px;
303
+ margin-right: 8px;
304
+ margin-top: 5px;
305
+ }
306
+ }
307
+
308
+ .list {
309
+ padding: 12px 12px 0 12px;
310
+ width: 100%;
311
+ background-color: #F5F5F5;
312
+ // margin-bottom: 14px;
313
+ max-height: 300px;
314
+ overflow: auto;
315
+
316
+ .item {
317
+ padding: 16px 12px;
318
+ border-radius: 8px;
319
+ background: #FFF;
320
+ display: flex;
321
+ align-items: center;
322
+ color: #333333;
323
+ font-size: 14px;
324
+ width: 100%;
325
+ margin-bottom: 12px;
326
+
327
+ .preview_icon {
328
+ margin-left: auto;
329
+ display: flex;
330
+ align-items: center;
331
+ color: #1678FF;
332
+
333
+ img {
334
+ width: 16px;
335
+ margin-right: 4px;
336
+ }
337
+ }
338
+ }
339
+ }
340
+
341
+ .more {
342
+ color: #1678FF;
343
+ text-align: center;
344
+ height: 30px;
345
+ line-height: 30px;
346
+ margin-bottom: 70px;
347
+ background-color: #F5F5F5;
348
+ }
349
+
350
+ .bottom_btn {
351
+ background-color: #fff;
352
+ height: 64px;
353
+ display: flex;
354
+ align-items: center;
355
+ justify-content: space-around;
356
+ position: fixed;
357
+ bottom: 0;
358
+ left: 0;
359
+ right: 0;
360
+
361
+ .btn {
362
+ width: 169px;
363
+ height: 40px;
364
+ border-radius: 50px;
365
+ font-size: 16px;
366
+ line-height: 40px;
367
+ text-align: center;
368
+ }
369
+
370
+ .cancel {
371
+ background-color: #fff;
372
+ border: 1px solid #E7E7E7;
373
+ color: #333;
374
+ }
375
+
376
+ .ok {
377
+ background: linear-gradient(90deg, #73AEFF 0%, #1678FF 100%);
378
+ color: #fff;
379
+ }
380
+ }
381
+ }
382
+ }
383
+
384
+ .preview {
385
+ width: 100%;
386
+ height: 100%;
387
+ position: fixed;
388
+ top: 0;
389
+ left: 0;
390
+ background: rgba(0, 0, 0, 0.5);
391
+ display: flex;
392
+ justify-content: center;
393
+ align-items: center;
394
+ z-index: 99;
395
+ .close {
396
+ position: absolute;
397
+ top: 20px;
398
+ right: 20px;
399
+ }
400
+ }
401
+
402
+ .sealPage {
403
+ position: fixed;
404
+ top: 0;
405
+ left: 0;
406
+ width: 100%;
407
+ height: 100%;
408
+ z-index: 99;
409
+ background: rgba(0, 0, 0, 0.5);
410
+ }
411
+ .sign_page {
412
+ position: fixed;
413
+ top: 0;
414
+ left: 0;
415
+ width: 100%;
416
+ height: 100%;
417
+ z-index: 99;
418
+ background: rgba(0, 0, 0, 0.5);
419
+ }
420
+
421
+ }
422
+ }
@@ -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;