ydb-components-material 0.1.83 → 0.1.85

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 (43) 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/{umi.97a3bada.css → umi.466b4c0a.css} +1 -1
  7. package/build/docs/umi.860fec17.js +1 -0
  8. package/build/docs/~demos/:uuid.html +3 -3
  9. package/build/docs/~demos/colorful-button-demo.html +3 -3
  10. package/build/docs/~demos/colorful-input-demo.html +3 -3
  11. package/build/lowcode/assets-daily.json +11 -11
  12. package/build/lowcode/assets-dev.json +2 -2
  13. package/build/lowcode/assets-prod.json +11 -11
  14. package/build/lowcode/meta.js +1 -1
  15. package/build/lowcode/render/default/view.css +1 -1
  16. package/build/lowcode/render/default/view.js +1 -1
  17. package/build/lowcode/view.css +1 -1
  18. package/build/lowcode/view.js +1 -1
  19. package/dist/BizComps.css +1 -1
  20. package/dist/BizComps.js +3 -3
  21. package/dist/BizComps.js.map +1 -1
  22. package/es/api.js +31 -30
  23. package/es/components/file-item/checkPoint.scss +1 -1
  24. package/es/components/file-item/file.js +5 -4
  25. package/es/components/file-item/index.js +55 -34
  26. package/es/components/file-item/seal.js +36 -6
  27. package/es/components/file-item/sealUtil.js +33 -59
  28. package/es/components/file-item/sign.js +22 -4
  29. package/es/components/file-item/signUtil.js +43 -56
  30. package/lib/api.js +31 -30
  31. package/lib/components/file-item/checkPoint.scss +1 -1
  32. package/lib/components/file-item/file.js +5 -4
  33. package/lib/components/file-item/index.js +54 -33
  34. package/lib/components/file-item/seal.js +36 -6
  35. package/lib/components/file-item/sealUtil.js +33 -59
  36. package/lib/components/file-item/sign.js +22 -4
  37. package/lib/components/file-item/signUtil.js +43 -56
  38. package/lowcode_es/meta.js +1 -1
  39. package/lowcode_lib/meta.js +1 -1
  40. package/package.json +3 -3
  41. package/build/docs/umi.84ae667a.js +0 -1
  42. package/es/components/file-item/Untitled-5.json +0 -290
  43. package/lib/components/file-item/Untitled-5.json +0 -290
