Commit dc107205 authored by jiacheng.mao's avatar jiacheng.mao

[fix][I-11674]解决ios端查看pdf文件的问题

parent e301f63b
......@@ -144,7 +144,7 @@ export default {
let param = {
project_id: vm.$route.params.project_id,
// phone: window.localStorage.user_phone,
bp_id: JSON.parse(window.localStorage.now_user_bp_bind_id).bp_id,
bp_id: JSON.parse(window.localStorage.now_user_bp_bind_id).bp_id,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
......@@ -152,14 +152,26 @@ export default {
if (res.result === 'S') {
vm.fileArray = res.info
vm.fileArray.forEach(i => {
//cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes,hideurlbar=no,toolbarposition=top')
//cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes')
if(vum.Platform.isAndroid()) { //android终端
window.open(i.fileUrl,"_system","location=yes")
}else if(vum.Platform.isIOS() || vum.Platform.isIPad()) { //ios终端
window.location.href = i.fileUrl;
}else{
window.open(i.fileUrl,"_system","location=yes")
// cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes,hideurlbar=no,toolbarposition=top')
// cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes')
if (vum.Platform.isAndroid()) { // android终端
window.open(i.fileUrl, '_system', 'location=yes')
} else if (vum.Platform.isIOS() || vum.Platform.isIPad()) { // ios终端
// window.location.href = i.fileUrl;
// 模拟 输入框
var cInput = document.createElement('input')
cInput.value = i.fileUrl
document.body.appendChild(cInput)
cInput.select() // 选取文本框内容
// 执行浏览器复制命令
// 复制命令会将当前选中的内容复制到剪切板中(这里就是创建的input标签)
// Input要在正常的编辑状态下原生复制方法才会生效
document.execCommand('copy')
hlsPopup.showLongCenter('复制成功,请在浏览器中打开')
// 复制成功后再将构造的标签 移除
document.body.removeChild(cInput)
} else {
window.open(i.fileUrl, '_system', 'location=yes')
}
})
// vm.pdfDownload()
......
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