From e012c0827b045734a05047c9eb999cca5eb0b051 Mon Sep 17 00:00:00 2001 From: jianglong Date: Thu, 8 Jun 2023 15:53:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle/pages/resource_details/resource_details.vue | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/bundle/pages/resource_details/resource_details.vue b/bundle/pages/resource_details/resource_details.vue index 31b9917..accdd22 100644 --- a/bundle/pages/resource_details/resource_details.vue +++ b/bundle/pages/resource_details/resource_details.vue @@ -210,14 +210,29 @@ team_min_price url: this.resourceDetail.path, //仅为示例,并非真实的资源 success: (res) => { if (res.statusCode === 200) { + let files = res.tempFilePath; uni.saveFile({ - tempFilePath: res.tempFilePath, + tempFilePath: files, success: function (res2) { that.downloadLog(that.resourceDetail.id); var savedFilePath = res2.savedFilePath; - let msg = "文件存储到"+savedFilePath; - uni.showLoading({ - title: msg + // let msg = "文件存储到"+savedFilePath; + // uni.showLoading({ + // title: msg + // }); + uni.openDocument({ + filePath: savedFilePath, + showMenu: true, + success: function(res3) { + console.log(1111) + uni.hideLoading() + }, + fail: function(res3) { + console.log(res3) + uni.showLoading({ + title: "打开文件失败" + }); + } }); setTimeout(function () { uni.hideLoading()