|
@@ -0,0 +1,339 @@
|
|
1
|
+<template>
|
|
2
|
+ <div v-if="showSelf" class="dialog" :style="{'z-index': zIndex}">
|
|
3
|
+ <div class="dialog-mark" @click="closeMyself" :style="{'z-index': zIndex + 1}">
|
|
4
|
+ <div v-show="myShareShow" class="sharetiptxt" style>
|
|
5
|
+ <img style="width:100%; height:100%;" src="../assets/popupImg/myShare.png" alt />
|
|
6
|
+ </div>
|
|
7
|
+ <transition name="dialog">
|
|
8
|
+ <div class="dialog-sprite" :style="{'z-index': zIndex + 2}">
|
|
9
|
+ <div class="dialog-body">
|
|
10
|
+ <div class="bd2 flex-col">
|
|
11
|
+ <img class="pic1" src="../assets/ShaerPopupImg/popuBgc.jpg" alt />
|
|
12
|
+ </div>
|
|
13
|
+
|
|
14
|
+ <div class="bd1 flex-col">
|
|
15
|
+ <span class="btn" :style="`background-image: url(${popuSave});`"></span>
|
|
16
|
+ </div>
|
|
17
|
+ </div>
|
|
18
|
+ <!-- 右侧 -->
|
|
19
|
+ <!-- <div class="section-box">
|
|
20
|
+ <div class="section-box-share" @click="()=>{this.myShareShow=true}">
|
|
21
|
+ <img src="../assets/popupImg/shareImage.png" alt />
|
|
22
|
+ </div>
|
|
23
|
+ <div class="section-box-receive">
|
|
24
|
+ <router-link :to="{path:'SaveShare',query: { states: 0 }}">
|
|
25
|
+ <img src="../assets/popupImg/receiveImage.png" alt />
|
|
26
|
+ </router-link>
|
|
27
|
+ </div>
|
|
28
|
+ <div class="section-box-save">
|
|
29
|
+ <router-link :to="{path:'SaveShare',query: { states: 1 }}">
|
|
30
|
+ <img src="../assets/popupImg/saveImage.png" alt />
|
|
31
|
+ </router-link>
|
|
32
|
+ </div>
|
|
33
|
+ </div>-->
|
|
34
|
+ </div>
|
|
35
|
+ </transition>
|
|
36
|
+ </div>
|
|
37
|
+ </div>
|
|
38
|
+</template>
|
|
39
|
+
|
|
40
|
+<script>
|
|
41
|
+export default {
|
|
42
|
+ name: 'Popup',
|
|
43
|
+
|
|
44
|
+ props: {
|
|
45
|
+ show: {
|
|
46
|
+ type: Boolean,
|
|
47
|
+ default: false,
|
|
48
|
+ required: true
|
|
49
|
+ },
|
|
50
|
+ title: {
|
|
51
|
+ type: String,
|
|
52
|
+ required: true
|
|
53
|
+ },
|
|
54
|
+ showCancel: {
|
|
55
|
+ typs: Boolean,
|
|
56
|
+ default: false,
|
|
57
|
+ required: false
|
|
58
|
+ },
|
|
59
|
+ cancelText: {
|
|
60
|
+ type: String,
|
|
61
|
+ default: '取消',
|
|
62
|
+ required: false
|
|
63
|
+ },
|
|
64
|
+ confirmText: {
|
|
65
|
+ type: String,
|
|
66
|
+ default: '确定',
|
|
67
|
+ required: false
|
|
68
|
+ },
|
|
69
|
+ LoadingShow: {
|
|
70
|
+ type: Boolean,
|
|
71
|
+ default: false,
|
|
72
|
+ required: true
|
|
73
|
+ }
|
|
74
|
+ },
|
|
75
|
+
|
|
76
|
+ data() {
|
|
77
|
+ return {
|
|
78
|
+ name: 'dialog',
|
|
79
|
+ showSelf: false,
|
|
80
|
+ zIndex: this.getZIndex(),
|
|
81
|
+ bodyOverflow: '',
|
|
82
|
+ popuSave: require('../assets/ShaerPopupImg/popuSave.png'),
|
|
83
|
+
|
|
84
|
+ myShareShow: true
|
|
85
|
+ }
|
|
86
|
+ },
|
|
87
|
+ watch: {
|
|
88
|
+ show(val) {
|
|
89
|
+ console.log('🚀 ~ file: Popup.vue ~ line 78 ~ show ~ val', val)
|
|
90
|
+ this.showSelf = val
|
|
91
|
+
|
|
92
|
+ this.transform()
|
|
93
|
+ // this.closeMyself()
|
|
94
|
+
|
|
95
|
+ // if (!val) {
|
|
96
|
+ // this.closeMyself()
|
|
97
|
+ // } else {
|
|
98
|
+ // this.showSelf = val
|
|
99
|
+ // }
|
|
100
|
+ }
|
|
101
|
+ },
|
|
102
|
+ created() {
|
|
103
|
+ this.showSelf = this.show
|
|
104
|
+ },
|
|
105
|
+ mounted() {
|
|
106
|
+ this.forbidScroll()
|
|
107
|
+ if (this.show === true) {
|
|
108
|
+ this.transform()
|
|
109
|
+ }
|
|
110
|
+ },
|
|
111
|
+ methods: {
|
|
112
|
+ shareClick() {
|
|
113
|
+ this.$router.replace({
|
|
114
|
+ path: 'SaveShare',
|
|
115
|
+ query: { states: 0 }
|
|
116
|
+ })
|
|
117
|
+ },
|
|
118
|
+ saveClick() {
|
|
119
|
+ this.$router.replace({
|
|
120
|
+ path: 'SaveShare',
|
|
121
|
+ query: { states: 1 }
|
|
122
|
+ })
|
|
123
|
+ },
|
|
124
|
+ transform() {
|
|
125
|
+ setTimeout(() => {
|
|
126
|
+ this.classDivAA = this.show
|
|
127
|
+ }, 0)
|
|
128
|
+ },
|
|
129
|
+ /** 禁止页面滚动 */
|
|
130
|
+ forbidScroll() {
|
|
131
|
+ this.bodyOverflow = document.body.style.overflow
|
|
132
|
+ document.body.style.overflow = 'hidden'
|
|
133
|
+ },
|
|
134
|
+
|
|
135
|
+ /** 每次获取之后 zindex 自动增加 */
|
|
136
|
+ getZIndex() {
|
|
137
|
+ let zIndexInit = 2022112
|
|
138
|
+ return zIndexInit++
|
|
139
|
+ },
|
|
140
|
+
|
|
141
|
+ /** 取消按钮操作 */
|
|
142
|
+ cancel() {
|
|
143
|
+ // this.$emit('cancel', true)
|
|
144
|
+ },
|
|
145
|
+
|
|
146
|
+ /** 确认按钮操作 */
|
|
147
|
+ confirm() {
|
|
148
|
+ this.$emit('confirm', true)
|
|
149
|
+ },
|
|
150
|
+
|
|
151
|
+ /** 点击遮罩关闭弹窗 */
|
|
152
|
+ closeMyself(event) {
|
|
153
|
+ // this.sloveBodyOverflow()
|
|
154
|
+ this.$emit('closeMyself', true)
|
|
155
|
+ },
|
|
156
|
+
|
|
157
|
+ /** 恢复页面的滚动 */
|
|
158
|
+ sloveBodyOverflow() {
|
|
159
|
+ this.showSelf = false
|
|
160
|
+
|
|
161
|
+ document.body.style.overflow = this.bodyOverflow
|
|
162
|
+ }
|
|
163
|
+ }
|
|
164
|
+}
|
|
165
|
+</script>
|
|
166
|
+
|
|
167
|
+<style lang="less" scoped>
|
|
168
|
+// 弹窗动画
|
|
169
|
+
|
|
170
|
+// 最外层 设置position定位
|
|
171
|
+// 遮罩 设置背景层,z-index值要足够大确保能覆盖,高度 宽度设置满 做到全屏遮罩
|
|
172
|
+
|
|
173
|
+.flex-col {
|
|
174
|
+ display: flex;
|
|
175
|
+ flex-direction: column;
|
|
176
|
+}
|
|
177
|
+.dialog {
|
|
178
|
+ position: fixed;
|
|
179
|
+ top: 0;
|
|
180
|
+ right: 0;
|
|
181
|
+ width: 100%;
|
|
182
|
+ height: 100%;
|
|
183
|
+ transition: opacity 1s;
|
|
184
|
+
|
|
185
|
+ // 内容层 z-index要比遮罩大,否则会被遮盖
|
|
186
|
+ .dialog-mark {
|
|
187
|
+ position: absolute;
|
|
188
|
+ top: 0;
|
|
189
|
+ height: 0;
|
|
190
|
+ width: 100%;
|
|
191
|
+ height: 100%;
|
|
192
|
+ background: rgba(0, 0, 0, 0.9);
|
|
193
|
+ left: 0;
|
|
194
|
+ top: 0;
|
|
195
|
+ z-index: 99;
|
|
196
|
+ display: flex;
|
|
197
|
+ align-items: center;
|
|
198
|
+ justify-content: center;
|
|
199
|
+ .sharetiptxt {
|
|
200
|
+ background-size: 100% auto;
|
|
201
|
+ background-repeat: no-repeat;
|
|
202
|
+ z-index: 55;
|
|
203
|
+ width: 20px;
|
|
204
|
+ height: 320px;
|
|
205
|
+ display: block;
|
|
206
|
+ position: absolute;
|
|
207
|
+ right: 1rem;
|
|
208
|
+ top: 0.5em;
|
|
209
|
+ animation: tipup 1s ease infinite;
|
|
210
|
+ }
|
|
211
|
+ }
|
|
212
|
+}
|
|
213
|
+@keyframes tipup {
|
|
214
|
+ 0% {
|
|
215
|
+ transform: translateY(0%);
|
|
216
|
+ }
|
|
217
|
+ 50% {
|
|
218
|
+ transform: translateY(5%);
|
|
219
|
+ }
|
|
220
|
+ 100% {
|
|
221
|
+ transform: translateY(0%);
|
|
222
|
+ }
|
|
223
|
+}
|
|
224
|
+
|
|
225
|
+.dialog-sprite {
|
|
226
|
+ width: 100vw;
|
|
227
|
+ display: flex;
|
|
228
|
+ justify-content: center;
|
|
229
|
+ position: relative;
|
|
230
|
+
|
|
231
|
+ .header {
|
|
232
|
+ padding: 15px;
|
|
233
|
+ text-align: center;
|
|
234
|
+ font-size: 18px;
|
|
235
|
+ font-weight: 700;
|
|
236
|
+ color: #333;
|
|
237
|
+ }
|
|
238
|
+ .dialog-body {
|
|
239
|
+ flex: 1;
|
|
240
|
+ overflow-x: hidden;
|
|
241
|
+ overflow-y: scroll;
|
|
242
|
+ padding: 0 15px 20px 15px;
|
|
243
|
+ //中间卡片
|
|
244
|
+ .bd2 {
|
|
245
|
+ z-index: 33;
|
|
246
|
+ width: 100%;
|
|
247
|
+ justify-content: flex-start;
|
|
248
|
+ align-items: center;
|
|
249
|
+ margin-top: 20px;
|
|
250
|
+
|
|
251
|
+ .pic1 {
|
|
252
|
+ z-index: 45;
|
|
253
|
+ width: 280px;
|
|
254
|
+ height: 464px;
|
|
255
|
+ // div {
|
|
256
|
+ // // position: relative;
|
|
257
|
+ // position: absolute;
|
|
258
|
+ // width: 100%;
|
|
259
|
+ // height: 100%;
|
|
260
|
+ // /* 背面不显示 */
|
|
261
|
+ // // backface-visibility: hidden;
|
|
262
|
+ // }
|
|
263
|
+
|
|
264
|
+ img {
|
|
265
|
+ width: 48vw;
|
|
266
|
+ }
|
|
267
|
+ }
|
|
268
|
+ .flipped {
|
|
269
|
+ animation: change 0.8s linear forwards;
|
|
270
|
+ }
|
|
271
|
+ }
|
|
272
|
+ @keyframes change {
|
|
273
|
+ from {
|
|
274
|
+ top: -20vh;
|
|
275
|
+ left: -20vw;
|
|
276
|
+ opacity: 0;
|
|
277
|
+ transform: scale(0.5);
|
|
278
|
+ }
|
|
279
|
+ to {
|
|
280
|
+ top: -0;
|
|
281
|
+ left: -0;
|
|
282
|
+ opacity: 2;
|
|
283
|
+ transform: scale(1);
|
|
284
|
+ transform: rotateY(180deg);
|
|
285
|
+ }
|
|
286
|
+ }
|
|
287
|
+ //底部按钮
|
|
288
|
+ .bd1 {
|
|
289
|
+ width: 100%;
|
|
290
|
+ background-size: 100% auto;
|
|
291
|
+ margin: 10px auto 0;
|
|
292
|
+ .btn {
|
|
293
|
+ z-index: 42;
|
|
294
|
+ width: 152px;
|
|
295
|
+ height: 50px;
|
|
296
|
+ display: block;
|
|
297
|
+ text-align: center;
|
|
298
|
+ align-self: center;
|
|
299
|
+ margin-top: 12px;
|
|
300
|
+ background-size: 100% auto;
|
|
301
|
+ background-repeat: no-repeat;
|
|
302
|
+ }
|
|
303
|
+ }
|
|
304
|
+ }
|
|
305
|
+ .section-box {
|
|
306
|
+ position: absolute;
|
|
307
|
+ right: 15vw;
|
|
308
|
+ top: 98px;
|
|
309
|
+ height: 394px;
|
|
310
|
+ display: flex;
|
|
311
|
+ flex-direction: column;
|
|
312
|
+ width: 36px;
|
|
313
|
+ justify-content: space-between;
|
|
314
|
+
|
|
315
|
+ img {
|
|
316
|
+ width: 36px;
|
|
317
|
+ background-size: 100% auto;
|
|
318
|
+ margin-top: 0;
|
|
319
|
+ border-radius: 18px;
|
|
320
|
+ }
|
|
321
|
+
|
|
322
|
+ &-receive {
|
|
323
|
+ width: 36px;
|
|
324
|
+ background-size: 100% auto;
|
|
325
|
+ margin-top: 0;
|
|
326
|
+ }
|
|
327
|
+ &-save {
|
|
328
|
+ width: 36px;
|
|
329
|
+ border-radius: 18px;
|
|
330
|
+ background-size: 100% auto;
|
|
331
|
+ width: 36px;
|
|
332
|
+ margin-top: 0;
|
|
333
|
+
|
|
334
|
+ // background: url('../assets/popupImg/receiveImage.png') no-repeat;
|
|
335
|
+ }
|
|
336
|
+ }
|
|
337
|
+}
|
|
338
|
+</style>
|
|
339
|
+
|