diff --git a/pages_order/work/postConsult.vue b/pages_order/work/postConsult.vue index 190ce01..2d10ada 100644 --- a/pages_order/work/postConsult.vue +++ b/pages_order/work/postConsult.vue @@ -153,11 +153,28 @@ if (res.statusCode === 200) { uni.saveFile({ tempFilePath: res.tempFilePath, - success: () => { + 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({