ydb-components-material 0.1.66 → 0.1.67
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/build/docs/404.html +3 -3
- package/build/docs/_demos/:uuid +3 -3
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/umi.2387c9e8.js +1 -0
- package/build/docs/~demos/:uuid.html +3 -3
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.js +5 -5
- package/dist/BizComps.js.map +1 -1
- package/es/api.js +16 -11
- package/es/components/file-item/index.d.ts +1 -0
- package/es/components/file-item/index.js +48 -21
- package/es/components/file-item/seal.js +5 -20
- package/es/components/file-item/sealUtil.js +20 -38
- package/es/components/file-item/sign.js +9 -16
- package/es/components/file-item/signUtil.js +28 -41
- package/lib/api.js +17 -12
- package/lib/components/file-item/index.d.ts +1 -0
- package/lib/components/file-item/index.js +47 -20
- package/lib/components/file-item/seal.js +5 -20
- package/lib/components/file-item/sealUtil.js +20 -38
- package/lib/components/file-item/sign.js +9 -16
- package/lib/components/file-item/signUtil.js +28 -41
- package/lowcode/file-item/meta.ts +15 -0
- package/lowcode_es/file-item/meta.js +14 -0
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/file-item/meta.js +14 -0
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
- package/build/docs/umi.04af327b.js +0 -1
package/es/api.js
CHANGED
|
@@ -9,7 +9,8 @@ export var post = /*#__PURE__*/function () {
|
|
|
9
9
|
if (noJson === void 0) {
|
|
10
10
|
noJson = false;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
console.log('window.env', window.env);
|
|
13
|
+
if (window.env === 'release' && url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1) {
|
|
13
14
|
url = url.replace('zwfwpt.sxzwfw.gov.cn', 'zwfwpt.sxzwfw.gov.cn:10010');
|
|
14
15
|
}
|
|
15
16
|
_context.next = 1;
|
|
@@ -18,7 +19,7 @@ export var post = /*#__PURE__*/function () {
|
|
|
18
19
|
headers: {
|
|
19
20
|
'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
|
|
20
21
|
// 声明发送的数据格式
|
|
21
|
-
'Authorization':
|
|
22
|
+
'Authorization': url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? window.token : window.tokenTY
|
|
22
23
|
},
|
|
23
24
|
body: JSON.stringify(data)
|
|
24
25
|
}).then(function (response) {
|
|
@@ -52,7 +53,8 @@ export var get = /*#__PURE__*/function () {
|
|
|
52
53
|
return fetch(url + "?" + new URLSearchParams(data), {
|
|
53
54
|
method: 'GET',
|
|
54
55
|
headers: {
|
|
55
|
-
'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json'
|
|
56
|
+
'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
|
|
57
|
+
'Authorization': url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? window.token : window.tokenTY
|
|
56
58
|
}
|
|
57
59
|
}).then(function (response) {
|
|
58
60
|
return response.json();
|
|
@@ -103,30 +105,30 @@ export var documentDownload = function documentDownload(params, config) {
|
|
|
103
105
|
return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/documentDownload", params, config);
|
|
104
106
|
};
|
|
105
107
|
export var qrySealApi = function qrySealApi(params, config) {
|
|
106
|
-
return post(
|
|
108
|
+
return post(window.baseUrl + "/declaration/center/sign/api/qrySeal", params, config);
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
// 获取电子签章页面
|
|
110
112
|
export var getSignOrderIdApi = function getSignOrderIdApi(params, config) {
|
|
111
|
-
return post(
|
|
113
|
+
return post(window.baseUrl + "/declaration/center/sign/api/outSignCreateSiggOrder", params, config);
|
|
112
114
|
};
|
|
113
115
|
// 获取电子签章页面
|
|
114
116
|
export var getSealUrlApi = function getSealUrlApi(params, config) {
|
|
115
|
-
return post(
|
|
117
|
+
return post(window.baseUrl + "/declaration/center/sign/api/signWebByDirectMobile", params, config, true);
|
|
116
118
|
};
|
|
117
119
|
// 获取电子签章页面pc
|
|
118
120
|
export var getPcSealUrlApi = function getPcSealUrlApi(params, config) {
|
|
119
|
-
return post(
|
|
121
|
+
return post(window.baseUrl + "/declaration/center/sign/api/signWebByDirect", params, config);
|
|
120
122
|
};
|
|
121
123
|
|
|
122
124
|
// 电子签章-下载文件
|
|
123
125
|
export var signFileDownApi = function signFileDownApi(params, config) {
|
|
124
|
-
return post(
|
|
126
|
+
return post(window.baseUrl + "/declaration/center/sign/api/fileDownloadBySign", params, config);
|
|
125
127
|
};
|
|
126
128
|
|
|
127
129
|
// 电子签章 上传文件
|
|
128
130
|
export var fileUploadApi = function fileUploadApi(params, config) {
|
|
129
|
-
return post(
|
|
131
|
+
return post(window.baseUrl + "/declaration/material/base64UploadMaterial", params, config);
|
|
130
132
|
};
|
|
131
133
|
|
|
132
134
|
// 预览
|
|
@@ -138,8 +140,11 @@ export var getMaterialLib = function getMaterialLib(params, config) {
|
|
|
138
140
|
return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/material/queryFileByCardNo", params, config);
|
|
139
141
|
};
|
|
140
142
|
export var getSignFileApi = function getSignFileApi(params, config) {
|
|
141
|
-
return post(
|
|
143
|
+
return post(window.baseUrl + "/declaration/center/sign/api/getSignFileList", params, config);
|
|
142
144
|
};
|
|
143
145
|
export var getIcons = function getIcons(params, config) {
|
|
144
|
-
return post(
|
|
146
|
+
return post(window.baseUrl + "component/icon/page", params, config);
|
|
147
|
+
};
|
|
148
|
+
export var getGuideImg = function getGuideImg(params, config) {
|
|
149
|
+
return get(window.baseUrl + "/declaration/material/file/files/api/presigned-url", params, config);
|
|
145
150
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _Icon from "@alifd/next/es/icon";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
4
|
import _Message from "@alifd/next/es/message";
|
|
4
5
|
import _Radio from "@alifd/next/es/radio";
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
7
|
import React, { useEffect, useState } from 'react';
|
|
6
8
|
import CheckedIcon from "./icon/checked.svg";
|
|
7
9
|
import delIcon from "./icon/del.svg";
|
|
@@ -16,7 +18,7 @@ import uploadIcon from "./icon/upload.svg";
|
|
|
16
18
|
import closeIcon from "./icon/close.svg";
|
|
17
19
|
import SignPage from "./sign";
|
|
18
20
|
import SealPage from "./seal";
|
|
19
|
-
import { getMaterialLib } from "../../api";
|
|
21
|
+
import { getMaterialLib, getGuideImg } from "../../api";
|
|
20
22
|
import { initFormat, getFileExtension } from "./file.js";
|
|
21
23
|
import CheckPoint from "./checkPoint";
|
|
22
24
|
import "./index.scss";
|
|
@@ -40,6 +42,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
40
42
|
tokenTY = _ref.tokenTY,
|
|
41
43
|
accessToken = _ref.accessToken,
|
|
42
44
|
baseUrl = _ref.baseUrl,
|
|
45
|
+
env = _ref.env,
|
|
43
46
|
isPC = _ref.isPC,
|
|
44
47
|
disabled = _ref.disabled,
|
|
45
48
|
checkPoint = _ref.checkPoint,
|
|
@@ -280,26 +283,41 @@ var FileItem = function FileItem(_ref) {
|
|
|
280
283
|
// this.loadStatus = 'nomore'
|
|
281
284
|
});
|
|
282
285
|
};
|
|
283
|
-
var showGuide = function
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
286
|
+
var showGuide = /*#__PURE__*/function () {
|
|
287
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
288
|
+
var guideImgRes;
|
|
289
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
290
|
+
while (1) switch (_context.prev = _context.next) {
|
|
291
|
+
case 0:
|
|
292
|
+
if (guideImg) {
|
|
293
|
+
_context.next = 1;
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
return _context.abrupt("return");
|
|
297
|
+
case 1:
|
|
298
|
+
_context.next = 2;
|
|
299
|
+
return getGuideImg({
|
|
300
|
+
id: guideImg,
|
|
301
|
+
effectiveTime: 3600000
|
|
302
|
+
}, {
|
|
303
|
+
tokenTY: tokenTY
|
|
304
|
+
});
|
|
305
|
+
case 2:
|
|
306
|
+
guideImgRes = _context.sent;
|
|
307
|
+
if (guideImgRes.presignedUrl) {
|
|
308
|
+
setGuideurl(guideImgRes.presignedUrl);
|
|
309
|
+
setIsShowGuide(true);
|
|
310
|
+
}
|
|
311
|
+
case 3:
|
|
312
|
+
case "end":
|
|
313
|
+
return _context.stop();
|
|
314
|
+
}
|
|
315
|
+
}, _callee);
|
|
316
|
+
}));
|
|
317
|
+
return function showGuide() {
|
|
318
|
+
return _ref2.apply(this, arguments);
|
|
319
|
+
};
|
|
320
|
+
}();
|
|
303
321
|
var selectMaterialOk = function selectMaterialOk() {
|
|
304
322
|
console.log('val', materialId);
|
|
305
323
|
console.log('materialLib==', materialLib);
|
|
@@ -343,6 +361,14 @@ var FileItem = function FileItem(_ref) {
|
|
|
343
361
|
queryFileLibs();
|
|
344
362
|
}
|
|
345
363
|
}, [userInfo, isShowLib]);
|
|
364
|
+
useEffect(function () {
|
|
365
|
+
window.env = env;
|
|
366
|
+
window.baseUrl = baseUrl;
|
|
367
|
+
window.token = token;
|
|
368
|
+
window.tokenTY = tokenTY;
|
|
369
|
+
window.isPC = isPC;
|
|
370
|
+
window.accessToken = accessToken;
|
|
371
|
+
}, [env, baseUrl]);
|
|
346
372
|
return /*#__PURE__*/React.createElement("div", {
|
|
347
373
|
className: "file_item"
|
|
348
374
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -545,6 +571,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
545
571
|
token: token,
|
|
546
572
|
tokenTY: tokenTY,
|
|
547
573
|
baseUrl: baseUrl,
|
|
574
|
+
env: env,
|
|
548
575
|
getSealRes: getSealRes,
|
|
549
576
|
accessToken: accessToken,
|
|
550
577
|
handleClose: function handleClose() {
|
|
@@ -9,14 +9,8 @@ import { signFileDownApi, getSignFileApi, fileUploadApi } from "../../api";
|
|
|
9
9
|
function SealPage(props) {
|
|
10
10
|
var userInfo = props.userInfo,
|
|
11
11
|
file = props.file,
|
|
12
|
-
token = props.token,
|
|
13
|
-
tokenTY = props.tokenTY,
|
|
14
|
-
accessToken = props.accessToken,
|
|
15
12
|
getSealRes = props.getSealRes,
|
|
16
|
-
|
|
17
|
-
handleClose = props.handleClose,
|
|
18
|
-
_props$isPC = props.isPC,
|
|
19
|
-
isPC = _props$isPC === void 0 ? false : _props$isPC;
|
|
13
|
+
handleClose = props.handleClose;
|
|
20
14
|
var _useState = useState(''),
|
|
21
15
|
srcUrl = _useState[0],
|
|
22
16
|
setSrcUrl = _useState[1];
|
|
@@ -37,7 +31,7 @@ function SealPage(props) {
|
|
|
37
31
|
fileObj.url = file.oldUrl;
|
|
38
32
|
}
|
|
39
33
|
_context.next = 1;
|
|
40
|
-
return initSealPageMethod(file, userInfo
|
|
34
|
+
return initSealPageMethod(file, userInfo);
|
|
41
35
|
case 1:
|
|
42
36
|
res = _context.sent;
|
|
43
37
|
if (res) {
|
|
@@ -77,10 +71,7 @@ function SealPage(props) {
|
|
|
77
71
|
};
|
|
78
72
|
console.log('params', params);
|
|
79
73
|
_context2.next = 1;
|
|
80
|
-
return fileUploadApi(params
|
|
81
|
-
baseUrl: baseUrl,
|
|
82
|
-
tokenTY: tokenTY
|
|
83
|
-
});
|
|
74
|
+
return fileUploadApi(params);
|
|
84
75
|
case 1:
|
|
85
76
|
uploadRes = _context2.sent;
|
|
86
77
|
console.log('重新上传的文件', uploadRes);
|
|
@@ -109,9 +100,6 @@ function SealPage(props) {
|
|
|
109
100
|
var signFileDown = function signFileDown(filePath) {
|
|
110
101
|
signFileDownApi({
|
|
111
102
|
fileUrl: filePath
|
|
112
|
-
}, {
|
|
113
|
-
baseUrl: baseUrl,
|
|
114
|
-
tokenTY: tokenTY
|
|
115
103
|
}).then(function (res) {
|
|
116
104
|
if (res.code === 200) {
|
|
117
105
|
uploadNewFile(res.data);
|
|
@@ -126,10 +114,7 @@ function SealPage(props) {
|
|
|
126
114
|
var params = {
|
|
127
115
|
orderId: orderId
|
|
128
116
|
};
|
|
129
|
-
getSignFileApi(params
|
|
130
|
-
baseUrl: baseUrl,
|
|
131
|
-
tokenTY: tokenTY
|
|
132
|
-
}).then(function (res) {
|
|
117
|
+
getSignFileApi(params).then(function (res) {
|
|
133
118
|
if (!res) {
|
|
134
119
|
return;
|
|
135
120
|
}
|
|
@@ -190,7 +175,7 @@ function SealPage(props) {
|
|
|
190
175
|
}, []);
|
|
191
176
|
useEffect(function () {
|
|
192
177
|
handleRes();
|
|
193
|
-
}, [userInfo, file
|
|
178
|
+
}, [userInfo, file]);
|
|
194
179
|
return /*#__PURE__*/React.createElement("div", {
|
|
195
180
|
className: "sealPage",
|
|
196
181
|
ref: elementRef
|
|
@@ -7,25 +7,22 @@ import { qrySealApi, getSealUrlApi, getSignOrderIdApi, getPcSealUrlApi } from ".
|
|
|
7
7
|
// const userInfo = uni.getStorageSync('userInfo')
|
|
8
8
|
|
|
9
9
|
// 对外的方法 获取电子签章的页面地址
|
|
10
|
-
export function initSealPageMethod(_x, _x2
|
|
10
|
+
export function initSealPageMethod(_x, _x2) {
|
|
11
11
|
return _initSealPageMethod.apply(this, arguments);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// [第1步] 查询当前用户是否有电子签章
|
|
15
15
|
function _initSealPageMethod() {
|
|
16
|
-
_initSealPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo
|
|
16
|
+
_initSealPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo) {
|
|
17
17
|
var name, sealList, fileUrl, orderId, pageUrl, params;
|
|
18
18
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
19
19
|
while (1) switch (_context.prev = _context.next) {
|
|
20
20
|
case 0:
|
|
21
|
-
if (isPC === void 0) {
|
|
22
|
-
isPC = false;
|
|
23
|
-
}
|
|
24
21
|
name = fileObj.name;
|
|
25
22
|
console.log('fileObj', fileObj, userInfo);
|
|
26
23
|
// 【第1步】判断当前用户是否有印章
|
|
27
24
|
_context.next = 1;
|
|
28
|
-
return querySeal(userInfo
|
|
25
|
+
return querySeal(userInfo);
|
|
29
26
|
case 1:
|
|
30
27
|
sealList = _context.sent;
|
|
31
28
|
console.log('sealList---', sealList);
|
|
@@ -37,7 +34,7 @@ function _initSealPageMethod() {
|
|
|
37
34
|
return _context.abrupt("return", false);
|
|
38
35
|
case 2:
|
|
39
36
|
_context.next = 3;
|
|
40
|
-
return uploadSealFile(fileObj
|
|
37
|
+
return uploadSealFile(fileObj);
|
|
41
38
|
case 3:
|
|
42
39
|
fileUrl = _context.sent;
|
|
43
40
|
console.log('fileUrl---', fileUrl);
|
|
@@ -48,7 +45,7 @@ function _initSealPageMethod() {
|
|
|
48
45
|
return _context.abrupt("return", false);
|
|
49
46
|
case 4:
|
|
50
47
|
_context.next = 5;
|
|
51
|
-
return getSignOrderId(sealList, fileObj, fileUrl,
|
|
48
|
+
return getSignOrderId(sealList, fileObj, fileUrl, userInfo);
|
|
52
49
|
case 5:
|
|
53
50
|
orderId = _context.sent;
|
|
54
51
|
console.log('orderId---', orderId);
|
|
@@ -59,7 +56,7 @@ function _initSealPageMethod() {
|
|
|
59
56
|
return _context.abrupt("return", false);
|
|
60
57
|
case 6:
|
|
61
58
|
_context.next = 7;
|
|
62
|
-
return getMobilePageFun(orderId
|
|
59
|
+
return getMobilePageFun(orderId);
|
|
63
60
|
case 7:
|
|
64
61
|
pageUrl = _context.sent;
|
|
65
62
|
// 将 电子签章地址/文件名称 返回
|
|
@@ -77,7 +74,7 @@ function _initSealPageMethod() {
|
|
|
77
74
|
}));
|
|
78
75
|
return _initSealPageMethod.apply(this, arguments);
|
|
79
76
|
}
|
|
80
|
-
function querySeal(userInfo
|
|
77
|
+
function querySeal(userInfo) {
|
|
81
78
|
console.log('querySeal', userInfo);
|
|
82
79
|
// uni.showLoading({ title: '查询印章中' })
|
|
83
80
|
var params = {
|
|
@@ -86,10 +83,7 @@ function querySeal(userInfo, token, baseUrl) {
|
|
|
86
83
|
userIdType: '2'
|
|
87
84
|
};
|
|
88
85
|
return new Promise(function (resolve) {
|
|
89
|
-
qrySealApi(params
|
|
90
|
-
token: token,
|
|
91
|
-
baseUrl: baseUrl
|
|
92
|
-
}).then(function (res) {
|
|
86
|
+
qrySealApi(params).then(function (res) {
|
|
93
87
|
if (res.data && res.data.length > 0) {
|
|
94
88
|
resolve(res.data);
|
|
95
89
|
} else {
|
|
@@ -104,11 +98,11 @@ function querySeal(userInfo, token, baseUrl) {
|
|
|
104
98
|
}
|
|
105
99
|
|
|
106
100
|
// [第2步] 上传文件
|
|
107
|
-
function uploadSealFile(
|
|
101
|
+
function uploadSealFile(_x3) {
|
|
108
102
|
return _uploadSealFile.apply(this, arguments);
|
|
109
103
|
} // [第3步] 获取电子印章页面
|
|
110
104
|
function _uploadSealFile() {
|
|
111
|
-
_uploadSealFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fileObj
|
|
105
|
+
_uploadSealFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fileObj) {
|
|
112
106
|
var blob, file;
|
|
113
107
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
114
108
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -126,9 +120,9 @@ function _uploadSealFile() {
|
|
|
126
120
|
filename: fileObj.name,
|
|
127
121
|
// 文件名称
|
|
128
122
|
headers: {
|
|
129
|
-
Authorization:
|
|
123
|
+
Authorization: window.tokenTY
|
|
130
124
|
},
|
|
131
|
-
action: baseUrl + "/declaration/center/sign/api/fileUploadApi",
|
|
125
|
+
action: window.baseUrl + "/declaration/center/sign/api/fileUploadApi",
|
|
132
126
|
// 上传文件的地址
|
|
133
127
|
onError: function onError(e) {
|
|
134
128
|
// uni.$u.toast(e.msg || '上传文件异常');
|
|
@@ -150,9 +144,9 @@ function _uploadSealFile() {
|
|
|
150
144
|
}));
|
|
151
145
|
return _uploadSealFile.apply(this, arguments);
|
|
152
146
|
}
|
|
153
|
-
function getSignOrderId(sealList, fileObj, esusFileUrl,
|
|
147
|
+
function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
|
|
154
148
|
// uni.showLoading({ title: '获取签章页面中' })
|
|
155
|
-
console.log('sealList', sealList, fileObj, esusFileUrl,
|
|
149
|
+
console.log('sealList', sealList, fileObj, esusFileUrl, userInfo);
|
|
156
150
|
var fileId = fileObj.fileId,
|
|
157
151
|
name = fileObj.name;
|
|
158
152
|
// 循环签章列表 - 开始
|
|
@@ -226,10 +220,7 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, token, baseUrl, userInfo
|
|
|
226
220
|
console.log('params---', params);
|
|
227
221
|
return new Promise(function (resolve) {
|
|
228
222
|
console.log('获取签章订单id');
|
|
229
|
-
getSignOrderIdApi(params
|
|
230
|
-
token: token,
|
|
231
|
-
baseUrl: baseUrl
|
|
232
|
-
}).then(function (res) {
|
|
223
|
+
getSignOrderIdApi(params).then(function (res) {
|
|
233
224
|
if (res) {
|
|
234
225
|
var bigNumber = BigInt(res);
|
|
235
226
|
resolve(bigNumber + '');
|
|
@@ -246,22 +237,16 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, token, baseUrl, userInfo
|
|
|
246
237
|
}
|
|
247
238
|
|
|
248
239
|
// [第4步-移动端] 获取电子印章页面
|
|
249
|
-
function getMobilePageFun(orderId
|
|
250
|
-
if (isPC === void 0) {
|
|
251
|
-
isPC = false;
|
|
252
|
-
}
|
|
240
|
+
function getMobilePageFun(orderId) {
|
|
253
241
|
// uni.showLoading({ title: '获取移动端签章页面中' })
|
|
254
242
|
var params = {
|
|
255
|
-
accessToken: accessToken,
|
|
243
|
+
accessToken: window.accessToken,
|
|
256
244
|
acctType: '20',
|
|
257
245
|
orderId: orderId
|
|
258
246
|
};
|
|
259
247
|
return new Promise(function (resolve) {
|
|
260
|
-
if (isPC) {
|
|
261
|
-
getPcSealUrlApi(params
|
|
262
|
-
baseUrl: baseUrl,
|
|
263
|
-
token: token
|
|
264
|
-
}).then(function (res) {
|
|
248
|
+
if (window.isPC) {
|
|
249
|
+
getPcSealUrlApi(params).then(function (res) {
|
|
265
250
|
console.log('签章页面pc----', res);
|
|
266
251
|
if (res.code === 200) {
|
|
267
252
|
resolve(res.data);
|
|
@@ -275,10 +260,7 @@ function getMobilePageFun(orderId, accessToken, token, baseUrl, isPC) {
|
|
|
275
260
|
// uni.hideLoading()
|
|
276
261
|
});
|
|
277
262
|
} else {
|
|
278
|
-
getSealUrlApi(params
|
|
279
|
-
baseUrl: baseUrl,
|
|
280
|
-
token: token
|
|
281
|
-
}).then(function (res) {
|
|
263
|
+
getSealUrlApi(params).then(function (res) {
|
|
282
264
|
if (res) {
|
|
283
265
|
console.log(res, '移动端签章页面');
|
|
284
266
|
resolve(res);
|
|
@@ -4,15 +4,10 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
4
4
|
import React, { useEffect, useState, useRef } from 'react';
|
|
5
5
|
import { initSignPageMethod, getSignRes } from "./signUtil";
|
|
6
6
|
function SignPage(props) {
|
|
7
|
-
var
|
|
8
|
-
userInfo = props.userInfo,
|
|
7
|
+
var userInfo = props.userInfo,
|
|
9
8
|
file = props.file,
|
|
10
|
-
token = props.token,
|
|
11
|
-
tokenTY = props.tokenTY,
|
|
12
9
|
getRes = props.getRes,
|
|
13
|
-
handleClose = props.handleClose
|
|
14
|
-
baseUrl = props.baseUrl,
|
|
15
|
-
device = props.device;
|
|
10
|
+
handleClose = props.handleClose;
|
|
16
11
|
var _useState = useState(''),
|
|
17
12
|
srcUrl = _useState[0],
|
|
18
13
|
setSrcUrl = _useState[1];
|
|
@@ -37,7 +32,7 @@ function SignPage(props) {
|
|
|
37
32
|
fileObj.url = file.oldUrl;
|
|
38
33
|
}
|
|
39
34
|
_context.next = 1;
|
|
40
|
-
return initSignPageMethod(file, userInfo
|
|
35
|
+
return initSignPageMethod(file, userInfo);
|
|
41
36
|
case 1:
|
|
42
37
|
res = _context.sent;
|
|
43
38
|
documentIdVal = res.documentId, contractIdVal = res.contractId, pageUrl = res.pageUrl, nameVal = res.name;
|
|
@@ -57,15 +52,13 @@ function SignPage(props) {
|
|
|
57
52
|
};
|
|
58
53
|
}();
|
|
59
54
|
var getSignedFile = /*#__PURE__*/function () {
|
|
60
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(documentIdVal, contractIdVal, nameVal
|
|
55
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(documentIdVal, contractIdVal, nameVal) {
|
|
61
56
|
var newFile, finalFile;
|
|
62
57
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
63
58
|
while (1) switch (_context2.prev = _context2.next) {
|
|
64
59
|
case 0:
|
|
65
|
-
console.log('tokenVal----', tokenVal);
|
|
66
|
-
// const { autoUpload } = this
|
|
67
60
|
_context2.next = 1;
|
|
68
|
-
return getSignRes(documentIdVal, contractIdVal, nameVal, true
|
|
61
|
+
return getSignRes(documentIdVal, contractIdVal, nameVal, true);
|
|
69
62
|
case 1:
|
|
70
63
|
newFile = _context2.sent;
|
|
71
64
|
console.log(newFile, '签署完毕后的');
|
|
@@ -90,7 +83,7 @@ function SignPage(props) {
|
|
|
90
83
|
}
|
|
91
84
|
}, _callee2);
|
|
92
85
|
}));
|
|
93
|
-
return function getSignedFile(_x, _x2, _x3
|
|
86
|
+
return function getSignedFile(_x, _x2, _x3) {
|
|
94
87
|
return _ref2.apply(this, arguments);
|
|
95
88
|
};
|
|
96
89
|
}();
|
|
@@ -102,16 +95,16 @@ function SignPage(props) {
|
|
|
102
95
|
init();
|
|
103
96
|
}, []);
|
|
104
97
|
useEffect(function () {
|
|
105
|
-
if (srcUrl && documentId && contractId && name &&
|
|
98
|
+
if (srcUrl && documentId && contractId && name && !timerRef.current) {
|
|
106
99
|
handleClearInterval();
|
|
107
100
|
timerRef.current = setInterval(function () {
|
|
108
|
-
getSignedFile(documentId, contractId, name
|
|
101
|
+
getSignedFile(documentId, contractId, name);
|
|
109
102
|
}, 3000);
|
|
110
103
|
}
|
|
111
104
|
return function () {
|
|
112
105
|
handleClearInterval();
|
|
113
106
|
};
|
|
114
|
-
}, [srcUrl, documentId, contractId, name
|
|
107
|
+
}, [srcUrl, documentId, contractId, name]);
|
|
115
108
|
return /*#__PURE__*/React.createElement("div", {
|
|
116
109
|
className: "sign_page"
|
|
117
110
|
}, /*#__PURE__*/React.createElement("iframe", {
|