修改图片下载

This commit is contained in:
dong.ai
2024-10-29 10:17:40 +08:00
parent 5dc788fab7
commit 92cdc8fe15

View File

@@ -94,19 +94,29 @@ export default {
// URL.revokeObjectURL(newimg.src)
// callback(newimg)
// }
this.blobToBase64(blob).then((base64String) => {
console.log(base64String, '==')
// this.blobToBase64(blob).then((base64String) => {
// console.log(base64String, '==')
// EWebBridge.webCallAppInJs('download', {
// name: '业绩贺报.png',
// url: base64String
// })
// .then(() => {
// console.log('下载完成')
// })
// .catch(() => {
// this.$toast.fail('图片下载失败,请重新下载!')
// })
// })
let newimg = new Image()
newimg.src = URL.createObjectURL(blob)
newimg.onload = function () {
URL.revokeObjectURL(newimg.src)
console.log(newimg.src);
EWebBridge.webCallAppInJs('download', {
name: '业绩贺报.png',
url: base64String
})
.then(() => {
console.log('下载完成')
})
.catch(() => {
this.$toast.fail('图片下载失败,请重新下载!')
})
name: '开门红方案.png',
url: newimg.src
})
}
},
'image/png'
// quality
@@ -126,31 +136,37 @@ img {
width: 100%;
position: relative;
}
.box {
position: absolute;
width: 80%;
height: 40%;
top: 38%;
left: 10%;
.title {
position: absolute;
width: 100%;
// left: 30%;
top: 24%;
font-weight: bold;
p {
display: flex;
justify-content: center;
}
.organ {
font-size: 12px;
color: #b7170b;
}
.name {
font-size: 17px;
color: #b7170b;
}
}
.pName {
position: absolute;
top: 44%;
@@ -160,6 +176,7 @@ img {
display: flex;
justify-content: center;
}
.type {
font-size: 22px;
color: #efbc4f;
@@ -169,6 +186,7 @@ img {
display: flex;
justify-content: center;
}
.yuan {
font-size: 30px;
color: #efbc4f;
@@ -178,11 +196,13 @@ img {
text-align: center;
display: inline-block;
vertical-align: bottom;
span {
font-size: 14px;
margin-left: 5px;
}
}
.time {
font-size: 14px;
color: #efbc4f;
@@ -193,13 +213,16 @@ img {
justify-content: center;
}
}
.border-color {
z-index: 9999;
border: 2px solid;
border-image: radial-gradient(circle, rgba(255, 233, 124, 1), rgba(222, 144, 34, 1)) 2 2;
}
/deep/ .van-button--danger {
background: linear-gradient(to right, #f26e43, #ac0209) !important; /*设置按钮为渐变颜色*/
background: linear-gradient(to right, #f26e43, #ac0209) !important;
/*设置按钮为渐变颜色*/
border: none !important;
}
</style>