|
@@ -95,6 +95,7 @@ function viewFlies(item) {
|
|
|
}
|
|
|
|
|
|
function wxSaveFile(file) {
|
|
|
+ if (file.fileType == undefined) file = formattedFiles([file])[0]
|
|
|
const fs = uni.getFileSystemManager(),
|
|
|
basePath = String(`${uni.env.USER_DATA_PATH}/${file.postfix}`);
|
|
|
fs.access({
|
|
@@ -124,7 +125,6 @@ function wxSaveFile(file) {
|
|
|
filePath: basePath + '/' + file.document,
|
|
|
timeout: 6000000,
|
|
|
success(res) {
|
|
|
- console.log("下载文件", res)
|
|
|
if (file.fileType == "video") {
|
|
|
saveVideo(res.filePath)
|
|
|
} else {
|
|
@@ -186,7 +186,7 @@ function wxSaveFile(file) {
|
|
|
} else {
|
|
|
clearFile(filePath)
|
|
|
uni.showToast({
|
|
|
- title: err,
|
|
|
+ title: err.errMsg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
}
|
|
@@ -195,10 +195,11 @@ function wxSaveFile(file) {
|
|
|
}
|
|
|
|
|
|
function saveVideo(filePath) {
|
|
|
+ console.log('saveVideo', filePath)
|
|
|
uni.saveVideoToPhotosAlbum({
|
|
|
filePath,
|
|
|
success(res) {
|
|
|
- console.log("保存商品", res)
|
|
|
+ console.log("保存视频", res)
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '视频已保存到系统相册',
|
|
@@ -235,7 +236,7 @@ function wxSaveFile(file) {
|
|
|
} else {
|
|
|
clearFile(filePath)
|
|
|
uni.showToast({
|
|
|
- title: err,
|
|
|
+ title: err.errMsg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
}
|