Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ripplebb
uni-app
提交
90365087
U
uni-app
项目概览
ripplebb
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
90365087
编写于
3月 26, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build: v3
上级
4d054896
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
147 addition
and
52 deletion
+147
-52
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+147
-52
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
90365087
...
...
@@ -63,8 +63,10 @@ var serviceContext = (function () {
'chooseFile',
'previewImage',
'getImageInfo',
'getVideoInfo',
'saveImageToPhotosAlbum',
'compressImage',
'compressVideo',
'getRecorderManager',
'getBackgroundAudioManager',
'createAudioContext',
...
...
@@ -1003,7 +1005,6 @@ var serviceContext = (function () {
quality: {
type: Number,
validator (value, params) {
value = Math.floor(value);
params.quality = value > 0 && value < 1 ? value : 1;
}
}
...
...
@@ -1893,6 +1894,10 @@ var serviceContext = (function () {
params.sourceType = sourceType.length ? sourceType : SOURCE_TYPES$2;
}
},
compressed: {
type: Boolean,
default: true
},
maxDuration: {
type: Number,
default: 60
...
...
@@ -1930,21 +1935,63 @@ var serviceContext = (function () {
compressImage: compressImage
});
const
getImageInf
o = {
const
compressVide
o = {
src: {
type: String,
required: true,
validator (src, params) {
params.src = getRealPath(src);
}
},
quality: {
type: String
},
bitrate: {
type: Number
},
fps: {
type: Number
},
resolution: {
type: Number
}
};
var require_context_module_0_19 = /*#__PURE__*/Object.freeze({
__proto__: null,
compressVideo: compressVideo
});
const getImageInfo = {
src: {
type: String,
required: true,
validator (src, params) {
params.src = getRealPath(src);
}
}
};
var require_context_module_0_20 = /*#__PURE__*/Object.freeze({
__proto__: null,
getImageInfo: getImageInfo
});
const getVideoInfo = {
src: {
type: String,
required: true,
validator (src, params) {
params.src = getRealPath(src);
}
}
};
var require_context_module_0_21 = /*#__PURE__*/Object.freeze({
__proto__: null,
getVideoInfo: getVideoInfo
});
const previewImage = {
urls: {
type: Array,
...
...
@@ -1976,7 +2023,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_2
0
= /*#__PURE__*/Object.freeze({
var require_context_module_0_2
2
= /*#__PURE__*/Object.freeze({
__proto__: null,
previewImage: previewImage
});
...
...
@@ -1991,7 +2038,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_2
1
= /*#__PURE__*/Object.freeze({
var require_context_module_0_2
3
= /*#__PURE__*/Object.freeze({
__proto__: null,
saveImageToPhotosAlbum: saveImageToPhotosAlbum
});
...
...
@@ -2009,7 +2056,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_2
2
= /*#__PURE__*/Object.freeze({
var require_context_module_0_2
4
= /*#__PURE__*/Object.freeze({
__proto__: null,
downloadFile: downloadFile
});
...
...
@@ -2120,7 +2167,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_2
3
= /*#__PURE__*/Object.freeze({
var require_context_module_0_2
5
= /*#__PURE__*/Object.freeze({
__proto__: null,
request: request
});
...
...
@@ -2178,7 +2225,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_2
4
= /*#__PURE__*/Object.freeze({
var require_context_module_0_2
6
= /*#__PURE__*/Object.freeze({
__proto__: null,
connectSocket: connectSocket,
sendSocketMessage: sendSocketMessage,
...
...
@@ -2220,7 +2267,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_2
5
= /*#__PURE__*/Object.freeze({
var require_context_module_0_2
7
= /*#__PURE__*/Object.freeze({
__proto__: null,
uploadFile: uploadFile
});
...
...
@@ -2245,7 +2292,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_2
6
= /*#__PURE__*/Object.freeze({
var require_context_module_0_2
8
= /*#__PURE__*/Object.freeze({
__proto__: null,
getProvider: getProvider
});
...
...
@@ -2266,7 +2313,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_2
7
= /*#__PURE__*/Object.freeze({
var require_context_module_0_2
9
= /*#__PURE__*/Object.freeze({
__proto__: null,
loadSubPackage: loadSubPackage
});
...
...
@@ -2288,7 +2335,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_
28
= /*#__PURE__*/Object.freeze({
var require_context_module_0_
30
= /*#__PURE__*/Object.freeze({
__proto__: null,
preLogin: preLogin
});
...
...
@@ -2489,7 +2536,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_
29
= /*#__PURE__*/Object.freeze({
var require_context_module_0_
31
= /*#__PURE__*/Object.freeze({
__proto__: null,
redirectTo: redirectTo,
reLaunch: reLaunch,
...
...
@@ -2535,7 +2582,7 @@ var serviceContext = (function () {
const removeStorage = getStorage;
const removeStorageSync = getStorageSync;
var require_context_module_0_3
0
= /*#__PURE__*/Object.freeze({
var require_context_module_0_3
2
= /*#__PURE__*/Object.freeze({
__proto__: null,
getStorage: getStorage,
getStorageSync: getStorageSync,
...
...
@@ -2572,7 +2619,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_3
1
= /*#__PURE__*/Object.freeze({
var require_context_module_0_3
3
= /*#__PURE__*/Object.freeze({
__proto__: null,
loadFontFace: loadFontFace
});
...
...
@@ -2615,7 +2662,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_3
2
= /*#__PURE__*/Object.freeze({
var require_context_module_0_3
4
= /*#__PURE__*/Object.freeze({
__proto__: null,
setNavigationBarColor: setNavigationBarColor,
setNavigationBarTitle: setNavigationBarTitle
...
...
@@ -2635,7 +2682,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_3
3
= /*#__PURE__*/Object.freeze({
var require_context_module_0_3
5
= /*#__PURE__*/Object.freeze({
__proto__: null,
pageScrollTo: pageScrollTo
});
...
...
@@ -2760,7 +2807,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_3
4
= /*#__PURE__*/Object.freeze({
var require_context_module_0_3
6
= /*#__PURE__*/Object.freeze({
__proto__: null,
showModal: showModal,
showToast: showToast,
...
...
@@ -2859,7 +2906,7 @@ var serviceContext = (function () {
}
};
var require_context_module_0_3
5
= /*#__PURE__*/Object.freeze({
var require_context_module_0_3
7
= /*#__PURE__*/Object.freeze({
__proto__: null,
setTabBarItem: setTabBarItem,
setTabBarStyle: setTabBarStyle,
...
...
@@ -2894,23 +2941,25 @@ var serviceContext = (function () {
'./media/choose-image.js': require_context_module_0_16,
'./media/choose-video.js': require_context_module_0_17,
'./media/compress-image.js': require_context_module_0_18,
'./media/get-image-info.js': require_context_module_0_19,
'./media/preview-image.js': require_context_module_0_20,
'./media/save-image-to-photos-album.js': require_context_module_0_21,
'./network/download-file.js': require_context_module_0_22,
'./network/request.js': require_context_module_0_23,
'./network/socket.js': require_context_module_0_24,
'./network/upload-file.js': require_context_module_0_25,
'./plugin/get-provider.js': require_context_module_0_26,
'./plugin/load-sub-package.js': require_context_module_0_27,
'./plugin/pre-login.js': require_context_module_0_28,
'./route/route.js': require_context_module_0_29,
'./storage/storage.js': require_context_module_0_30,
'./ui/load-font-face.js': require_context_module_0_31,
'./ui/navigation-bar.js': require_context_module_0_32,
'./ui/page-scroll-to.js': require_context_module_0_33,
'./ui/popup.js': require_context_module_0_34,
'./ui/tab-bar.js': require_context_module_0_35,
'./media/compress-video.js': require_context_module_0_19,
'./media/get-image-info.js': require_context_module_0_20,
'./media/get-video-info.js': require_context_module_0_21,
'./media/preview-image.js': require_context_module_0_22,
'./media/save-image-to-photos-album.js': require_context_module_0_23,
'./network/download-file.js': require_context_module_0_24,
'./network/request.js': require_context_module_0_25,
'./network/socket.js': require_context_module_0_26,
'./network/upload-file.js': require_context_module_0_27,
'./plugin/get-provider.js': require_context_module_0_28,
'./plugin/load-sub-package.js': require_context_module_0_29,
'./plugin/pre-login.js': require_context_module_0_30,
'./route/route.js': require_context_module_0_31,
'./storage/storage.js': require_context_module_0_32,
'./ui/load-font-face.js': require_context_module_0_33,
'./ui/navigation-bar.js': require_context_module_0_34,
'./ui/page-scroll-to.js': require_context_module_0_35,
'./ui/popup.js': require_context_module_0_36,
'./ui/tab-bar.js': require_context_module_0_37,
};
var req = function req(key) {
...
...
@@ -3949,7 +3998,7 @@ var serviceContext = (function () {
}
}
function warpPlusMethod (module, name, before) {
function warpPlusMethod (module, name, before
, after
) {
return function (options, callbackId) {
if (typeof before === 'function') {
options = before(options);
...
...
@@ -3958,6 +4007,9 @@ var serviceContext = (function () {
success (data = {}) {
delete data.code;
delete data.message;
if (typeof after === 'function') {
data = after(data);
}
invoke$1(callbackId, Object.assign({}, data, {
errMsg: `${name}:ok`
}));
...
...
@@ -6685,26 +6737,45 @@ var serviceContext = (function () {
function chooseVideo$1 ({
sourceType,
compressed,
maxDuration,
camera
} = {}, callbackId) {
const errorCallback = warpPlusErrorCallback(callbackId, 'chooseVideo', 'cancel');
function successCallback (tempFilePath = '') {
plus.io.getVideoInfo({
filePath: tempFilePath,
success (videoInfo) {
const result = {
errMsg: 'chooseVideo:ok',
tempFilePath: tempFilePath
};
result.size = videoInfo.size;
result.duration = videoInfo.duration;
result.width = videoInfo.width;
result.height = videoInfo.height;
invoke$1(callbackId, result);
},
errorCallback
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(tempFilePath)}`;
const compressVideo = compressed ? plus.zip.compressVideo : function (_, callback) {
callback({ tempFilePath });
};
if (compressed) {
plus.nativeUI.showWaiting();
}
compressVideo({
src: tempFilePath,
dst
}, ({ tempFilePath }) => {
if (compressed) {
plus.nativeUI.closeWaiting();
}
plus.io.getVideoInfo({
filePath: tempFilePath,
success (videoInfo) {
const result = {
errMsg: 'chooseVideo:ok',
tempFilePath: tempFilePath
};
result.size = videoInfo.size;
result.duration = videoInfo.duration;
result.width = videoInfo.width;
result.height = videoInfo.height;
invoke$1(callbackId, result);
},
errorCallback
});
}, error => {
plus.nativeUI.closeWaiting();
errorCallback(error);
});
}
...
...
@@ -6773,11 +6844,33 @@ var serviceContext = (function () {
}, errorCallback);
}
function compressVideo$1 (options, callbackId) {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`;
const successCallback = warpPlusSuccessCallback(callbackId, 'compressVideo');
const errorCallback = warpPlusErrorCallback(callbackId, 'compressVideo');
plus.zip.compressVideo(Object.assign({}, options, {
dst
}), successCallback, errorCallback);
}
const getImageInfo$1 = warpPlusMethod('io', 'getImageInfo', options => {
options.savePath = options.filename = TEMP_PATH + '/download/';
return options
});
const getVideoInfo$1 = warpPlusMethod('io', 'getVideoInfo', options => {
options.filePath = options.src;
return options
}, data => {
return {
duration: data.duration,
fps: data.fps || 30,
height: data.height,
width: data.width,
size: data.size
}
});
function previewImagePlus ({
current = 0,
background = '#000000',
...
...
@@ -10828,7 +10921,9 @@ var serviceContext = (function () {
chooseImage: chooseImage$1,
chooseVideo: chooseVideo$1,
compressImage: compressImage$2,
compressVideo: compressVideo$1,
getImageInfo: getImageInfo$1,
getVideoInfo: getVideoInfo$1,
previewImagePlus: previewImagePlus,
operateRecorder: operateRecorder,
saveImageToPhotosAlbum: saveImageToPhotosAlbum$1,
...
...
@@ -18752,7 +18847,7 @@ var serviceContext = (function () {
destHeight,
canvasId,
fileType,
qualit
qualit
y
}, callbackId) {
var pageId = getCurrentPageId();
if (!pageId) {
...
...
@@ -18773,7 +18868,7 @@ var serviceContext = (function () {
destWidth,
destHeight,
fileType,
qualit,
qualit
y
,
dirname,
callbackId: cId
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录