修改图片下载

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