custom-popup.vue
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<template>
<view class="mask-wrap" v-if="isShowPopup">
<view class="center-content">
<slot>
<view class="top-wrap">
<template v-if="isShowClose">
<image @click="closePopup" class="close-img" src="/static/images/close-icon.png"></image>
</template>
<image class="poster-img" :src="posterImg" show-menu-by-longpress></image>
<view class="btn-wrap">
<view class="save-btn">长按图片保存</view>
</view>
</view>
</slot>
</view>
</view>
</template>
<script setup>
import { onMounted, ref } from 'vue'
const emits = defineEmits(['closePopup'])
const props = defineProps({
isShowPopup: {
type: Boolean,
default: false
},
isShowClose: {
type: Boolean,
default: false
},
posterImg: {
type: String,
default: '/static/images/vip-icon.png'
}
})
function closePopup() {
emits('closePopup')
}
</script>
<style lang="scss">
.mask-wrap {
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100vw;
height: 100vh;
z-index: 99999;
background-color: #000000;
}
.center-content {
@include flexColumn();
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 686rpx;
padding: 48rpx 32rpx 24rpx 32rpx;
box-sizing: border-box;
background-color: #fff;
border-radius: 32rpx;
height: 720rpx;
border-radius: 0 0 12rpx 12rpx;
background: #151419ff;
.top-wrap {
.poster-img {
border-radius: 16rpx;
height: 630rpx;
width: 600rpx;
}
.btn-wrap {
.save-btn {
width: 600rpx;
height: 72rpx;
text-align: center;
line-height: 72rpx;
margin-top: 20rpx;
color: #000;
border-radius: 12rpx;
background: #fcd19aff;
}
}
}
.close-img {
position: absolute;
z-index: 99;
right: 60rpx;
top: 70rpx;
width: 40rpx;
height: 40rpx;
}
.function-btns {
margin-top: 22rpx;
@include flexCj();
}
}
</style>