Baozhangchao 3 years ago
parent
commit
aee14cb690

BIN
src/assets/popupImg/myShare.png View File


+ 23
- 4
src/components/Honghe.vue View File

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">
12
           <div @click="baga">
13
-            <img class="section-item-image" src="../assets/coverIndex.jpg" />
13
+            <!-- <img class="section-item-image" src="../assets/coverIndex.jpg" /> -->
14
+            <img
15
+              :class="`section-item-image ${!showPopup?'backImag':''}` "
16
+              src="../assets/popupImg/backImag.jpg"
17
+            />
14
           </div>
18
           </div>
15
         </div>
19
         </div>
16
       </div>
20
       </div>
28
   },
32
   },
29
   data() {
33
   data() {
30
     return {
34
     return {
31
-      indexJPG: new Array(12).fill(undefined),
35
+      indexJPG: new Array(12).fill(null),
32
       showPopup: false
36
       showPopup: false
33
     }
37
     }
34
   },
38
   },
55
   background-color: #c1172d;
59
   background-color: #c1172d;
56
   background-size: 100% 100%;
60
   background-size: 100% 100%;
57
   width: 100%;
61
   width: 100%;
58
-  height: 100%;
62
+  height: 100vh;
59
   position: relative;
63
   position: relative;
60
   top: 0;
64
   top: 0;
61
   left: 0;
65
   left: 0;
62
   right: 0;
66
   right: 0;
63
   bottom: 0;
67
   bottom: 0;
68
+  overflow: auto;
64
 
69
 
65
   .topImage {
70
   .topImage {
66
     width: 90%;
71
     width: 90%;
77
     width: 92vw;
82
     width: 92vw;
78
     border: 1px solid #d0b69a;
83
     border: 1px solid #d0b69a;
79
     margin: 16px auto 0;
84
     margin: 16px auto 0;
85
+    margin-bottom: 2em;
80
 
86
 
81
     .outer6 {
87
     .outer6 {
82
       flex-flow: row wrap;
88
       flex-flow: row wrap;
91
       overflow: hidden;
97
       overflow: hidden;
92
       .section-item {
98
       .section-item {
93
         width: 22vw;
99
         width: 22vw;
94
-
95
         border-left: 1px solid #d0b69a;
100
         border-left: 1px solid #d0b69a;
96
         border-top: 1px solid #d0b69a;
101
         border-top: 1px solid #d0b69a;
97
         display: inline-flex;
102
         display: inline-flex;
100
 
105
 
101
           background-size: 100% 100%;
106
           background-size: 100% 100%;
102
         }
107
         }
108
+        // .backImag {
109
+        //   position: relative;
110
+        //   animation: change 0.8s linear forwards;
111
+        // }
112
+        // @keyframes change {
113
+        //   from {
114
+        //     width: 50%;
115
+        //     z-index: 1;
116
+        //     transform: rotateY(180deg);
117
+        //   }
118
+        //   to {
119
+        //     width: 22vw;
120
+        //   }
121
+        // }
103
       }
122
       }
104
     }
123
     }
105
   }
124
   }

+ 91
- 0
src/components/ImageTrans.vue View File

