|
@@ -0,0 +1,100 @@
|
|
1
|
+<template>
|
|
2
|
+ <div :class="{ bigBox: state === 1 }">
|
|
3
|
+ <popup :show="showPopup" @cancel="cancelFrom" />
|
|
4
|
+ <div class="card" :class="{ flipped: state === 1 }" @click="showPopup=true">
|
|
5
|
+ <div class="front">
|
|
6
|
+ <img v-if="isFrist" :src="fristFontImg" class="nowimage" />
|
|
7
|
+ <img v-else :src="nowFontImg" class="nowimage" />
|
|
8
|
+ </div>
|
|
9
|
+ <div class="back">
|
|
10
|
+ <img v-if="state===1" :src="nowBackImg" class="nowimage" />
|
|
11
|
+ <img v-else :src="openImg" class="nowimage" />
|
|
12
|
+ </div>
|
|
13
|
+ </div>
|
|
14
|
+ </div>
|
|
15
|
+</template>
|
|
16
|
+<script>
|
|
17
|
+export default {
|
|
18
|
+ props: {
|
|
19
|
+ value: {
|
|
20
|
+ type: String,
|
|
21
|
+ require: true,
|
|
22
|
+ },
|
|
23
|
+ },
|
|
24
|
+ components: {
|
|
25
|
+ Popup: () => import("@/components/Popup.vue"),
|
|
26
|
+ },
|
|
27
|
+ data() {
|
|
28
|
+ return {
|
|
29
|
+ showPopup: false,
|
|
30
|
+ state: 1,
|
|
31
|
+ classList: ["card"],
|
|
32
|
+ fristFontImg:undefined,
|
|
33
|
+ nowFontImg: require('../assets/popupImg/backImag.jpg'),
|
|
34
|
+ nowBackImg: require('../assets/popupImg/popuBody.jpg'),
|
|
35
|
+ openImg: require('../assets/popupImg/redBack.jpg'),
|
|
36
|
+ isFrist:true,
|
|
37
|
+ };
|
|
38
|
+ },
|
|
39
|
+ watch: {
|
|
40
|
+ value: {
|
|
41
|
+ handler(val) {
|
|
42
|
+ if (val) {
|
|
43
|
+ this.fristFontImg = val;
|
|
44
|
+ }
|
|
45
|
+ },
|
|
46
|
+ immediate: true,
|
|
47
|
+ },
|
|
48
|
+ },
|
|
49
|
+ methods: {
|
|
50
|
+ transform() {
|
|
51
|
+ this.showPopup=true
|
|
52
|
+ this.state = Math.abs(this.state - 1);
|
|
53
|
+ },
|
|
54
|
+ cancelFrom() {
|
|
55
|
+ this.state = Math.abs(this.state - 1);
|
|
56
|
+ this.showPopup=false
|
|
57
|
+ this.isFrist=false
|
|
58
|
+ }
|
|
59
|
+ },
|
|
60
|
+};
|
|
61
|
+</script>
|
|
62
|
+<style lang="less" scoped>
|
|
63
|
+.bigBox {
|
|
64
|
+ perspective: 600px;
|
|
65
|
+ overflow: hidden;
|
|
66
|
+}
|
|
67
|
+
|
|
68
|
+.card {
|
|
69
|
+ position: relative;
|
|
70
|
+ width: 22vw;
|
|
71
|
+ height: 60.5vw;
|
|
72
|
+ transform-style: preserve-3d;
|
|
73
|
+ transition: all 1.6s ease;
|
|
74
|
+ transform: rotateY(-180deg) scale(2);
|
|
75
|
+}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+.card > div {
|
|
79
|
+ position: absolute;
|
|
80
|
+ top: 0;
|
|
81
|
+ left: 0;
|
|
82
|
+ width: 100%;
|
|
83
|
+
|
|
84
|
+ /* 背面不显示 */
|
|
85
|
+ backface-visibility: hidden;
|
|
86
|
+}
|
|
87
|
+
|
|
88
|
+.flipped {
|
|
89
|
+ transform: rotateY(0);
|
|
90
|
+}
|
|
91
|
+
|
|
92
|
+.nowimage {
|
|
93
|
+ width: 22vw;
|
|
94
|
+ height: 60.5vw;
|
|
95
|
+}
|
|
96
|
+
|
|
97
|
+.card .back {
|
|
98
|
+ transform: rotateY(-180deg);
|
|
99
|
+}
|
|
100
|
+</style>>
|