mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-13 18:56:43 +08:00
更换贺报下载的方法31
This commit is contained in:
@@ -77,9 +77,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 分享
|
// 分享
|
||||||
fenxiang() {
|
fenxiang() {
|
||||||
if(this.$refs.xingdownLoad != this.$refs.xingdownLoad) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// const element = document.getElementById('capture')
|
// const element = document.getElementById('capture')
|
||||||
// const canvas = await html2canvas(element)
|
// const canvas = await html2canvas(element)
|
||||||
html2canvas(this.$refs.xingdownLoad, {
|
html2canvas(this.$refs.xingdownLoad, {
|
||||||
@@ -87,7 +84,9 @@ export default {
|
|||||||
height: this.$refs.xingdownLoad.offsetHeight,
|
height: this.$refs.xingdownLoad.offsetHeight,
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
scale: 2,
|
scale: 2,
|
||||||
dpi: 300
|
dpi: 300,
|
||||||
|
useCORS: true,
|
||||||
|
allowTaint: true,
|
||||||
}).then((canvas) => {
|
}).then((canvas) => {
|
||||||
console.log('分享');
|
console.log('分享');
|
||||||
// 将 canvas 转换为 Blob
|
// 将 canvas 转换为 Blob
|
||||||
@@ -105,9 +104,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}, 'image/png')
|
}, 'image/png')
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
|
||||||
this.close()
|
|
||||||
}, 3000);
|
|
||||||
},
|
},
|
||||||
// 生成图片并下载
|
// 生成图片并下载
|
||||||
domToImage() {
|
domToImage() {
|
||||||
@@ -125,7 +121,9 @@ export default {
|
|||||||
height: domElement.offsetHeight,
|
height: domElement.offsetHeight,
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
scale: 1,
|
scale: 1,
|
||||||
dpi: 300
|
dpi: 300,
|
||||||
|
useCORS: true,
|
||||||
|
allowTaint: true,
|
||||||
});
|
});
|
||||||
console.log('下载',canvas);
|
console.log('下载',canvas);
|
||||||
// 将画布转换为 Blob,并等待其完成
|
// 将画布转换为 Blob,并等待其完成
|
||||||
@@ -167,8 +165,6 @@ export default {
|
|||||||
|
|
||||||
close() {
|
close() {
|
||||||
console.log(15434678);
|
console.log(15434678);
|
||||||
// document.documentElement.removeChild(this.$refs.xingdownLoad)
|
|
||||||
// this.$refs.xingdownLoad.removeChild(this.$refs.xingdownLoad);
|
|
||||||
document.getElementById('capture').innerHTML = '';
|
document.getElementById('capture').innerHTML = '';
|
||||||
this.$emit('child-colse', '1')
|
this.$emit('child-colse', '1')
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user