Commit 91499bc0 authored by jiacheng.mao's avatar jiacheng.mao

解决ios端下载文件的问题

parent da00d2a6
......@@ -157,19 +157,7 @@ export default {
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)
cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes,hideurlbar=no,toolbarposition=top')
} else {
window.open(i.fileUrl, '_system', 'location=yes')
}
......
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