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.

185 lines
3.7 KiB

3 years ago
<template>
<view>
<u-popup v-model="isShow" mode="center" width="698rpx" :height="height" :custom-style="{ 'background': 'transparent' }">
<view class="content">
<!-- <view class="bkg">-->
<!-- <u-image mode="scaleToFill" width="698rpx" height="100%" :src="require('@/static/popover-bkg.png')"></u-image>-->
<!-- </view>-->
<view class="icon">
<u-image bg-color="transparent" mode="aspectFit" width="184rpx" height="180rpx" :src="getIcon"></u-image>
</view>
<view class="box">
<view class="close">
<view>
<u-icon @click="hidden" name="close" :size="34" style="margin-left: 28rpx"></u-icon>
</view>
</view>
<view class="flowers">
<u-image bg-color="transparent" :width="460" :height="100" :src="require('@/static/flowers.png')"></u-image>
</view>
3 years ago
<scroll-view class="box-text" :scroll-y="true" @touchmove.stop>
3 years ago
<slot name="box-content"></slot>
3 years ago
</scroll-view>
3 years ago
</view>
</view>
3 years ago
<view class="content-bottom">
<slot name="content-bottom"></slot>
</view>
3 years ago
</u-popup>
</view>
</template>
<script>
export default {
props: {
icon: String,
height: String
},
data() {
return {
isShow: false,
};
},
methods: {
show() {
this.isShow = true;
},
hidden() {
this.isShow = false;
}
},
computed: {
getIcon() {
let map = new Map([
['laugh', require('@/static/laugh.png')],
['smile', require('@/static/smile.png')],
['sad', require('@/static/sad.png')],
['frown', require('@/static/frown.png')]
])
return map.get(this.icon)
}
}
}
</script>
<style lang="scss">
.content {
background: transparent;
position: relative;
& .icon {
background: transparent;
transform: translateX(-50%);
z-index: 4;
position: absolute;
left: 50%;
}
& .box {
width: calc(100% - 40rpx);
background: #fff;
border-radius: 66rpx;
z-index: 2;
3 years ago
padding-top: 106rpx;
padding-bottom: 100rpx;
3 years ago
position: relative;
left: 20rpx;
top: 104rpx;
&::before {
content: '';
background: #FED45F;
border-radius: 66rpx;
filter: drop-shadow(0 0 4rpx rgba(0, 0, 0, .2));
z-index: -1;
position: absolute;
inset: -18rpx -18rpx -18rpx -18rpx;
}
&::after {
content: '';
background: #fff;
border-radius: 66rpx;
border: 1rpx solid #927B66;
box-shadow: 10rpx 8rpx 0rpx 0rpx rgba(52,170,95,0.32);
z-index: 1;
position: absolute;
inset: 0 0 0 0;
}
& .close {
height: 88rpx;
width: 98rpx;
border-top-right-radius: 66rpx;
overflow: hidden;
z-index: 4;
position: absolute;
top: 2rpx;
right: 2rpx;
& > view {
display: flex;
align-items: center;
height: 100%;
background: #FED45F;
border-top-left-radius: 100rpx;
border-bottom-left-radius: 100rpx;
width: 200rpx;
font-size: 34rpx;
color: #fff;
}
}
& .flowers {
border-bottom-left-radius: 66rpx;
overflow: hidden;
z-index: 2;
position: absolute;
bottom: 2rpx;
left: 2rpx;
}
&-text {
3 years ago
width: calc(100% - 32rpx - 32rpx);
3 years ago
max-height: 46vh;
overflow: scroll;
3 years ago
z-index: 3;
position: relative;
3 years ago
margin: 0 32rpx 0rpx 32rpx;
3 years ago
}
}
}
3 years ago
.content-bottom {
z-index: 2;
position: relative;
top: 118rpx;
}
3 years ago
.bkg {
position: absolute;
top: 104rpx;
left: 0;
right: 0;
bottom: 0;
}
::v-deep .u-mode-center-box {
background: transparent!important;
}
</style>