//#ifdef H5 const BASEURL = '' //#endif //#ifndef H5 // const BASEURL = getApp().globalData.url //#endif function previepdf(url,ext) { uni.showLoading({ title: '加载中' }); uni.downloadFile({ url: url, success(res) { let path = res.tempFilePath; uni.openDocument({ filePath: path, fileType: ext, success() { uni.hideLoading(); }, fail() { uni.hideLoading(); } }); } }); } module.exports = { previepdf };