Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qianlong66
uni-app
提交
66aed678
U
uni-app
项目概览
qianlong66
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
66aed678
编写于
9月 17, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build app
上级
e06a7021
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
61 addition
and
80 deletion
+61
-80
packages/uni-app-plus/dist/style.css
packages/uni-app-plus/dist/style.css
+1
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+59
-78
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+1
-1
未找到文件。
packages/uni-app-plus/dist/style.css
浏览文件 @
66aed678
此差异已折叠。
点击以展开。
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
66aed678
...
@@ -5076,6 +5076,22 @@ var serviceContext = (function (vue) {
...
@@ -5076,6 +5076,22 @@ var serviceContext = (function (vue) {
}
}
},
},
},
},
};
const API_CONFIG_MTLS = 'configMTLS';
const ConfigMTLSProtocol = {
certificates: {
type: Array,
required: true,
},
};
const ConfigMTLSOptions = {
formatArgs: {
certificates(value) {
if (value.some((item) => toRawType(item.host) !== 'String')) {
return '参数配置错误,请确认后重试';
}
},
},
};
};
const API_DOWNLOAD_FILE = 'downloadFile';
const API_DOWNLOAD_FILE = 'downloadFile';
...
@@ -7451,7 +7467,7 @@ var serviceContext = (function (vue) {
...
@@ -7451,7 +7467,7 @@ var serviceContext = (function (vue) {
plus.gallery.save(options.filePath, warpPlusSuccessCallback(resolve), warpPlusErrorCallback(reject));
plus.gallery.save(options.filePath, warpPlusSuccessCallback(resolve), warpPlusErrorCallback(reject));
}, SaveImageToPhotosAlbumProtocol, SaveImageToPhotosAlbumOptions);
}, SaveImageToPhotosAlbumProtocol, SaveImageToPhotosAlbumOptions);
const compressImage
$1
= defineAsyncApi(API_COMPRESS_IMAGE, (options, { resolve, reject }) => {
const compressImage = defineAsyncApi(API_COMPRESS_IMAGE, (options, { resolve, reject }) => {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`;
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`;
plus.zip.compressImage(extend({}, options, {
plus.zip.compressImage(extend({}, options, {
dst,
dst,
...
@@ -7485,25 +7501,8 @@ var serviceContext = (function (vue) {
...
@@ -7485,25 +7501,8 @@ var serviceContext = (function (vue) {
}, reject);
}, reject);
});
});
}
}
function compressImage(tempFilePath) {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(tempFilePath)}`;
return new Promise((resolve) => {
plus.nativeUI.showWaiting();
plus.zip.compressImage({
src: tempFilePath,
dst,
overwrite: true,
}, () => {
plus.nativeUI.closeWaiting();
resolve(dst);
}, () => {
plus.nativeUI.closeWaiting();
resolve(tempFilePath);
});
});
}
const chooseImage = defineAsyncApi(API_CHOOSE_IMAGE,
const chooseImage = defineAsyncApi(API_CHOOSE_IMAGE,
// @ts-
ignore
crop 属性App特有
// @ts-
expect-error
crop 属性App特有
({ count, sizeType, sourceType, crop } = {}, { resolve, reject }) => {
({ count, sizeType, sourceType, crop } = {}, { resolve, reject }) => {
initI18nChooseImageMsgsOnce();
initI18nChooseImageMsgsOnce();
const { t } = useI18n();
const { t } = useI18n();
...
@@ -7527,30 +7526,16 @@ var serviceContext = (function (vue) {
...
@@ -7527,30 +7526,16 @@ var serviceContext = (function (vue) {
}
}
function openCamera() {
function openCamera() {
const camera = plus.camera.getCamera();
const camera = plus.camera.getCamera();
camera.captureImage((path) => {
camera.captureImage((path) => successCallback([path]), errorCallback, {
// fix By Lxh 暂时添加拍照压缩逻辑,等客户端增加逻辑后修改
// 判断是否需要压缩
if (sizeType && sizeType.includes('compressed')) {
return getFileInfo(path)
.then(({ size }) => {
// 压缩阈值 0.5 兆
const THRESHOLD = 1024 * 1024 * 0.5;
return size && size > THRESHOLD
? compressImage(path).then((dstPath) => successCallback([dstPath]))
: successCallback([path]);
})
.catch(errorCallback);
}
return successCallback([path]);
}, errorCallback, {
filename: TEMP_PATH + '/camera/',
filename: TEMP_PATH + '/camera/',
resolution: 'high',
resolution: 'high',
crop,
crop,
// @ts-expect-error
sizeType,
});
});
}
}
function openAlbum() {
function openAlbum() {
// NOTE 5+此API分单选和多选,多选返回files:string[]
// @ts-ignore 5+此API分单选和多选,多选返回files:string[]
// @ts-ignore
plus.gallery.pick(({ files }) => successCallback(files), errorCallback, {
plus.gallery.pick(({ files }) => successCallback(files), errorCallback, {
maximum: count,
maximum: count,
multiple: true,
multiple: true,
...
@@ -7601,49 +7586,27 @@ var serviceContext = (function (vue) {
...
@@ -7601,49 +7586,27 @@ var serviceContext = (function (vue) {
initI18nChooseVideoMsgsOnce();
initI18nChooseVideoMsgsOnce();
const { t } = useI18n();
const { t } = useI18n();
const errorCallback = warpPlusErrorCallback(reject);
const errorCallback = warpPlusErrorCallback(reject);
function successCallback(tempFilePath = '') {
function successCallback(tempFilePath) {
const filename = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(tempFilePath)}`;
plus.io.getVideoInfo({
const compressVideo = compressed
filePath: tempFilePath,
? new Promise((resolve) => {
success(videoInfo) {
plus.zip.compressVideo({
const result = {
src: tempFilePath,
errMsg: 'chooseVideo:ok',
filename,
tempFilePath: tempFilePath,
quality: 'medium',
size: videoInfo.size,
}, ({ tempFilePath }) => {
duration: videoInfo.duration,
resolve(tempFilePath);
width: videoInfo.width,
}, () => {
height: videoInfo.height,
resolve(tempFilePath);
};
});
// @ts-expect-error tempFile、name 仅H5支持
})
resolve(result);
: Promise.resolve(tempFilePath);
},
if (compressed) {
fail: errorCallback,
plus.nativeUI.showWaiting();
}
compressVideo.then((tempFilePath) => {
if (compressed) {
plus.nativeUI.closeWaiting();
}
plus.io.getVideoInfo({
filePath: tempFilePath,
success(videoInfo) {
const result = {
errMsg: 'chooseVideo:ok',
tempFilePath: tempFilePath,
size: videoInfo.size,
duration: videoInfo.duration,
width: videoInfo.width,
height: videoInfo.height,
};
resolve(result);
},
fail: errorCallback,
});
});
});
}
}
function openAlbum() {
function openAlbum() {
plus.gallery.pick(
plus.gallery.pick(
// NOTE 5+此API分单选和多选,多选返回files:string[]
// @ts-ignore 5+此API分单选和多选,多选返回files:string[]
// @ts-ignore
({ files }) => successCallback(files[0]), errorCallback, {
({ files }) => successCallback(files[0]), errorCallback, {
filter: 'video',
filter: 'video',
system: false,
system: false,
...
@@ -7652,6 +7615,8 @@ var serviceContext = (function (vue) {
...
@@ -7652,6 +7615,8 @@ var serviceContext = (function (vue) {
maximum: 1,
maximum: 1,
filename: TEMP_PATH + '/gallery/',
filename: TEMP_PATH + '/gallery/',
permissionAlert: true,
permissionAlert: true,
// @ts-expect-error 新增参数,用于视频压缩
videoCompress: compressed,
});
});
}
}
function openCamera() {
function openCamera() {
...
@@ -7660,6 +7625,8 @@ var serviceContext = (function (vue) {
...
@@ -7660,6 +7625,8 @@ var serviceContext = (function (vue) {
index: camera === 'front' ? '2' : '1',
index: camera === 'front' ? '2' : '1',
videoMaximumDuration: maxDuration,
videoMaximumDuration: maxDuration,
filename: TEMP_PATH + '/camera/',
filename: TEMP_PATH + '/camera/',
// @ts-expect-error 新增参数,用于视频压缩
videoCompress: compressed,
});
});
}
}
if (sourceType.length === 1) {
if (sourceType.length === 1) {
...
@@ -7950,7 +7917,20 @@ var serviceContext = (function (vue) {
...
@@ -7950,7 +7917,20 @@ var serviceContext = (function (vue) {
reject('abort');
reject('abort');
},
},
});
});
}, RequestProtocol, RequestOptions);
}, RequestProtocol, RequestOptions);
const configMTLS = defineAsyncApi(API_CONFIG_MTLS, ({ certificates }, { resolve, reject }) => {
const stream = requireNativePlugin('stream');
stream.configMTLS(certificates, ({ type, code, message }) => {
switch (type) {
case 'success':
resolve({ code });
break;
case 'fail':
reject(message, { code });
break;
}
});
}, ConfigMTLSProtocol, ConfigMTLSOptions);
const socketTasks = [];
const socketTasks = [];
const socketsMap = {};
const socketsMap = {};
...
@@ -12675,7 +12655,7 @@ var serviceContext = (function (vue) {
...
@@ -12675,7 +12655,7 @@ var serviceContext = (function (vue) {
getRecorderManager: getRecorderManager,
getRecorderManager: getRecorderManager,
saveVideoToPhotosAlbum: saveVideoToPhotosAlbum,
saveVideoToPhotosAlbum: saveVideoToPhotosAlbum,
saveImageToPhotosAlbum: saveImageToPhotosAlbum,
saveImageToPhotosAlbum: saveImageToPhotosAlbum,
compressImage: compressImage
$1
,
compressImage: compressImage,
compressVideo: compressVideo,
compressVideo: compressVideo,
chooseImage: chooseImage,
chooseImage: chooseImage,
chooseVideo: chooseVideo,
chooseVideo: chooseVideo,
...
@@ -12685,6 +12665,7 @@ var serviceContext = (function (vue) {
...
@@ -12685,6 +12665,7 @@ var serviceContext = (function (vue) {
offKeyboardHeightChange: offKeyboardHeightChange,
offKeyboardHeightChange: offKeyboardHeightChange,
downloadFile: downloadFile,
downloadFile: downloadFile,
request: request,
request: request,
configMTLS: configMTLS,
connectSocket: connectSocket,
connectSocket: connectSocket,
sendSocketMessage: sendSocketMessage,
sendSocketMessage: sendSocketMessage,
closeSocket: closeSocket,
closeSocket: closeSocket,
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
66aed678
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录