|
@ -119,29 +119,29 @@ const QrCode = (props) => { |
|
|
// aa(v.qrCode)
|
|
|
// aa(v.qrCode)
|
|
|
// console.log(v.qrCode.replace('/[\r\n]/g',""));
|
|
|
// console.log(v.qrCode.replace('/[\r\n]/g',""));
|
|
|
|
|
|
|
|
|
function base64ToFile (url, name) { |
|
|
// function base64ToFile (url, name) {
|
|
|
|
|
|
|
|
|
let mime = name.substring(name.lastIndexOf('.') + 1) |
|
|
// let mime = name.substring(name.lastIndexOf('.') + 1)
|
|
|
let bstr = atob(url); |
|
|
// let bstr = atob(url);
|
|
|
let n = bstr.length; |
|
|
// let n = bstr.length;
|
|
|
let u8arr = new Uint8Array(n); |
|
|
// let u8arr = new Uint8Array(n);
|
|
|
|
|
|
|
|
|
while (n--) { |
|
|
// while (n--) {
|
|
|
u8arr[n] = bstr.charCodeAt(n); |
|
|
// u8arr[n] = bstr.charCodeAt(n);
|
|
|
} |
|
|
// }
|
|
|
return new Blob([u8arr], { type: mime }); |
|
|
// return new Blob([u8arr], { type: mime });
|
|
|
} |
|
|
// }
|
|
|
|
|
|
|
|
|
function downloadFile(url,name='15313'){ |
|
|
// function downloadFile(url,name='15313'){
|
|
|
let a=document.createElement('a'); |
|
|
// let a=document.createElement('a');
|
|
|
a.setAttribute('href',url) |
|
|
// a.setAttribute('href',url)
|
|
|
a.setAttribute('download',name) |
|
|
// a.setAttribute('download',name)
|
|
|
a.setAttribute('target','_blank') |
|
|
// a.setAttribute('target','_blank')
|
|
|
let b=document.createEvent('MouseEvents') |
|
|
// let b=document.createEvent('MouseEvents')
|
|
|
b.initEvent('click',true,true) |
|
|
// b.initEvent('click',true,true)
|
|
|
a.dispatchEvent |
|
|
// a.dispatchEvent
|
|
|
|
|
|
|
|
|
} |
|
|
// }
|
|
|
|
|
|
|
|
|
}}>下载二维码</Button> |
|
|
}}>下载二维码</Button> |
|
|
{/* </a> */} |
|
|
{/* </a> */} |
|
|