src/common/utils/util.js
@@ -838,5 +838,30 @@ } } }, checkFileExtensions(str) { const extensions = ['pdf', 'doc', 'docx', 'xls', 'xlsx']; return extensions.some(extension => str.includes(extension)); }, previewWechat(urlPdf) { uni.showLoading({ title: '正在加载中..' }) uni.downloadFile({ url: urlPdf, success: function(res) { var filePath = res.tempFilePath; uni.openDocument({ filePath: filePath, showMenu: true, success: function(res) { console.log('打开文档成功'); uni.hideLoading() }, }); }, complete: function(r) { uni.hideLoading() } }); }, }