Browse Source

附件名称

xiaohaizhao 3 months ago
parent
commit
aa8bc915f1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packageA/market/detail.js

+ 3 - 1
packageA/market/detail.js

@@ -178,8 +178,10 @@ Page({
 		})
 		wx.downloadFile({
 			url: item.url,
+			filePath: wx.env.USER_DATA_PATH + '/' + item.document, // 本地自定义的文件名
 			success: function (res) {
-				const filePath = res.tempFilePath
+				console.log(res)
+				const filePath = res.tempFilePath || res.filePath
 				wx.openDocument({
 					filePath: filePath,
 					showMenu: true,