diff --git a/pages_order/work/postConsult.vue b/pages_order/work/postConsult.vue index 2d10ada..a5ef99e 100644 --- a/pages_order/work/postConsult.vue +++ b/pages_order/work/postConsult.vue @@ -151,38 +151,20 @@ url: template, success: (res) => { if (res.statusCode === 200) { - uni.saveFile({ - tempFilePath: res.tempFilePath, - success: (saveRes) => { - uni.showToast({ - title: '下载成功', - icon: 'success' - }) - // 保存成功后直接打开文件 - setTimeout(() => { - uni.openDocument({ - filePath: saveRes.savedFilePath, - success: () => { - console.log('文件打开成功') - }, - fail: (err) => { - console.log('文件打开失败', err) - uni.showToast({ - title: '文件已保存,请在文件管理器中查看', - icon: 'none', - duration: 3000 - }) - } - }) - }, 1000) - }, - fail: () => { - uni.showToast({ - title: '保存失败', - icon: 'none' - }) - } - }) + uni.openDocument({ + filePath: res.tempFilePath, + success: () => { + console.log('文件打开成功') + }, + fail: (err) => { + console.log('文件打开失败', err) + uni.showToast({ + title: '文件已保存,请在文件管理器中查看', + icon: 'none', + duration: 3000 + }) + } + }) } }, fail: () => {