图片懒加载

This commit is contained in:
yanran200730
2022-06-01 09:56:07 +08:00
parent 3484a05d00
commit 8511ba81ea
5 changed files with 10 additions and 32 deletions

View File

@@ -181,7 +181,7 @@
this.albumId = query.albumId
}
this.img = query.url
this.img = decodeURIComponent(query.url)
this.height = uni.getSystemInfoSync().windowHeight
this.getLocation()
@@ -248,11 +248,10 @@
this.$nextTick(() => {
html2canvas(this.$refs.waterMarker, {
allowTaint: true,
useCORS: true,
dpi: 300
useCORS: true
}).then((canvas) => {
let dataURL = canvas.toDataURL('image/png')
const file = this.dataURLtoFile(dataURL, 'photo.png')
let dataURL = canvas.toDataURL('image/jpg')
const file = this.dataURLtoFile(dataURL, 'photo.jpg')
let formData = new FormData()
formData.append('file', file)
this.$http.post('/admin/file/add2?type=image', formData).then(res => {