兼容Android,ios
previewPdf () {
const that = this
let url = that.url.replace(/http:/, 'https:')
uni.showLoading({
title: '加载中'
});
wx.downloadFile({
url,
success: ({ tempFilePath: filePath }) => {
wx.openDocument({
filePath,
fail: (err) => {
console.log('这是打开报错值:' + err)
},
complete: () => {
uni.hideLoading()
}
})
},
fail: (err) => {
console.log('这是请求报错:', err)
uni.hideLoading()
}
})
},
},