uni.downloadFile({ url: item.url, success: (res) => { if (res.statusCode === 200) { uni.openDocument({ filePath: res.tempFilePath, // 如果文件名包含中文,建議使用escape(res.tempFilePath)轉碼,防止ios和安卓客戶端導致的差異 success: function(res) { console.log('打開文檔成功'); } }); } } });
