huangye-parking/miniapp/components/RichContentPopup.vue
2026-02-28 17:35:49 +08:00

80 lines
1.3 KiB
Vue

<template>
<view class="popup-mask" v-if="visible" @click.self="close">
<view class="popup-content">
<view class="popup-title">{{ title }}</view>
<scroll-view class="popup-body" scroll-y>
<rich-text :nodes="content"></rich-text>
</scroll-view>
<button class="btn-close" @click="close">关闭</button>
</view>
</view>
</template>
<script>
export default {
name: 'RichContentPopup',
props: {
visible: {
type: Boolean,
default: false
},
title: {
type: String,
default: ''
},
content: {
type: String,
default: ''
}
},
emits: ['close'],
methods: {
close() {
this.$emit('close')
}
}
}
</script>
<style scoped>
.popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 999;
}
.popup-content {
background: #fff;
border-radius: 24rpx;
padding: 40rpx;
width: 620rpx;
max-height: 80vh;
display: flex;
flex-direction: column;
}
.popup-title {
font-size: 34rpx;
font-weight: bold;
color: #333;
text-align: center;
margin-bottom: 24rpx;
}
.popup-body {
flex: 1;
max-height: 60vh;
margin-bottom: 24rpx;
}
.btn-close {
background: #f5f5f5;
color: #666;
border-radius: 8rpx;
font-size: 28rpx;
}
</style>