mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 15:36:43 +08:00
更换贺报下载的方法14
This commit is contained in:
@@ -115,61 +115,6 @@ export default {
|
|||||||
domToImage() {
|
domToImage() {
|
||||||
console.log('this.$refs.xingdownLoad', this.$refs.xingdownLoad);
|
console.log('this.$refs.xingdownLoad', this.$refs.xingdownLoad);
|
||||||
this.$refs.xingdownLoad = this.$refs.xingdownLoad
|
this.$refs.xingdownLoad = this.$refs.xingdownLoad
|
||||||
// let domElement = this.$refs.generateImg
|
|
||||||
// console.log('this.$refs.generateImg',domElement);
|
|
||||||
// console.log(location);
|
|
||||||
// html2canvas(domElement, {
|
|
||||||
// width: domElement.offsetWidth,
|
|
||||||
// height: domElement.offsetHeight,
|
|
||||||
// backgroundColor: '#fff',
|
|
||||||
// scale: 1,
|
|
||||||
// dpi: 300
|
|
||||||
// }).then((canvas) => {
|
|
||||||
// // 转换canvas为PNG图片并压缩
|
|
||||||
// canvas.toBlob(
|
|
||||||
// (blob) => {
|
|
||||||
// // const a = document.createElement('a')
|
|
||||||
// // a.href = URL.createObjectURL(blob)
|
|
||||||
// // a.download = '业绩贺报.png'
|
|
||||||
// // a.click()
|
|
||||||
// // let newimg = new Image()
|
|
||||||
// // newimg.src = URL.createObjectURL(blob)
|
|
||||||
// // newimg.onload = function () {
|
|
||||||
// // URL.revokeObjectURL(newimg.src)
|
|
||||||
// // callback(newimg)
|
|
||||||
// // }
|
|
||||||
// this.blobToBase64(blob).then((base64String) => {
|
|
||||||
// console.log('xing');
|
|
||||||
// base64Excel({ base64Img: base64String }).then(res => {
|
|
||||||
// if (res.result == '0') {
|
|
||||||
// console.log('xingxing');
|
|
||||||
// if(this.downLoadJin == false) {
|
|
||||||
// this.downLoadJin = true
|
|
||||||
// EWebBridge.webCallAppInJs('download', {
|
|
||||||
// name: '业绩贺报.png',
|
|
||||||
// url: res.path
|
|
||||||
// })
|
|
||||||
// .then(() => {
|
|
||||||
// console.log('下载完成')
|
|
||||||
// })
|
|
||||||
// .catch(() => {
|
|
||||||
// this.$toast.fail('图片下载失败,请重新下载!')
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// setTimeout(() => {
|
|
||||||
// this.downLoadJin = false
|
|
||||||
// }, 5000);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// })
|
|
||||||
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// 'image/png'
|
|
||||||
// // quality
|
|
||||||
// )
|
|
||||||
// })
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
let domElement = this.$refs.xingdownLoad;
|
let domElement = this.$refs.xingdownLoad;
|
||||||
async function captureAndProcessImage() {
|
async function captureAndProcessImage() {
|
||||||
@@ -215,6 +160,8 @@ export default {
|
|||||||
// 检查结果,并处理下载逻辑
|
// 检查结果,并处理下载逻辑
|
||||||
if (res.result === '0') {
|
if (res.result === '0') {
|
||||||
console.log(5555);
|
console.log(5555);
|
||||||
|
console.log(res);
|
||||||
|
console.log(res.path);
|
||||||
// if (!this.downLoadJin) {
|
// if (!this.downLoadJin) {
|
||||||
// this.downLoadJin = true;
|
// this.downLoadJin = true;
|
||||||
// 调用原生应用下载接口,并等待其完成
|
// 调用原生应用下载接口,并等待其完成
|
||||||
@@ -222,6 +169,7 @@ export default {
|
|||||||
name: '业绩贺报.png',
|
name: '业绩贺报.png',
|
||||||
url: res.path
|
url: res.path
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('下载完成');
|
console.log('下载完成');
|
||||||
// } else {
|
// } else {
|
||||||
// // this.$toast.fail('已有下载任务在进行,请稍后再试!');
|
// // this.$toast.fail('已有下载任务在进行,请稍后再试!');
|
||||||
@@ -242,7 +190,7 @@ export default {
|
|||||||
|
|
||||||
// 调用 captureAndProcessImage 函数
|
// 调用 captureAndProcessImage 函数
|
||||||
captureAndProcessImage();
|
captureAndProcessImage();
|
||||||
this.$refs.xingdownLoad = null;
|
this.$refs.xingdownLoad.parentNode.removeChild(this.$refs.xingdownLoad);
|
||||||
return false
|
return false
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user