1
+<template>
2
+  <div class="card-wrapper">
3
+    <div :class="`card ${classDivAA?'flipped':''}`" @click="transform">
4
+      <div class="back">
5
+        <img src="../assets/popupImg/popuBody.jpg" alt />
6
+      </div>
7
+      <div class="front">
8
+        <img src="../assets/popupImg/backImag.jpg" alt />
9
+      </div>
10
+    </div>
11
+  </div>
12
+</template>
13
+
14
+<script>
15
+export default {
16
+  name: 'ImageTrans',
17
+  props: {
18
+    classDiv: {
19
+      type: Boolean
20
+    }
21
+  },
22
+  data() {
23
+    return {
24
+      classDivAA: false
25
+    }
26
+  },
27
+
28
+  mounted() {
29
+    if (this.classDiv) {
30
+      this.transform()
31
+    }
32
+  },
33
+  methods: {
34
+    transform() {
35
+      // this.classDiv = true
36
+      console.log(
37
+        '🚀 ~ file: ImageTrans.vue ~ line 34 ~ transform ~  this.classDiv',
38
+        // this.classDiv
39
+        setTimeout(() => {
40
+          this.classDivAA = true
41
+        }, 0)
42
+      )
43
+    }
44
+  }
45
+}
46
+</script>
47
+
48
+<style scoped>
49
+.card-wrapper {
50
+  perspective: 600px;
51
+}
52
+
53
+img {
54
+  width: 48vw;
55
+}
56
+.card {
57
+  position: relative;
58
+  width: 320px;
59
+  height: 320px;
60
+  margin: 200px auto;
61
+  color: #fff;
62
+  font-size: 3em;
63
+  text-align: center;
64
+  line-height: 320px;
65
+  box-shadow: 0 20px 20px rgba(50, 50, 50, 0.2);
66
+  transform-style: preserve-3d;
67
+  transition: all 0.8s ease;
68
+}
69
+
70
+.card > div {
71
+  position: absolute;
72
+  top: 0;
73
+  left: 0;
74
+  width: 100%;
75
+  height: 100%;
76
+
77
+  /* 背面不显示 */
78
+  backface-visibility: hidden;
79
+}
80
+
81
+.flipped {
82
+  transform: rotateY(180deg);
83
+}
84
+
85
+.card .front {
86
+}
87
+
88
+.card .back {
89
+  transform: rotateY(180deg);
90
+}
91
+</style>

+ 126
- 21
src/components/Popup.vue View File

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" @click.self="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>
4
       <transition name="dialog">
7
       <transition name="dialog">
5
         <div class="dialog-sprite" :style="{'z-index': zIndex + 2}">
8
         <div class="dialog-sprite" :style="{'z-index': zIndex + 2}">
6
           <div class="dialog-body">
9
           <div class="dialog-body">
7
-            <div class="dialog-popuImag">
8
-              <img src="../assets/popupImg/popuBody.jpg" alt />
10
+            <div class="card-wrapper">
11
+              <div :class="`dialog-popuImag ${classDivAA?'flipped':''}`">
12
+                <!-- <img src="../assets/popupImg/popuBody.jpg" alt /> -->
13
+                <!-- <ImageTrans :classDiv="show" /> -->
14
+                <div class="back">
15
+                  <img style="width: 180px; height:492px" src="../assets/popupImg/popuBody.jpg" alt />
16
+                </div>
17
+
18
+                <div class="front">
19
+                  <img
20
+                    style="width: 180px; height:492px "
21
+                    src="../assets/popupImg/backImag.jpg"
22
+                    alt
23
+                  />
24
+                </div>
25
+              </div>
9
             </div>
26
             </div>
27
+
10
             <div class="dialog-footer">
28
             <div class="dialog-footer">
11
               <img @click="cancel" class="btn" src="../assets/popupImg/cancelmage.png" alt />
29
               <img @click="cancel" class="btn" src="../assets/popupImg/cancelmage.png" alt />
12
             </div>
30
             </div>
13
           </div>
31
           </div>
14
           <!-- 右侧 -->
32
           <!-- 右侧 -->
15
           <div class="section-box">
33
           <div class="section-box">
16
-            <div class="section-box-share">
34
+            <div class="section-box-share" @click="()=>{this.myShareShow=true}">
17
               <img src="../assets/popupImg/shareImage.png" alt />
35
               <img src="../assets/popupImg/shareImage.png" alt />
18
             </div>
36
             </div>
19
             <div class="section-box-receive">
37
             <div class="section-box-receive">
20
-              <img src="../assets/popupImg/receiveImage.png" alt />
38
+              <router-link :to="{path:'SaveShare',query: {  states: 0 }}">
39
+                <img src="../assets/popupImg/receiveImage.png" alt />
40
+              </router-link>
21
             </div>
41
             </div>
22
             <div class="section-box-save">
42
             <div class="section-box-save">
23
-              <img src="../assets/popupImg/saveImage.png" alt />
43
+              <router-link :to="{path:'SaveShare',query: {  states: 1 }}">
44
+                <img src="../assets/popupImg/saveImage.png" alt />
45
+              </router-link>
24
             </div>
46
             </div>
25
           </div>
47
           </div>
26
         </div>
48
         </div>
32
 <script>
54
 <script>
