Просмотр исходного кода

Merge branch 'master' of http://git.ycjcjy.com/honghe/h5-draw-lots into master

张延森 3 лет назад
Родитель
Сommit
f2e2f508eb
5 измененных файлов: 431 добавлений и 53 удалений
  1. Двоичные данные
      src/assets/ShaerPopupImg/popuBgc.jpg
  2. Двоичные данные
      src/assets/ShaerPopupImg/popuSave.png
  3. 4
    0
      src/components/Popup.vue
  4. 339
    0
      src/components/ShaerPopup.vue
  5. 88
    53
      src/pages/SaveShare.vue

Двоичные данные
src/assets/ShaerPopupImg/popuBgc.jpg Просмотреть файл


Двоичные данные
src/assets/ShaerPopupImg/popuSave.png Просмотреть файл


+ 4
- 0
src/components/Popup.vue Просмотреть файл

@@ -246,9 +246,11 @@ export default {
246 246
     overflow-x: hidden;
247 247
     overflow-y: scroll;
248 248
     padding: 0 15px 20px 15px;
249
+
249 250
     //中间卡片
250 251
     .card-wrapper {
251 252
       perspective: 600px;
253
+      margin-top: 2em;
252 254
 
253 255
       .dialog-popuImag {
254 256
         position: relative;
@@ -256,6 +258,7 @@ export default {
256 258
         justify-content: center;
257 259
         transform-style: preserve-3d;
258 260
         transition: all 1.2s ease;
261
+
259 262
         // div {
260 263
         //   // position: relative;
261 264
         //   position: absolute;
@@ -317,6 +320,7 @@ export default {
317 320
     flex-direction: column;
318 321
     width: 36px;
319 322
     justify-content: space-between;
323
+    margin-top: 2em;
320 324
 
321 325
     img {
322 326
       width: 36px;

+ 339
- 0
src/components/ShaerPopup.vue Просмотреть файл

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

+ 88
- 53
src/pages/SaveShare.vue Просмотреть файл

@@ -1,5 +1,9 @@
1 1
 <template>
2
-  <div style="background-color:#c1172d; height:100vh; width:100%;">
2
+  <div style=" height:100vh; width:100%;">
3
+    <!-- 弹窗 -->
4
+    <ShaerPopup :show="shaerShow" @closeMyself="cancelFrom" />
5
+    <!-- 弹窗 -->
6
+
3 7
     <router-link :to="{path:'/'}">
4 8
       <div class="backhome" :style="`background:url('${backimg}');background-size: 100% auto;`"></div>
5 9
     </router-link>
@@ -13,7 +17,11 @@
13 17
           </div>
14 18
           <div class="mod2 flex-col">
15 19
             <div class="block1 flex-col">
16
-              <div class="section1 flex-col" :style="`background-image: url(${shaerBut});`"></div>
20
+              <div
21
+                class="section1 flex-col"
22
+                @click="()=>{this.shaerShow=true}"
23
+                :style="`background-image: url(${shaerBut});`"
24
+              ></div>
17 25
               <span :style="`background-image: url(${pressImage});`" class="info2"></span>
18 26
             </div>
19 27
           </div>
@@ -21,12 +29,20 @@
21 29
       </div>
22 30
       <div v-else>
23 31
         <!-- 挂历 -->
24
-        <div class="wrap3 flex-col">
25
-          <img src class="subhaibao" />
26
-        </div>
27
-        <div class="wrap5 flex-col">
28
-          <span class="txt1" :style="`background-image: url(${pressLucky});`"></span>
29
-          <div class="main5 flex-col" :style="`background-image: url(${shaerButRed});`"></div>
32
+        <div class="page flex-col">
33
+          <div class="group1 flex-col">
34
+            <div class="wrap3 flex-col">
35
+              <img src="../assets/saverShaerImg/calendar.jpg" class="subhaibao" />
36
+            </div>
37
+            <div class="wrap5 flex-col">
38
+              <span class="txt1" :style="`background-image: url(${pressLucky});`"></span>
39
+              <div
40
+                class="main5 flex-col"
41
+                :style="`background-image: url(${shaerButRed});`"
42
+                @click="()=>{this.shaerShow=true}"
43
+              ></div>
44
+            </div>
45
+          </div>
30 46
         </div>
31 47
       </div>
32 48
     </div>
@@ -35,11 +51,14 @@
35 51
 
36 52
 <script>
37 53
 export default {
38
-  name: '',
39
-
54
+  name: 'SaveShare',
55
+  components: {
56
+    ShaerPopup: () => import('@/components/ShaerPopup.vue')
57
+  },
40 58
   data() {
41 59
     return {
42 60
       item: null,
61
+      shaerShow: false,
43 62
       backimg: require('../assets/saverShaerImg/back.png'),
44 63
       shaerBut: require('../assets/saverShaerImg/shaerLucky.png'),
45 64
       pressImage: require('../assets/saverShaerImg/PressImage.png'),
@@ -61,6 +80,11 @@ export default {
61 80
       },
62 81
       immediate: true // 页面加载时就启动
63 82
     }
83
+  },
84
+  methods: {
85
+    cancelFrom() {
86
+      this.shaerShow = false
87
+    }
64 88
   }
65 89
 }
66 90
 </script>
@@ -124,49 +148,60 @@ export default {
124 148
     }
125 149
   }
126 150
 }
127
-.wrap3 {
128
-  z-index: 13;
129
-  position: relative;
130
-  width: 98vw;
131
-  overflow: hidden;
132
-  align-self: center;
133
-  margin-top: 1vw;
134
-  margin-left: 0;
135
-  .subhaibao {
136
-    position: absolute;
137
-    width: 100%;
138
-    left: 0;
139
-    top: 0;
140
-  }
141
-}
142
-.wrap5 {
143
-  height: 137px;
144
-  background-color: #efe9e0;
145
-  margin-top: 19px;
146
-  width: 100vw;
147
-  justify-content: center;
148
-  align-items: center;
149
-  display: flex;
150
-  .txt1 {
151
-    background-size: 100% auto;
152
-    background-repeat: no-repeat;
153
-    width: 112px;
154
-    height: 18px;
155
-    margin-bottom: 80px;
156
-  }
157
-}
158 151
 
159
-.main5 {
160
-  background-size: 100% auto;
161
-  background-repeat: no-repeat;
162
-  height: 48px;
163
-  border-radius: 8px;
164
-  margin-top: 11px;
165
-  width: 343px;
166
-  background-color: #c1172d;
167
-  border: 0;
168
-  position: fixed;
169
-  z-index: 15;
170
-  bottom: 5vh;
152
+// 第二个页面
153
+.page {
154
+  // z-index: 1;
155
+  // position: relative;
156
+  // overflow-y: auto;
157
+  // width: 100vw;
158
+  // height: 100vh;
159
+
160
+  .group1 {
161
+    .wrap3 {
162
+      z-index: 13;
163
+      width: 98vw;
164
+      overflow: hidden;
165
+      align-self: center;
166
+      margin-top: 1vw;
167
+      margin-left: 0;
168
+      .subhaibao {
169
+        // position: absolute;
170
+        width: 100%;
171
+        left: 0;
172
+        top: 0;
173
+      }
174
+    }
175
+    .wrap5 {
176
+      height: 137px;
177
+      background-color: #efe9e0;
178
+      margin-top: 19px;
179
+      width: 100vw;
180
+      justify-content: center;
181
+      align-items: center;
182
+      display: flex;
183
+      .txt1 {
184
+        background-size: 100% auto;
185
+        background-repeat: no-repeat;
186
+        width: 112px;
187
+        height: 18px;
188
+        margin-bottom: 80px;
189
+      }
190
+    }
191
+
192
+    .main5 {
193
+      background-size: 100% auto;
194
+      background-repeat: no-repeat;
195
+      height: 48px;
196
+      border-radius: 8px;
197
+      margin-top: 11px;
198
+      width: 343px;
199
+      background-color: #c1172d;
200
+      border: 0;
201
+      position: fixed;
202
+      z-index: 15;
203
+      bottom: 5vh;
204
+    }
205
+  }
171 206
 }
172 207
 </style>