package/es/api.js CHANGED
@@ -9,19 +9,19 @@ export var post = /*#__PURE__*/function () {
9
9
  if (noJson === void 0) {
10
10
  noJson = false;
11
11
  }
12
- console.log('window.env111', window.env, window.tokenTY);
12
+ console.log('config', config);
13
13
  // zwfwpt.sxzwfw.gov.cn
14
- if (window.env === 'release' && url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1) {
15
- url = url.replace('zwfwpt.sxzwfw.gov.cn', 'zwfwpt.sxzwfw.gov.cn:10010');
16
- }
14
+ // if (config.env === 'release' && url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1) {
15
+ // url = url.replace('zwfwpt.sxzwfw.gov.cn', 'zwfwpt.sxzwfw.gov.cn:10010')
16
+ // }
17
17
  _context.next = 1;
18
18
  return fetch(url, {
19
19
  method: 'POST',
20
20
  headers: {
21
21
  'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
22
22
  // 声明发送的数据格式
23
- // zwfwpt.sxzwfw.gov.cn
24
- 'Authorization': url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? window.token : window.tokenTY
23
+ // url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? config.token : config.tokenTY
24
+ 'Authorization': config && config.tokenTY ? config.tokenTY : ''
25
25
  },
26
26
  body: JSON.stringify(data)
27
27
  }).then(function (response) {
@@ -56,7 +56,7 @@ export var get = /*#__PURE__*/function () {
56
56
  method: 'GET',
57
57
  headers: {
58
58
  'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
59
- 'Authorization': url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? window.token : window.tokenTY
59
+ 'Authorization': config && config.tokenTY ? config.tokenTY : ''
60
60
  }
61
61
  }).then(function (response) {
62
62
  return response.json();
@@ -78,84 +78,85 @@ export var get = /*#__PURE__*/function () {
78
78
  return _ref2.apply(this, arguments);
79
79
  };
80
80
  }();
81
+ // https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI
81
82
  export var createbycategory = function createbycategory(params, config) {
82
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/createbycategory", params, config);
83
+ return post(config.baseUrl + "/declaration/center/signapproval/api/createbycategory", params, config);
83
84
  };
84
85
 
85
86
  // 获取电子签批签署页面
86
87
  export var contractSignUrl = function contractSignUrl(params, config) {
87
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/contractSignUrl", params, config);
88
+ return post(config.baseUrl + "/declaration/center/signapproval/api/contractSignUrl", params, config);
88
89
  };
89
90
 
90
91
  // 获取电子签批签署页面
91
92
  export var signurl = function signurl(params, config) {
92
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/contract/signurl/v3", params, config);
93
+ return post(config.baseUrl + "/declaration/center/signapproval/contract/signurl/v3", params, config);
93
94
  };
94
95
 
95
- // 校验签批状态-轮训
96
+ // 校验签批状态 - 轮训
96
97
  export var checkSignState = function checkSignState(params, config) {
97
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/checkSignState", params, config);
98
+ return post(config.baseUrl + "/declaration/center/signapproval/api/checkSignState", params, config);
98
99
  };
99
100
 
100
101
  // 封存电子签批并完成签署
101
102
  export var contractFinish = function contractFinish(params, config) {
102
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/contract/finish", params, config);
103
+ return post(config.baseUrl + "/declaration/center/signapproval/api/contract/finish", params, config);
103
104
  };
104
105
 
105
106
  // 下载签署文档
106
107
  export var documentDownload = function documentDownload(params, config) {
107
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/documentDownload", params, config);
108
+ return post(config.baseUrl + "/declaration/center/signapproval/api/documentDownload", params, config);
108
109
  };
109
110
  export var qrySealApi = function qrySealApi(params, config) {
110
- return post(window.baseUrl + "/declaration/center/sign/api/qrySeal", params, config);
111
+ return post(config.baseUrl + "/declaration/center/sign/api/qrySeal", params, config);
111
112
  };
112
113
 
113
114
  // 获取电子签章页面
114
115
  export var getSignOrderIdApi = function getSignOrderIdApi(params, config) {
115
- return post(window.baseUrl + "/declaration/center/sign/api/outSignCreateSiggOrder", params, config);
116
+ return post(config.baseUrl + "/declaration/center/sign/api/outSignCreateSiggOrder", params, config);
116
117
  };
117
118
  // 获取电子签章页面
118
119
  export var getSealUrlApi = function getSealUrlApi(params, config) {
119
- return post(window.baseUrl + "/declaration/center/sign/api/signWebByDirectMobile", params, config, true);
120
+ return post(config.baseUrl + "/declaration/center/sign/api/signWebByDirectMobile", params, config, true);
120
121
  };
121
- // 获取电子签章页面pc
122
+ // 获取电子签章页面 pc
122
123
  export var getPcSealUrlApi = function getPcSealUrlApi(params, config) {
123
- return post(window.baseUrl + "/declaration/center/sign/api/signWebByDirect", params, config);
124
+ return post(config.baseUrl + "/declaration/center/sign/api/signWebByDirect", params, config);
124
125
  };
125
126
 
126
- // 电子签章-下载文件
127
+ // 电子签章 - 下载文件
127
128
  export var signFileDownApi = function signFileDownApi(params, config) {
128
- return post(window.baseUrl + "/declaration/center/sign/api/fileDownloadBySign", params, config);
129
+ return post(config.baseUrl + "/declaration/center/sign/api/fileDownloadBySign", params, config);
129
130
  };
130
131
 
131
132
  // 电子签章 上传文件
132
133
  export var fileUploadApi = function fileUploadApi(params, config) {
133
- return post(window.baseUrl + "/declaration/material/base64UploadMaterial", params, config);
134
+ return post(config.baseUrl + "/declaration/material/base64UploadMaterial", params, config);
134
135
  };
135
136
 
136
137
  // 预览
137
138
  export var previewApi = function previewApi(params, config) {
138
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/sign/api/preview", params, config);
139
+ return post(config.baseUrl + "/declaration/center/sign/api/preview", params, config);
139
140
  };
140
141
  // 材料库
141
142
  export var getMaterialLib = function getMaterialLib(params, config) {
142
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/material/queryFileByCardNo", params, config);
143
+ return post(config.baseUrl + "/declaration/material/queryFileByCardNo", params, config);
143
144
  };
144
145
  export var getUrlById = function getUrlById(params, config) {
145
- return get("https://zwfwpt.sxzwfw.gov.cn:10009/DeclarationAPI/declaration/material/file/files/api/presigned-url", params, config);
146
+ return get(config.baseUrl + "/declaration/material/file/files/api/presigned-url", params, config);
146
147
  };
147
148
  export var onlinePreview = function onlinePreview(params, config) {
148
- return get("https://zwfwpt.sxzwfw.gov.cn:10009/DeclarationAPI/declaration/material/onlinePreview", params, config);
149
+ return get(config.baseUrl + "/declaration/material/onlinePreview", params, config);
149
150
  };
150
151
  export var getMaterialPreview = function getMaterialPreview(params, config) {
151
- return get(window.baseUrl + "/declaration/material/onlinePreview", params, config);
152
+ return get(config.baseUrl + "/declaration/material/onlinePreview", params, config);
152
153
  };
153
154
  export var getSignFileApi = function getSignFileApi(params, config) {
154
- return post(window.baseUrl + "/declaration/center/sign/api/getSignFileList", params, config);
155
+ return post(config.baseUrl + "/declaration/center/sign/api/getSignFileList", params, config);
155
156
  };
156
157
  export var getIcons = function getIcons(params, config) {
157
- return post(window.baseUrl + "component/icon/page", params, config);
158
+ return post(config.baseUrl + "component/icon/page", params, config);
158
159
  };
159
160
  export var getGuideImg = function getGuideImg(params, config) {
160
- return get(window.baseUrl + "/declaration/material/file/files/api/presigned-url", params, config);
161
+ return get(config.baseUrl + "/declaration/material/file/files/api/presigned-url", params, config);
161
162
  };
@@ -8,7 +8,7 @@
8
8
  left: 0;
9
9
  top: 0;
10
10
  background: #919191;
11
- // padding-top: 100px;
11
+ overflow-y: scroll;
12
12
  #file_check_point {
13
13
  overflow: visible !important;
14
14
  overflow-clip-margin: unset !important;
@@ -93,17 +93,18 @@ export function dataURLtoBlob(dataUrl) {
93
93
  }
94
94
 
95
95
  // 上传文件至申报端的服务器 [方法]
96
- export function uploadFilePromise(url, baseUrl, token) {
96
+ export function uploadFilePromise(url, config) {
97
+ console.log('uploadFilePromise', config);
97
98
  return new Promise(function (resolve, reject) {
98
99
  var formData = new FormData();
99
100
  formData.append('file', url);
100
101
  formData.append('open', true);
101
102
  formData.append('open', 'true');
102
- fetch(baseUrl + "/declaration/material/file/files/api", {
103
+ fetch(config.baseUrl + "/declaration/material/file/files/api", {
103
104
  method: 'POST',
104
105
  body: formData,
105
- header: {
106
- Authorization: token
106
+ headers: {
107
+ 'Authorization': config.tokenTY
107
108
  }
108
109
  }).then(function (response) {
109
110
  return response.json();
@@ -18,7 +18,7 @@ import uploadIcon from "./icon/upload.svg";
18
18
  import closeIcon from "./icon/close.svg";
19
19
  import SignPage from "./sign";
20
20
  import SealPage from "./seal";
21
- import { getMaterialLib, getGuideImg } from "../../api";
21
+ import { getMaterialLib, getGuideImg, getUrlById, onlinePreview } from "../../api";
22
22
  import { initFormat, getFileExtension } from "./file.js";
23
23
  import CheckPoint from "./checkPoint";
24
24
  import "./index.scss";
@@ -125,7 +125,7 @@ var FileItem = function FileItem(_ref) {
125
125
  method: 'POST',
126
126
  body: formData,
127
127
  headers: {
128
- 'Authorization': tokenTY
128
+ 'Authorization': tokenTY || ''
129
129
  }
130
130
  }).then(function (response) {
131
131
  return response.json();
@@ -150,6 +150,7 @@ var FileItem = function FileItem(_ref) {
150
150
  // 预览材料
151
151
  var preview = /*#__PURE__*/function () {
152
152
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
153
+ var urlRes, res;
153
154
  return _regeneratorRuntime.wrap(function (_context) {
154
155
  while (1) switch (_context.prev = _context.next) {
155
156
  case 0:
@@ -163,29 +164,40 @@ var FileItem = function FileItem(_ref) {
163
164
  setPreviewIframeUrl(fileUrl);
164
165
  setIsShowPreview(true);
165
166
  // if (!fileId) return;
166
- // const urlRes = await getUrlById({
167
- // id: fileId,
168
- // effectiveTime: 3600000
169
- // })
170
- // if (urlRes.presignedUrlList && urlRes.presignedUrlList.length > 0) {
171
- // // fetch(`${baseUrl}/declaration/material/onlinePreview?url=${urlRes.presignedUrlList[2]}`, {
172
- // // method: 'GET',
173
- // // headers: {
174
- // // 'Authorization': tokenTY
175
- // // }
176
- // // })
177
- // // .then(response => response.json())
178
- // // .then(res => {
179
- // // setPreviewIframeUrl(res.url)
180
- // // setIsShowPreview(true)
181
- // // })
182
- // const res = await onlinePreview({
183
- // url: urlRes.presignedUrlList[2],
184
- // })
185
- // setPreviewIframeUrl(res.url)
186
- // setIsShowPreview(true)
187
- // }
167
+ _context.next = 2;
168
+ return getUrlById({
169
+ id: fileId,
170
+ effectiveTime: 3600000
171
+ }, {
172
+ token: token,
173
+ tokenTY: tokenTY,
174
+ baseUrl: baseUrl,
175
+ env: env,
176
+ isPC: isPC,
177
+ accessToken: accessToken
178
+ });
188
179
  case 2:
180
+ urlRes = _context.sent;
181
+ if (!(urlRes.presignedUrlList && urlRes.presignedUrlList.length > 0)) {
182
+ _context.next = 4;
183
+ break;
184
+ }
185
+ _context.next = 3;
186
+ return onlinePreview({
187
+ url: urlRes.presignedUrlList[2]
188
+ }, {
189
+ token: token,
190
+ tokenTY: tokenTY,
191
+ baseUrl: baseUrl,
192
+ env: env,
193
+ isPC: isPC,
194
+ accessToken: accessToken
195
+ });
196
+ case 3:
197
+ res = _context.sent;
198
+ setPreviewIframeUrl(res.url);
199
+ setIsShowPreview(true);
200
+ case 4:
189
201
  case "end":
190
202
  return _context.stop();
191
203
  }
@@ -206,7 +218,7 @@ var FileItem = function FileItem(_ref) {
206
218
  fetch(baseUrl + "/declaration/material/onlinePreview?url=" + url, {
207
219
  method: 'GET',
208
220
  headers: {
209
- 'Authorization': tokenTY
221
+ 'Authorization': tokenTY || ''
210
222
  }
211
223
  }).then(function (response) {
212
224
  return response.json();
@@ -269,7 +281,14 @@ var FileItem = function FileItem(_ref) {
269
281
  pageNum: 1,
270
282
  pageSize: 10
271
283
  };
272
- getMaterialLib(params).then(function (res) {
284
+ getMaterialLib(params, {
285
+ token: token,
286
+ tokenTY: tokenTY,
287
+ baseUrl: baseUrl,
288
+ env: env,
289
+ isPC: isPC,
290
+ accessToken: accessToken
291
+ }).then(function (res) {
273
292
  if (res.code === 200) {
274
293
  var records = res.data.records;
275
294
  setMaterialLib(records);
@@ -299,6 +318,13 @@ var FileItem = function FileItem(_ref) {
299
318
  return getGuideImg({
300
319
  id: guideImg,
301
320
  effectiveTime: 3600000
321
+ }, {
322
+ token: token,
323
+ tokenTY: tokenTY,
324
+ baseUrl: baseUrl,
325
+ env: env,
326
+ isPC: isPC,
327
+ accessToken: accessToken
302
328
  });
303
329
  case 2:
304
330
  guideImgRes = _context2.sent;
@@ -361,14 +387,6 @@ var FileItem = function FileItem(_ref) {
361
387
  }, 0);
362
388
  }
363
389
  }, [userInfo, isShowLib, tokenTY]);
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, token, tokenTY, isPC, accessToken]);
372
390
  return /*#__PURE__*/React.createElement("div", {
373
391
  className: "file_item",
374
392
  style: style
@@ -557,6 +575,8 @@ var FileItem = function FileItem(_ref) {
557
575
  token: token,
558
576
  tokenTY: tokenTY,
559
577
  baseUrl: baseUrl,
578
+ env: env,
579
+ isPC: isPC,
560
580
  getRes: getRes,
561
581
  handleClose: function handleClose() {
562
582
  return setIsShowSignPage(false);
@@ -575,6 +595,7 @@ var FileItem = function FileItem(_ref) {
575
595
  tokenTY: tokenTY,
576
596
  baseUrl: baseUrl,
577
597
  env: env,
598
+ isPC: isPC,
578
599
  getSealRes: getSealRes,
579
600
  accessToken: accessToken,
580
601
  handleClose: function handleClose() {
@@ -10,7 +10,12 @@ function SealPage(props) {
10
10
  var userInfo = props.userInfo,
11
11
  file = props.file,
12
12
  getSealRes = props.getSealRes,
13
- handleClose = props.handleClose;
13
+ handleClose = props.handleClose,
14
+ tokenTY = props.tokenTY,
15
+ baseUrl = props.baseUrl,
16
+ env = props.env,
17
+ isPC = props.isPC,
18
+ accessToken = props.accessToken;
14
19
  var _useState = useState(''),
15
20
  srcUrl = _useState[0],
16
21
  setSrcUrl = _useState[1];
@@ -26,12 +31,19 @@ function SealPage(props) {
26
31
  while (1) switch (_context.prev = _context.next) {
27
32
  case 0:
28
33
  console.log('file', file, userInfo);
29
- fileObj = file; // 有旧的URL说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
34
+ fileObj = file; // 有旧的 URL 说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
30
35
  if (file.oldUrl) {
31
36
  fileObj.url = file.oldUrl;
32
37
  }
38
+ // 传递配置参数给工具函数
33
39
  _context.next = 1;
34
- return initSealPageMethod(fileObj, userInfo);
40
+ return initSealPageMethod(fileObj, userInfo, {
41
+ tokenTY: tokenTY,
42
+ baseUrl: baseUrl,
43
+ env: env,
44
+ isPC: isPC,
45
+ accessToken: accessToken
46
+ });
35
47
  case 1:
36
48
  res = _context.sent;
37
49
  if (res) {
@@ -71,7 +83,13 @@ function SealPage(props) {
71
83
  };
72
84
  console.log('params', params);
73
85
  _context2.next = 1;
74
- return fileUploadApi(params);
86
+ return fileUploadApi(params, {
87
+ tokenTY: tokenTY,
88
+ baseUrl: baseUrl,
89
+ env: env,
90
+ isPC: isPC,
91
+ accessToken: accessToken
92
+ });
75
93
  case 1:
76
94
  uploadRes = _context2.sent;
77
95
  console.log('重新上传的文件', uploadRes);
@@ -100,6 +118,12 @@ function SealPage(props) {
100
118
  var signFileDown = function signFileDown(filePath) {
101
119
  signFileDownApi({
102
120
  fileUrl: filePath
121
+ }, {
122
+ tokenTY: tokenTY,
123
+ baseUrl: baseUrl,
124
+ env: env,
125
+ isPC: isPC,
126
+ accessToken: accessToken
103
127
  }).then(function (res) {
104
128
  if (res.code === 200) {
105
129
  uploadNewFile(res.data);
@@ -107,14 +131,20 @@ function SealPage(props) {
107
131
  });
108
132
  };
109
133
 
110
- // 电子签章-移动端签批 获取移动端签章结果(文件地址)
134
+ // 电子签章 - 移动端签批 获取移动端签章结果 (文件地址)
111
135
  var getSignFileFun = function getSignFileFun() {
112
136
  // uni.showLoading({ title: '加载中' })
113
137
 
114
138
  var params = {
115
139
  orderId: orderId
116
140
  };
117
- getSignFileApi(params).then(function (res) {
141
+ getSignFileApi(params, {
142
+ tokenTY: tokenTY,
143
+ baseUrl: baseUrl,
144
+ env: env,
145
+ isPC: isPC,
146
+ accessToken: accessToken
147
+ }).then(function (res) {
118
148
  if (!res) {
119
149
  return;
120
150
  }
@@ -7,22 +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, _x3) {
11
11
  return _initSealPageMethod.apply(this, arguments);
12
12
  }
13
13
 
14
- // [第1步] 查询当前用户是否有电子签章
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, config) {
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
21
  name = fileObj.name;
22
22
  console.log('fileObj', fileObj, userInfo);
23
- // 【第1步】判断当前用户是否有印章
23
+ // 【第 1 步】判断当前用户是否有印章
24
24
  _context.next = 1;
25
- return querySeal(userInfo);
25
+ return querySeal(userInfo, config);
26
26
  case 1:
27
27
  sealList = _context.sent;
28
28
  console.log('sealList---', sealList);
@@ -34,7 +34,7 @@ function _initSealPageMethod() {
34
34
  return _context.abrupt("return", false);
35
35
  case 2:
36
36
  _context.next = 3;
37
- return uploadSealFile(fileObj);
37
+ return uploadSealFile(fileObj, config);
38
38
  case 3:
39
39
  fileUrl = _context.sent;
40
40
  console.log('fileUrl---', fileUrl);
@@ -45,7 +45,7 @@ function _initSealPageMethod() {
45
45
  return _context.abrupt("return", false);
46
46
  case 4:
47
47
  _context.next = 5;
48
- return getSignOrderId(sealList, fileObj, fileUrl, userInfo);
48
+ return getSignOrderId(sealList, fileObj, fileUrl, userInfo, config);
49
49
  case 5:
50
50
  orderId = _context.sent;
51
51
  console.log('orderId---', orderId);
@@ -56,7 +56,7 @@ function _initSealPageMethod() {
56
56
  return _context.abrupt("return", false);
57
57
  case 6:
58
58
  _context.next = 7;
59
- return getMobilePageFun(orderId);
59
+ return getMobilePageFun(orderId, config);
60
60
  case 7:
61
61
  pageUrl = _context.sent;
62
62
  // 将 电子签章地址/文件名称 返回
@@ -74,7 +74,7 @@ function _initSealPageMethod() {
74
74
  }));
75
75
  return _initSealPageMethod.apply(this, arguments);
76
76
  }
77
- function querySeal(userInfo) {
77
+ function querySeal(userInfo, config) {
78
78
  console.log('querySeal', userInfo);
79
79
  // uni.showLoading({ title: '查询印章中' })
80
80
  var params = {
@@ -83,7 +83,7 @@ function querySeal(userInfo) {
83
83
  userIdType: '2'
84
84
  };
85
85
  return new Promise(function (resolve) {
86
- qrySealApi(params).then(function (res) {
86
+ qrySealApi(params, config).then(function (res) {
87
87
  if (res.data && res.data.length > 0) {
88
88
  resolve(res.data);
89
89
  } else {
@@ -97,12 +97,12 @@ function querySeal(userInfo) {
97
97
  });
98
98
  }
99
99
 
100
- // [第2步] 上传文件
101
- function uploadSealFile(_x3) {
100
+ // [第 2 步] 上传文件
101
+ function uploadSealFile(_x4, _x5) {
102
102
  return _uploadSealFile.apply(this, arguments);
103
- } // [第3步] 获取电子印章页面
103
+ } // [第 3 步] 获取电子印章页面
104
104
  function _uploadSealFile() {
105
- _uploadSealFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fileObj) {
105
+ _uploadSealFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fileObj, config) {
106
106
  var blob, file;
107
107
  return _regeneratorRuntime.wrap(function (_context2) {
108
108
  while (1) switch (_context2.prev = _context2.next) {
@@ -120,9 +120,9 @@ function _uploadSealFile() {
120
120
  filename: fileObj.name,
121
121
  // 文件名称
122
122
  headers: {
123
- Authorization: window.tokenTY
123
+ Authorization: config.tokenTY
124
124
  },
125
- action: window.baseUrl + "/declaration/center/sign/api/fileUploadApi",
125
+ action: config.baseUrl + "/declaration/center/sign/api/fileUploadApi",
126
126
  // 上传文件的地址
127
127
  onError: function onError(e) {
128
128
  // uni.$u.toast(e.msg || '上传文件异常');
@@ -144,7 +144,7 @@ function _uploadSealFile() {
144
144
  }));
145
145
  return _uploadSealFile.apply(this, arguments);
146
146
  }
147
- function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
147
+ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, config) {
148
148
  // uni.showLoading({ title: '获取签章页面中' })
149
149
  console.log('sealList', sealList, fileObj, esusFileUrl, userInfo);
150
150
  var fileId = fileObj.fileId,
@@ -154,9 +154,9 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
154
154
  sealList.forEach(function (sealItem, sealIndex) {
155
155
  apiSignDtosArr.push({
156
156
  deviceType: 3,
157
- // 签章类型(默认3)
157
+ // 签章类型 (默认 3)
158
158
  signType: 0,
159
- // 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
159
+ // 签章方式 (0 - 自由签章 or 定位签章 2 - 关键字签章 3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
160
160
  sealCode: sealItem.sealCode,
161
161
  // 印章编码
162
162
  signatories: [
@@ -165,7 +165,7 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
165
165
  pageIndex: sealIndex,
166
166
  // 签章所在页码
167
167
  x: 0.00,
168
- // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
168
+ // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf 磅,ofd 毫米
169
169
  y: 0.00 // 位置纵坐标
170
170
  }]
171
171
  });
@@ -179,48 +179,22 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
179
179
  // 2:身份证
180
180
  signFileReqs: [{
181
181
  file: esusFileUrl,
182
- // 签章文件(签章文件base64编码文件数据或者文件地址)
182
+ // 签章文件 (签章文件 base64 编码文件数据或者文件地址)
183
183
  fileType: '0',
184
- // 文件格式类型(0文件路径;1文件数据)
184
+ // 文件格式类型 (0 文件路径;1 文件数据)
185
185
  docType: '0',
186
186
  // 文件内容类型 (0 PDF;1 OFD)
187
187
  fileId: fileId,
188
- // 业务系统文件id (用于回传文件,不可重复)
188
+ // 业务系统文件 id (用于回传文件,不可重复)
189
189
  fileName: name,
190
- // 签章文件名称(文件名称包含文件格式,如a.pdf,b.ofd)
190
+ // 签章文件名称 (文件名称包含文件格式,如 a.pdf,b.ofd)
191
191
  apiSignDtos: apiSignDtosArr
192
- // apiSignDtos: [ // 签章信息列表(一次可以多个签章参数。每个参数选一个签章参数)
193
- // {
194
- // deviceType: 3, // 签章类型(默认3)
195
- // sealCode: '14110000000423', // 印章编码
196
- // signType: 0, // 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
197
- // signatories: [ // 定位签章参数
198
- // {
199
- // pageIndex: 0, // 签章所在页码
200
- // x: 0.00, // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
201
- // y: 0.00, // 位置纵坐标
202
- // }
203
- // ]
204
- // },
205
- // {
206
- // deviceType: 3, // 签章类型(默认3)
207
- // sealCode: '14110000000392', // 印章编码
208
- // signType: 0, // 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
209
- // signatories: [ // 定位签章参数
210
- // {
211
- // pageIndex: 0, // 签章所在页码
212
- // x: 0.00, // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
213
- // y: 0.00, // 位置纵坐标
214
- // }
215
- // ]
216
- // }
217
- // ]
218
192
  }]
219
193
  };
220
194
  console.log('params---', params);
221
195
  return new Promise(function (resolve) {
222
- console.log('获取签章订单id');
223
- getSignOrderIdApi(params).then(function (res) {
196
+ console.log('获取签章订单 id');
197
+ getSignOrderIdApi(params, config).then(function (res) {
224
198
  if (res) {
225
199
  var bigNumber = BigInt(res);
226
200
  resolve(bigNumber + '');
@@ -236,18 +210,18 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
236
210
  });
237
211
  }
238
212
 
239
- // [第4步-移动端] 获取电子印章页面
240
- function getMobilePageFun(orderId) {
213
+ // [第 4 步 - 移动端] 获取电子印章页面
214
+ function getMobilePageFun(orderId, config) {
241
215
  // uni.showLoading({ title: '获取移动端签章页面中' })
242
216
  var params = {
243
- accessToken: window.accessToken,
217
+ accessToken: config.accessToken,
244
218
  acctType: '20',
245
219
  orderId: orderId
246
220
  };
247
221
  return new Promise(function (resolve) {
248
- if (window.isPC) {
249
- getPcSealUrlApi(params).then(function (res) {
250
- console.log('签章页面pc----', res);
222
+ if (config.isPC) {
223
+ getPcSealUrlApi(params, config).then(function (res) {
224
+ console.log('签章页面 pc----', res);
251
225
  if (res.code === 200) {
252
226
  resolve(res.data);
253
227
  // uni.hideLoading()
@@ -260,7 +234,7 @@ function getMobilePageFun(orderId) {
260
234
  // uni.hideLoading()
261
235
  });
262
236
  } else {
263
- getSealUrlApi(params).then(function (res) {
237
+ getSealUrlApi(params, config).then(function (res) {
264
238
  if (res) {
265
239
  console.log(res, '移动端签章页面');
266
240
  resolve(res);