敢为人鲜小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

157 lines
2.9 KiB

<template>
<view class="privacy-popup">
<uv-popup ref="privacyPopup"
mode="center"
:round="10"
:closeable="false"
:maskClick="false"
:closeOnClickOverlay="false"
:safeAreaInsetBottom="false"
:customStyle="{backgroundColor: '#fff', padding: 0, width: '85%'}"
overlayOpacity="0.7">
<view class="privacy-container">
<!-- 标题 -->
<view class="privacy-title">
{{ title }}
</view>
<!-- 内容区域 - 使用插槽 -->
<scroll-view scroll-y class="privacy-content">
<slot></slot>
</scroll-view>
<!-- 底部按钮 -->
<view class="privacy-actions">
<view class="action-btn reject-btn" hover-class="active-btn" @tap="handleReject">{{ rejectText }}</view>
<view class="action-btn agree-btn" hover-class="active-btn" @tap="handleAgree">{{ agreeText }}</view>
</view>
</view>
</uv-popup>
</view>
</template>
<script>
export default {
name: 'PrivacyPopup',
props: {
// 弹窗标题
title: {
type: String,
default: '隐私政策'
},
// 拒绝按钮文字
rejectText: {
type: String,
default: '拒绝'
},
// 同意按钮文字
agreeText: {
type: String,
default: '同意'
}
},
data() {
return {
}
},
methods: {
// 打开弹窗
open() {
this.$refs.privacyPopup.open();
},
// 关闭弹窗
close() {
this.$refs.privacyPopup.close();
},
// 处理拒绝操作
handleReject() {
this.$emit('reject');
this.close();
},
// 处理同意操作
handleAgree() {
this.$emit('agree');
this.close();
}
}
}
</script>
<style lang="scss" scoped>
.privacy-popup {
// padding: 0;
.privacy-container {
display: flex;
flex-direction: column;
justify-content: space-between;
width: 100%;
background-color: #fff;
}
.privacy-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
padding: 30rpx 0;
// border-bottom: 1rpx solid #e6e6e6;
background-color: #fff;
}
.privacy-content {
flex: 1;
padding: 30rpx;
box-sizing: border-box;
height: 600rpx;
background-color: #fff;
max-height: 50vh;
}
.privacy-actions {
display: flex;
border-top: 4rpx solid #e6e6e6;
height: 100rpx;
background-color: #fff;
.action-btn {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
position: relative;
background-color: #fff;
transition: all 0.3s ease;
// &::after {
// content: '';
// position: absolute;
// right: 0;
// top: 20rpx;
// bottom: 20rpx;
// width: 1rpx;
// background-color: #e6e6e6;
// }
&:last-child::after {
display: none;
}
}
.reject-btn {
color: #999;
// background-color: red;
border-right: 4rpx solid #e6e6e6;
}
.agree-btn {
color: $uni-color;
}
.active-btn {
background-color: $uni-color;
color: #fff;
}
}
}
</style>