This commit is contained in:
wenjiarui 2023-08-14 15:00:52 +08:00
parent 5c34473094
commit b2ae028203
1 changed files with 11 additions and 6 deletions

View File

@ -489,7 +489,7 @@ exports.default = OakComponent({
name = this.features.extraFile.getFileName(value);
that = this;
wx.showLoading({
title: '下载请求中,请耐心等待..',
title: '下载请求中...',
});
wx.downloadFile({
url: fileUrl,
@ -499,7 +499,6 @@ exports.default = OakComponent({
fs.saveFile({
tempFilePath: filePath,
success: function (res) {
// console.log(res, '下载成功');
wx.hideLoading();
var savedFilePath = res.savedFilePath;
// 打开文件
@ -510,16 +509,22 @@ exports.default = OakComponent({
// console.log('打开文档成功');
},
fail: function (res) {
console.log(res, 'openDocument');
var errMsg = res.errMsg;
if (errMsg.includes('fail filetype not supported')) {
that.setMessage({
type: 'error',
content: '该文件类型不支持打开',
});
return;
}
that.setMessage({
type: 'error',
content: '打开文档失败',
content: '该文件类型打开失败',
});
},
});
},
fail: function (res) {
console.log(res, 'saveFile');
wx.hideLoading();
that.setMessage({
type: 'error',
@ -587,7 +592,7 @@ exports.default = OakComponent({
if (errMsg.includes('fail filetype not supported')) {
that.setMessage({
type: 'error',
content: '该文件类型不支持打开下载',
content: '该文件类型不支持打开',
});
return;
}