You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

38 lines
529 B

//#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
};