李志伟 3 年前
父节点
当前提交
0a7bba875c
共有 4 个文件被更改,包括 149 次插入46 次删除
  1. 二进制
      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

二进制
src/assets/popupImg/redBack.jpg 查看文件


+ 11
- 15
src/components/Popup.vue 查看文件

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

+ 100
- 0
src/components/imgbox.vue 查看文件

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 查看文件

1
 <template>
1
 <template>
2
   <div class="index-box">
2
   <div class="index-box">
3
-    <popup :show="showPopup" @cancel="cancelFrom" />
3
+    <!-- <popup :show="showPopup" @cancel="cancelFrom" /> -->
4
     <div>
4
     <div>
5
       <div>
5
       <div>
6
         <img class="topImage" src="../assets/hareTop.png" alt />
6
         <img class="topImage" src="../assets/hareTop.png" alt />
9
     <div class="outer6-wrapper">
9
     <div class="outer6-wrapper">
10
       <div class="outer6 flex-col">
10
       <div class="outer6 flex-col">
11
         <div v-for="item in indexJPG" :key="item" class="section-item">
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
             <img
15
             <img
15
-              :class="`section-item-image ${!showPopup?'backImag':''}` "
16
+              :class="`section-item-image ${rotateY?'backImag':''}` "
16
               src="../assets/popupImg/backImag.jpg"
17
               src="../assets/popupImg/backImag.jpg"
17
             />
18
             />
18
-          </div>
19
+          </div> -->
19
         </div>
20
         </div>
20
       </div>
21
       </div>
21
     </div>
22
     </div>
24
 
25
 
25
 <script>
26
 <script>
26
 import { useModel } from '@/store'
27
 import { useModel } from '@/store'
28
+import ImgBox from '@/components/imgbox.vue'
27
 
29
 
28
 export default {
30
 export default {
29
   name: 'Honghe',
31
   name: 'Honghe',
30
   components: {
32
   components: {
31
-    Popup: () => import('@/components/Popup.vue')
33
+    Popup: () => import('@/components/Popup.vue'),
34
+    ImgBox
32
   },
35
   },
33
   data() {
36
   data() {
34
     return {
37
     return {
35
       indexJPG: new Array(12).fill(null),
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
   computed: {
44
   computed: {
54
       immediate: true
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
 </script>
74
 </script>
69
 
75
 
118
         border-left: 1px solid #d0b69a;
124
         border-left: 1px solid #d0b69a;
119
         border-top: 1px solid #d0b69a;
125
         border-top: 1px solid #d0b69a;
120
         display: inline-flex;
126
         display: inline-flex;
127
+        overflow: hidden;
121
         &-image {
128
         &-image {
122
           width: 22vw;
129
           width: 22vw;
123
 
130
 
124
           background-size: 100% 100%;
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
   }