33
 export default {
55
 export default {
34
   name: 'Popup',
56
   name: 'Popup',
57
+  components: {
58
+    ImageTrans: () => import('@/components/ImageTrans.vue')
59
+  },
35
   props: {
60
   props: {
36
     show: {
61
     show: {
37
       type: Boolean,
62
       type: Boolean,
69
       name: 'dialog',
94
       name: 'dialog',
70
       showSelf: false,
95
       showSelf: false,
71
       zIndex: this.getZIndex(),
96
       zIndex: this.getZIndex(),
72
-      bodyOverflow: ''
97
+      bodyOverflow: '',
98
+      classDivAA: false,
99
+      myShareShow: false
73
     }
100
     }
74
   },
101
   },
75
   watch: {
102
   watch: {
76
     show(val) {
103
     show(val) {
77
       console.log('🚀 ~ file: Popup.vue ~ line 78 ~ show ~ val', val)
104
       console.log('🚀 ~ file: Popup.vue ~ line 78 ~ show ~ val', val)
78
       this.showSelf = val
105
       this.showSelf = val
106
+      if (this.show === false) {
107
+        this.myShareShow = false
108
+      }
109
+      this.transform()
79
 
110
 
80
       // if (!val) {
111
       // if (!val) {
81
       //   this.closeMyself()
112
       //   this.closeMyself()
89
   },
120
   },
90
   mounted() {
121
   mounted() {
91
     this.forbidScroll()
122
     this.forbidScroll()
123
+    if (this.show === true) {
124
+      this.transform()
125
+    }
92
   },
126
   },
93
   methods: {
127
   methods: {
128
+    shareClick() {
129
+      this.$router.replace({
130
+        path: 'SaveShare',
131
+        query: { states: 0 }
132
+      })
133
+    },
134
+    saveClick() {
135
+      this.$router.replace({
136
+        path: 'SaveShare',
137
+        query: { states: 1 }
138
+      })
139
+    },
140
+    transform() {
141
+      setTimeout(() => {
142
+        this.classDivAA = this.show
143
+      }, 0)
144
+    },
94
     /** 禁止页面滚动 */
145
     /** 禁止页面滚动 */
95
     forbidScroll() {
146
     forbidScroll() {
96
       this.bodyOverflow = document.body.style.overflow
147
       this.bodyOverflow = document.body.style.overflow
128
 
179
 
129
 <style lang="less" scoped>
180
 <style lang="less" scoped>
130
 // 弹窗动画
181
 // 弹窗动画
131
-.dialog-enter-active,
132
-.dialog-leave-active {
133
-  transition: opacity 1s;
134
-}
135
-
136
-.dialog-enter,
137
-.dialog-leave-to {
138
-  opacity: 0;
139
-}
140
 
182
 
141
 // 最外层 设置position定位
183
 // 最外层 设置position定位
142
 // 遮罩 设置背景层,z-index值要足够大确保能覆盖,高度 宽度设置满 做到全屏遮罩
184
 // 遮罩 设置背景层,z-index值要足够大确保能覆盖,高度 宽度设置满 做到全屏遮罩
163
     display: flex;
205
     display: flex;
164
     align-items: center;
206
     align-items: center;
165
     justify-content: center;
207
     justify-content: center;
208
+    .sharetiptxt {
209
+      background-size: 100% auto;
210
+      background-repeat: no-repeat;
211
+      z-index: 55;
212
+      width: 20px;
213
+      height: 320px;
214
+      display: block;
215
+      position: absolute;
216
+      right: 1rem;
217
+      top: 0.5em;
218
+      animation: tipup 1s ease infinite;
219
+    }
220
+  }
221
+}
222
+@keyframes tipup {
223
+  0% {
224
+    transform: translateY(0%);
225
+  }
226
+  50% {
227
+    transform: translateY(5%);
228
+  }
229
+  100% {
230
+    transform: translateY(0%);
166
   }
231
   }
167
 }
232
 }
168
 
233
 
185
     overflow-y: scroll;
250
     overflow-y: scroll;
186
     padding: 0 15px 20px 15px;
251
     padding: 0 15px 20px 15px;
187
     //中间卡片
252
     //中间卡片
188
-    .dialog-popuImag {
189
-      position: relative;
253
+    .card-wrapper {
254
+      perspective: 600px;
190
 
255
 
191
-      display: flex;
192
-      justify-content: center;
193
-      img {
194
-        width: 48vw;
256
+      .dialog-popuImag {
257
+        position: relative;
258
+        display: flex;
259
+        justify-content: center;
260
+        transform-style: preserve-3d;
261
+        transition: all 1.2s ease;
262
+        // div {
263
+        //   // position: relative;
264
+        //   position: absolute;
265
+        //   width: 100%;
266
+        //   height: 100%;
267
+        //   /* 背面不显示 */
268
+        //   // backface-visibility: hidden;
269
+        // }
270
+        .front {
271
+        }
272
+        .back {
273
+          position: absolute;
274
+          transform: rotateY(180deg);
275
+
276
+          // animation: change 0.8s linear forwards;
277
+        }
278
+
279
+        img {
280
+          width: 48vw;
281
+        }
282
+      }
283
+      .flipped {
284
+        animation: change 0.8s linear forwards;
285
+      }
286
+    }
287
+    @keyframes change {
288
+      from {
289
+        top: -20vh;
290
+        left: -20vw;
291
+        opacity: 0;
292
+        transform: scale(0.5);
293
+      }
294
+      to {
295
+        top: -0;
296
+        left: -0;
297
+        opacity: 2;
298
+        transform: scale(1);
299
+        transform: rotateY(180deg);
195
       }
300
       }
196
     }
301
     }
197
     //底部按钮
302
     //底部按钮

+ 8
- 1
src/router/index.js View File

3
 import Vue from 'vue'
3
 import Vue from 'vue'
4
 import Router from 'vue-router'
4
 import Router from 'vue-router'
5
 import Honghe from '@/components/Honghe'
5
 import Honghe from '@/components/Honghe'
6
-
6
+import SaveShare from '@/components/SaveShare'
7
 // import Login from '@/Login.vue'
7
 // import Login from '@/Login.vue'
8
 
8
 
9
 Vue.use(Router)
9
 Vue.use(Router)
25
       component: Honghe,
25
       component: Honghe,
26
 
26
 
27
     },
27
     },
28
+    {
29
+      path: '/SaveShare',
30
+      name: 'SaveShare',
31
+      component: SaveShare,
32
+
33
+    },
34
+
28
 
35
 
29
 
36
 
30
 
37
 

+ 4
- 4
src/utils/wx.js View File

54
  * 获取 code
54
  * 获取 code
55
  * @returns 
55
  * @returns 
56
  */
56
  */
57
-function getCode() {
57
+function getCode () {
58
   const matched = /[?&]*code=([^&]+)/.exec(location.search)
58
   const matched = /[?&]*code=([^&]+)/.exec(location.search)
59
   if (matched) {
59
   if (matched) {
60
     return decodeURIComponent(matched[1])
60
     return decodeURIComponent(matched[1])
64
 /**
64
 /**
65
  * 跳转授权页面
65
  * 跳转授权页面
66
  */
66
  */
67
-export function redirect() {
67
+export function redirect () {
68
   if (process.env.NODE_ENV === 'development') return;
68
   if (process.env.NODE_ENV === 'development') return;
69
 
69
 
70
   const originCode = localStorage.getItem('wxcode');
70
   const originCode = localStorage.getItem('wxcode');
71
   const queryCode = getCode();
71
   const queryCode = getCode();
72
   localStorage.setItem('wxcode', queryCode)
72
   localStorage.setItem('wxcode', queryCode)
73
 
73
 
74
-  if (!queryCode || queryCode !== originCode) {
74
+  if (!queryCode || queryCode === originCode) {
75
     const local = encodeURIComponent(location.origin + location.pathname)
75
     const local = encodeURIComponent(location.origin + location.pathname)
76
     const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd3bab568bc42d1de&redirect_uri=${local}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`
76
     const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd3bab568bc42d1de&redirect_uri=${local}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`
77
     window.location.href = url
77
     window.location.href = url
82
  * 获取 openid
82
  * 获取 openid
83
  * @returns 
83
  * @returns 
84
  */
84
  */
85
-export function getOpenId() {
85
+export function getOpenId () {
86
   if (process.env.NODE_ENV === 'development') return Promise.resolve('123');
86
   if (process.env.NODE_ENV === 'development') return Promise.resolve('123');
87
 
87
 
88
   const code = getCode()
88
   const code = getCode()