mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 23:46:44 +08:00
更换贺报下载的方法31
This commit is contained in:
@@ -77,37 +77,33 @@ 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, {
|
||||||
width: this.$refs.xingdownLoad.offsetWidth,
|
width: this.$refs.xingdownLoad.offsetWidth,
|
||||||
height: this.$refs.xingdownLoad.offsetHeight,
|
height: this.$refs.xingdownLoad.offsetHeight,
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
scale: 2,
|
scale: 2,
|
||||||
dpi: 300
|
dpi: 300,
|
||||||
}).then((canvas) => {
|
useCORS: true,
|
||||||
console.log('分享');
|
allowTaint: true,
|
||||||
// 将 canvas 转换为 Blob
|
}).then((canvas) => {
|
||||||
canvas.toBlob((blob) => {
|
console.log('分享');
|
||||||
this.blobToBase64(blob).then((base64String) => {
|
// 将 canvas 转换为 Blob
|
||||||
let base64Manane = base64String.split(',')[1]
|
canvas.toBlob((blob) => {
|
||||||
console.log(base64Manane);
|
this.blobToBase64(blob).then((base64String) => {
|
||||||
EWebBridge.webCallAppInJs('bridge', {
|
let base64Manane = base64String.split(',')[1]
|
||||||
flag: 'share',
|
console.log(base64Manane);
|
||||||
extra: {
|
EWebBridge.webCallAppInJs('bridge', {
|
||||||
shareType: '1',
|
flag: 'share',
|
||||||
base64: base64Manane
|
extra: {
|
||||||
}
|
shareType: '1',
|
||||||
})
|
base64: base64Manane
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}, '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