图片剪裁测试

This commit is contained in:
yanran200730
2022-05-31 16:24:13 +08:00
parent df97f67e61
commit e10ea8191b
14 changed files with 1186 additions and 7 deletions

View File

@@ -50,7 +50,7 @@
</div>
</div>
</div>
<div class="photo-tabbar" data-html2canvas-ignore>
<div class="photo-tabbar" data-html2canvas-ignore>
<h2>编辑图片</h2>
<div class="tabbar-wrapper">
<div class="item" @click.stop="back">
@@ -61,7 +61,7 @@
<image src="./images/shuiyin-white.png" />
<div>水印</div>
</div>
<div class="item" @click.stop="isHide = false">
<div class="item" @click.stop="toClipping">
<image src="./images/jiancai.png" />
<div>剪裁</div>
</div>
@@ -187,11 +187,26 @@
this.$nextTick(() => {
this.getWatermarkList()
})
uni.$on('cropper', e => {
this.img = e
this.x = 32
this.y = 200
})
},
onUnload () {
uni.$off('cropper')
},
methods: {
...mapActions(['injectJWeixin']),
toClipping () {
uni.navigateTo({
url: `./Clipping?url=${encodeURIComponent(this.img)}`
})
},
onImgLoad () {
const img = document.querySelector('.waterMarker-img')