index.vue
2.29 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
106
107
108
109
110
111
112
113
114
115
116
<template>
<uni-popup ref="tips" type="center" :is-mask-click="false" :animation="false">
<view class="tips-wrapper">
<view class="tips-content">
<view class="tips-title"
>{{ title }}
<view class="icon-close" @click="close">×</view>
</view>
<view class="tips-text">{{ content }}</view>
</view>
<view class="tips-footer">
<view class="tips-btn close" @click="close()">{{ cancelBtnText }}</view>
<view class="tips-btn preview" @click="confirm()">{{
confirmBtnText
}}</view>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
name: "MessageBox",
data() {
return {};
},
props: {
title: {
type: String,
default: "提示",
},
content: {
type: String,
default: "提示",
},
confirmBtnText: {
type: String,
default: "确定",
},
cancelBtnText: {
type: String,
default: "取消",
},
},
mounted() {
this.$refs.tips.open("center");
},
methods: {
close() {
this.$refs.tips.close();
this.$emit("cancel");
},
confirm() {
this.$refs.tips.close();
this.$emit("confirm");
},
},
};
</script>
<style scoped lang="scss">
.tips-wrapper {
width: 704rpx;
height: 372rpx;
background: #ffffff;
border-radius: 20rpx;
.tips-content {
padding: 48rpx;
border-bottom: 1px solid #e8e8e8;
.tips-title {
position: relative;
width: 100%;
font-weight: 500;
font-size: 32rpx;
color: #292d33;
text-align: center;
.icon-close {
position: absolute;
right: 0;
top: -24rpx;
width: 160rpx;
font-size: 50rpx;
text-align: right;
padding-right: 20rpx;
line-height: 96rpx;
}
}
}
.tips-text {
font-size: 30rpx;
color: #5a5e66;
letter-spacing: 1rpx;
text-align: center;
line-height: 40rpx;
margin-top: 48rpx;
}
.tips-footer {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
.close {
color: #6c6c70;
}
.preview {
color: #2c66f7;
}
}
.tips-btn {
width: 50%;
text-align: center;
font-size: 32rpx;
text-align: center;
line-height: 44rpx;
}
}
</style>