Commit b93fcc70 authored by xinzhedeai's avatar xinzhedeai

fix: ios 访问pdf地址判断区分处理

parent efa2150e
......@@ -315,6 +315,18 @@ gemhoUtil.downloadFile = function (url) {
})
}
gemhoUtil.isIOSStrict = function() {
const ua = navigator.userAgent.toLowerCase();
const platform = navigator.platform.toLowerCase();
return (
(/iphone|ipad|ipod/.test(ua) || /iphone|ipad|ipod/.test(platform)) &&
!/android/.test(ua) &&
!window.MSStream
);
}
// aes解密
function aes_Decrypt(word, key) {
var key = CryptoJS.enc.Utf8.parse(key) //转为128bit
......
......@@ -147,7 +147,19 @@ window.addEventListener("load", function () {
})
},
async previewFile(pdfUrl1) {
async previewFile() {
if(!this.detailInfo.file){
alert('附件地址不存在');
return
}
if(gemhoUtil.isIOSStrict()){ // 如果是苹果手机,预览pdf直接调转
location.href = this.detailInfo.file
return
}
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment