fstarter 2.11.1 → 2.11.3
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/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import isp_phone from '../platform/isp_phone'
|
|
2
2
|
import { EBType, SHELL } from './callNative'
|
|
3
|
+
import nativeUtils from '../plugins/nativeUtils'
|
|
3
4
|
// import { FilePathPkg } from './filePath'
|
|
4
5
|
// import { callService } from '../../../assets/libs/service/serviceImpl'
|
|
5
6
|
// import SC from '../service/requestName'
|
|
@@ -15,6 +16,8 @@ import config from './config'
|
|
|
15
16
|
export const FileServerPkg = {}
|
|
16
17
|
export const EventGetFilename = 'getFileName'
|
|
17
18
|
export const EventGetMessage = 'getMessage'
|
|
19
|
+
export const EventGetPic = 'getPic'
|
|
20
|
+
export const EventGetIdCard = 'getIDcard'
|
|
18
21
|
|
|
19
22
|
// 文件服务器的地址
|
|
20
23
|
FileServerPkg.baseHost = config.file.baseURL
|
|
@@ -71,6 +74,8 @@ function handleShellCall(fileName, actions) {
|
|
|
71
74
|
} else {
|
|
72
75
|
console.log('注意!壳上传没有配置调用【保存服务】的服务;上传类型' + callerType)
|
|
73
76
|
// 直接发送事件,不调用服务
|
|
77
|
+
FileServerPkg.fnCaller.$emit(EventGetPic, {fileName,actions})
|
|
78
|
+
FileServerPkg.fnCaller.$emit(EventGetIdCard, {fileName,actions})
|
|
74
79
|
if (fileName) FileServerPkg.fnCaller.$emit(EventGetFilename, fileName)
|
|
75
80
|
if (actions) FileServerPkg.fnCaller.$emit(EventGetMessage, actions)
|
|
76
81
|
if (FileServerPkg.callerStateSetFn) FileServerPkg.callerStateSetFn(fileName) // 设置状态值
|
|
@@ -295,7 +300,21 @@ FileServerPkg.pictureUploadSaveShow = function(uploadType, eventSender, callerPa
|
|
|
295
300
|
const shellParam = setShellParam(shellType, callerParam.shell, callerParam.maxSizeKB)
|
|
296
301
|
FileServerPkg.callerServiceParamFn = setServiceParamFn(uploadType, callerParam.service, isCallService)
|
|
297
302
|
FileServerPkg.callerStateSetFn = getStateSetFn(uploadType, callerParam.state)
|
|
298
|
-
|
|
303
|
+
nativeUtils.takePicture({
|
|
304
|
+
maxCount: 1, // 最多可选择的图片数量, 默认为9
|
|
305
|
+
maxSize: 500, // 图片大小限制,单位为KB
|
|
306
|
+
sourceType: ['album'], // 可选来源类型,'album' 为相册,'camera' 为相机 默认两者都有
|
|
307
|
+
sceneDesc: '选择图片上传', // 场景描述
|
|
308
|
+
actions: shellParam.actions,
|
|
309
|
+
domain: 'INDUCTION',
|
|
310
|
+
buz: 'PICTURE',
|
|
311
|
+
buzId: '111'
|
|
312
|
+
}).then(res => {
|
|
313
|
+
handleShellCall(res.fileId + '.' + res.ext, res.actions)
|
|
314
|
+
// FileServerPkg.fnCaller.$emit(EventGetFilename, res.fileId + '.' + res.ext)
|
|
315
|
+
// if (actions) FileServerPkg.fnCaller.$emit(EventGetMessage, actions)
|
|
316
|
+
})
|
|
317
|
+
// isp_phone.callShell(TypeShellMapping[shellType], shellParam, null, eventSender)
|
|
299
318
|
}
|
|
300
319
|
|
|
301
320
|
/* *************************************************************************
|
|
@@ -339,7 +358,7 @@ function setShellParam(uploadType, param, maxSizeKB, count) {
|
|
|
339
358
|
function setServiceParamFn(uploadType, param, isCallService) {
|
|
340
359
|
if (isCallService) {
|
|
341
360
|
const shellType = UType2Shell[uploadType]
|
|
342
|
-
|
|
361
|
+
|
|
343
362
|
if (param) {
|
|
344
363
|
// 如果是影像件上传服务的入参(默认是电投)
|
|
345
364
|
return function(fileName) {
|
|
@@ -379,7 +398,7 @@ function setServiceParamFn(uploadType, param, isCallService) {
|
|
|
379
398
|
|
|
380
399
|
// state保存返回的是一个可执行的函数,传入filename即可
|
|
381
400
|
function getStateSetFn(uploadType, param) {
|
|
382
|
-
|
|
401
|
+
|
|
383
402
|
if (param) {
|
|
384
403
|
const stateParams = param.personKey ? [param.personKey] : []
|
|
385
404
|
if (UType2State[uploadType] && UType2State[uploadType].save) {
|
|
@@ -956,15 +956,6 @@ nFqBB1zM586NpO+4hua/1Ol5OiqoQJ4iQinyDiA=
|
|
|
956
956
|
for (let i = 0; i < base64Files.length; i++) {
|
|
957
957
|
const element = base64Files[i];
|
|
958
958
|
|
|
959
|
-
// 需要上传时显示进度提示
|
|
960
|
-
if (params.isUpload) {
|
|
961
|
-
Toast.loading({
|
|
962
|
-
forbidClick: true,
|
|
963
|
-
message: `选择了${base64Files.length}张图片,正在上传第${i+1}张`,
|
|
964
|
-
duration: 0, // 持续展示 toast
|
|
965
|
-
});
|
|
966
|
-
}
|
|
967
|
-
|
|
968
959
|
try {
|
|
969
960
|
console.log(isCropper, '--------------是否需要裁剪---------');
|
|
970
961
|
|
|
@@ -989,6 +980,23 @@ nFqBB1zM586NpO+4hua/1Ol5OiqoQJ4iQinyDiA=
|
|
|
989
980
|
continue; // 继续处理下一张图片
|
|
990
981
|
}
|
|
991
982
|
|
|
983
|
+
// 需要上传时显示进度提示
|
|
984
|
+
if (params.isUpload) {
|
|
985
|
+
if(base64Files.length>1){
|
|
986
|
+
Toast.loading({
|
|
987
|
+
forbidClick: true,
|
|
988
|
+
message: `选择了${base64Files.length}张图片,正在上传第${i+1}张`,
|
|
989
|
+
duration: 0,
|
|
990
|
+
});
|
|
991
|
+
} else {
|
|
992
|
+
Toast.loading({
|
|
993
|
+
forbidClick: true,
|
|
994
|
+
message: '上传中...',
|
|
995
|
+
duration: 0,
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
992
1000
|
// 3. 需要上传:转换为文件并上传
|
|
993
1001
|
const file = await nativeUtils.base64ToFile(element.imageBase64, 'image.png');
|
|
994
1002
|
const result = await nativeUtils.uploadFile(
|