更换贺报下载的方法35

This commit is contained in:
xuxingjun
2025-01-02 09:33:08 +08:00
parent 60471f2eec
commit b2bec98056

View File

@@ -121,7 +121,7 @@ export default {
return false
},
async captureAndProcessImage(domElement) {
// try {
try {
// 获取 DOM 元素
// let domElement = this.$refs.xingdownLoad;
// 使用 html2canvas 捕获图像,并等待其完成
@@ -150,26 +150,27 @@ export default {
// 调用 base64Excel 函数,并等待其完成
const res = await base64Excel({ base64Img: base64String });
window.location.href = res.path
// window.location.href = res.path
// 检查结果,并处理下载逻辑
// if (res.result === '0') {
// console.log(5555);
// console.log(res.path + '?t=' + Date.now());
// console.log(EWebBridge);
// EWebBridge.webCallAppInJs('download', {
// name: '业绩贺报.png',
// url: res.path,
// })
// // .then(() => {
// // console.log('下载完成')
// // }).catch(() => {
// // // this.$toast.fail('图片下载失败,请重新下载!')
// // })
// }
// } catch (error) {
// // 处理整个过程中的任何错误
// console.error('Error capturing or processing the image:', error);
// }
if (res.result === '0') {
console.log(5555);
console.log(res.path + '?t=' + Date.now());
console.log(EWebBridge);
EWebBridge.webCallAppInJs('download', {
name: '业绩贺报.png',
url: res.path,
})
// .then(() => {
// console.log('下载完成')
// }).catch(() => {
// // this.$toast.fail('图片下载失败,请重新下载!')
// })
}
} catch (error) {
// 处理整个过程中的任何错误
console.error('Error capturing or processing the image:', error);
}
},
close() {
console.log(15434678);