Files
dvcp_v2_wxcp_app/components/AiDrawer/AiDrawer.vue

71 lines
1.2 KiB
Vue
Raw Normal View History

2022-12-07 18:57:37 +08:00
<template>
<section class="AiDrawer">
2022-12-08 13:38:03 +08:00
<AiPagePicker type="custom" :ops="ops" @select="getSeal">
<img class="sealImage" v-if="seal" :src="seal"/>
<div v-else class="placeholder">{{ placeholder }}</div>
2022-12-07 18:57:37 +08:00
</AiPagePicker>
</section>
</template>
<script>
import AiPagePicker from "./AiPagePicker";
export default {
name: "AiDrawer",
components: {AiPagePicker},
model: {
prop: "seal",
event: "input"
},
props: {
2022-12-08 13:38:03 +08:00
seal: {default: null},
2022-12-07 18:57:37 +08:00
placeholder: {type: String, default: "请在此处清晰书写你的签名"},
},
data() {
return {
ops: {
url: "/components/pages/sealDrawer"
}
}
2022-12-08 13:38:03 +08:00
},
methods: {
getSeal(image) {
this.$emit("input", image)
}
2022-12-07 18:57:37 +08:00
}
}
</script>
<style lang="scss" scoped>
.AiDrawer {
background: #F7F7F7;
border: 1px solid #CCCCCC;
position: relative;
::v-deep.AiPagePicker {
height: 200px;
& > div {
height: 100%;
}
2022-12-08 13:38:03 +08:00
.sealImage {
width: 100%;
height: 100%;
}
2022-12-07 18:57:37 +08:00
}
.placeholder {
pointer-events: none;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
max-width: 407px;
text-align: center;
font-size: 64px;
color: #DDDDDD;
}
}
</style>