李志伟 3 gadus atpakaļ
vecāks
revīzija
0a7bba875c
4 mainītis faili ar 149 papildinājumiem un 46 dzēšanām
  1. Binārs
      src/assets/popupImg/redBack.jpg
  2. 11
    15
      src/components/Popup.vue
  3. 100
    0
      src/components/imgbox.vue
  4. 38
    31
      src/pages/Honghe.vue

Binārs
src/assets/popupImg/redBack.jpg Parādīt failu


+ 11
- 15
src/components/Popup.vue Parādīt failu

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div v-if="showSelf" class="dialog" :style="{'z-index': zIndex}">
3
-    <div class="dialog-mark" @click.self="closeMyself" :style="{'z-index': zIndex + 1}">
3
+    <div class="dialog-mark" :style="{'z-index': zIndex + 1}">
4 4
       <div v-show="myShareShow" class="sharetiptxt" style>
5 5
         <img style="width:100%; height:100%;" src="../assets/popupImg/myShare.png" alt />
6 6
       </div>
@@ -60,10 +60,10 @@ export default {
60 60
       default: false,
61 61
       required: true
62 62
     },
63
-    title: {
64
-      type: String,
65
-      required: true
66
-    },
63
+    // title: {
64
+    //   type: String,
65
+    //   required: true
66
+    // },
67 67
     showCancel: {
68 68
       typs: Boolean,
69 69
       default: false,
@@ -78,12 +78,12 @@ export default {
78 78
       type: String,
79 79
       default: '确定',
80 80
       required: false
81
-    },
82
-    LoadingShow: {
83
-      type: Boolean,
84
-      default: false,
85
-      required: true
86 81
     }
82
+    // LoadingShow: {
83
+    //   type: Boolean,
84
+    //   default: false,
85
+    //   required: true
86
+    // }
87 87
   },
88 88
 
89 89
   data() {
@@ -153,14 +153,10 @@ export default {
153 153
 
154 154
     /** 取消按钮操作 */
155 155
     cancel() {
156
+      event.stopPropagation()
156 157
       this.$emit('cancel', true)
157 158
     },
158 159
 
159
-    /** 确认按钮操作 */
160
-    confirm() {
161
-      this.$emit('confirm', true)
162
-    },
163
-
164 160
     /** 点击遮罩关闭弹窗 */
165 161
     closeMyself(event) {
166 162
       // this.sloveBodyOverflow()

+ 100
- 0
src/components/imgbox.vue Parādīt failu

@@ -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>>

+ 38
- 31
src/pages/Honghe.vue Parādīt failu

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="index-box">
3
-    <popup :show="showPopup" @cancel="cancelFrom" />
3
+    <!-- <popup :show="showPopup" @cancel="cancelFrom" /> -->
4 4
     <div>
5 5
       <div>
6 6
         <img class="topImage" src="../assets/hareTop.png" alt />
@@ -9,13 +9,14 @@
9 9
     <div class="outer6-wrapper">
10 10
       <div class="outer6 flex-col">
11 11
         <div v-for="item in indexJPG" :key="item" class="section-item">
12
-          <div @click="baga">
13
-            <!-- <img class="section-item-image" src="../assets/coverIndex.jpg" /> -->
12
+          <ImgBox :value='startImg'></ImgBox>
13
+          <!-- <div @click="baga">
14
+            <img class="section-item-image" src="../assets/coverIndex.jpg" />
14 15
             <img
15
-              :class="`section-item-image ${!showPopup?'backImag':''}` "
16
+              :class="`section-item-image ${rotateY?'backImag':''}` "
16 17
               src="../assets/popupImg/backImag.jpg"
17 18
             />
18
-          </div>
19
+          </div> -->
19 20
         </div>
20 21
       </div>
21 22
     </div>
@@ -24,16 +25,20 @@
24 25
 
25 26
 <script>
26 27
 import { useModel } from '@/store'
28
+import ImgBox from '@/components/imgbox.vue'
27 29
 
28 30
 export default {
29 31
   name: 'Honghe',
30 32
   components: {
31
-    Popup: () => import('@/components/Popup.vue')
33
+    Popup: () => import('@/components/Popup.vue'),
34
+    ImgBox
32 35
   },
33 36
   data() {
34 37
     return {
35 38
       indexJPG: new Array(12).fill(null),
36
-      showPopup: false
39
+      showPopup: false,
40
+      rotateY: false,
41
+      startImg:require('../assets/coverIndex.jpg')
37 42
     }
38 43
   },
39 44
   computed: {
@@ -54,16 +59,17 @@ export default {
54 59
       immediate: true
55 60
     }
56 61
   },
57
-  methods: {
58
-    //关闭
59
-    cancelFrom() {
60
-      this.showPopup = false
61
-    },
62
-    baga(e) {
63
-      console.log(e)
64
-      this.showPopup = true
65
-    }
66
-  }
62
+  // methods: {
63
+  //   //关闭
64
+  //   cancelFrom() {
65
+  //     this.showPopup = false
66
+  //   },
67
+  //   baga(e) {
68
+  //     console.log(e)
69
+  //     this.showPopup = true
70
+  //     this.rotateY=true
71
+  //   }
72
+  // }
67 73
 }
68 74
 </script>
69 75
 
@@ -118,25 +124,26 @@ export default {
118 124
         border-left: 1px solid #d0b69a;
119 125
         border-top: 1px solid #d0b69a;
120 126
         display: inline-flex;
127
+        overflow: hidden;
121 128
         &-image {
122 129
           width: 22vw;
123 130
 
124 131
           background-size: 100% 100%;
125 132
         }
126
-        // .backImag {
127
-        //   position: relative;
128
-        //   animation: change 0.8s linear forwards;
129
-        // }
130
-        // @keyframes change {
131
-        //   from {
132
-        //     width: 50%;
133
-        //     z-index: 1;
134
-        //     transform: rotateY(180deg);
135
-        //   }
136
-        //   to {
137
-        //     width: 22vw;
138
-        //   }
139
-        // }
133
+        .backImag {
134
+          // position: relative;
135
+          width: 22vw;
136
+          animation: change 0.8s linear forwards;
137
+        }
138
+        @keyframes change {
139
+          from {
140
+            width: 44vw;
141
+            transform: rotateY(180deg);
142
+          }
143
+          to {
144
+            width: 22vw;
145
+          }
146
+        }
140 147
       }
141 148
     }
142 149
   }