This commit is contained in:
yanran200730
2022-05-31 18:56:37 +08:00
parent a3ee738baf
commit acd70b055b
3 changed files with 33 additions and 22 deletions

View File

@@ -577,7 +577,8 @@
overflow: hidden;
.waterMarker-img {
width: 100%;
max-width: 100%;
object-fit: cover;
max-height: calc(100vh - 321px - 128px);
}

View File

@@ -9,26 +9,28 @@
<p v-if="item.type === 'text'">{{ item.value }}</p>
<image v-else mode="widthFix" :src="item.value" />
</div>
<div class="rich-bottom" :class="[isShow ? 'active' : '']">
<div class="top">
<h2>{{ type === 'text' ? '编辑文本' : '编辑图片' }}</h2>
<image @click="isShow = false, currIndex = -1" src="../../images/down_boldw.png" />
</div>
<div class="btns">
<div class="btn-item" hover-class="bg-hover" @click="remove">
<image src="../../images/remove-black.png" />
<span>删除</span>
<u-popup v-model="isShow" z-index="11" :closeable="false" border-radius="32" mode="bottom" @close="onClose">
<div class="rich-bottom">
<div class="top">
<h2>{{ type === 'text' ? '编辑文本' : '编辑图片' }}</h2>
<image @click="isShow = false, currIndex = -1" src="../../images/down_boldw.png" />
</div>
<div class="btn-item" hover-class="bg-hover" v-if="type === 'text'" @click="toEditText">
<image src="../../images/xiugai.png" />
<span>修改</span>
</div>
<div class="btn-item" hover-class="bg-hover" @click="toClipping" v-else>
<image src="../../images/jiancai.png" />
<span>剪裁</span>
<div class="btns">
<div class="btn-item" hover-class="bg-hover" @click="remove">
<image src="../../images/remove-black.png" />
<span>删除</span>
</div>
<div class="btn-item" hover-class="bg-hover" v-if="type === 'text'" @click="toEditText">
<image src="../../images/xiugai.png" />
<span>修改</span>
</div>
<div class="btn-item" hover-class="bg-hover" @click="toClipping" v-else>
<image src="../../images/jiancai.png" />
<span>剪裁</span>
</div>
</div>
</div>
</div>
</u-popup>
</div>
</template>
@@ -46,6 +48,10 @@
}
},
onShow () {
this.isShow = false
},
mounted () {
uni.$on('cropper', e => {
this.$emit('onLongpress', {
@@ -72,6 +78,11 @@
this.isShow = false
},
onClose () {
this.isShow = false
this.currIndex = -1
},
remove () {
this.$confirm('确定删除该条数据?').then(() => {
this.$emit('onLongpress', {
@@ -91,8 +102,6 @@
uni.navigateTo({
url: `./Clipping?url=${encodeURIComponent(this.value)}`
})
this.isShow = false
},
onLongpress (item, index) {
@@ -120,12 +129,12 @@
}
.rich-bottom {
position: fixed;
// position: fixed;
bottom: 0;
left: 0;
z-index: 11;
width: 100%;
transform: translateY(100%);
// transform: translateY(100%);
border-radius: 32px 32px 0px 0px;
transition: all ease 0.4s;
overflow: hidden;

View File

@@ -144,6 +144,7 @@
this.isShowText = true
} else {
console.log(e)
this.richList[e.index].value = e.value
}
},