Baozhangchao 3 years ago
parent
commit
5e3384f47d
4 changed files with 72 additions and 102 deletions
  1. 52
    46
      src/components/ClickDIV.vue
  2. 18
    33
      src/components/Popup.vue
  3. 1
    22
      src/components/ShaerPopup.vue
  4. 1
    1
      src/pages/SaveShare.vue

+ 52
- 46
src/components/ClickDIV.vue View File

1
 <template>
1
 <template>
2
-  <div v-if="showSelf" class="dialog" :style="{'z-index': zIndex}">
3
-    <div style=" height:100vh; width:100%;">
2
+  <div v-if="show" class="dialog-show">
3
+    <div style=" height:100vh; width:100%;
4
+    ">
4
       <!-- 弹窗 -->
5
       <!-- 弹窗 -->
5
-      <ShaerPopup :show="shaerShow" @closeMyself="cancelFrom" />
6
+      <ShaerPopup :show="shaerShow" @closeMyself="cancelPopup" />
6
       <!-- 弹窗 -->
7
       <!-- 弹窗 -->
7
 
8
 
8
-      <router-link :to="{path:'/'}">
9
-        <div class="backhome" :style="`background:url('${backimg}');background-size: 100% auto;`"></div>
10
-      </router-link>
9
+      <!-- <router-link :to="{path:'/'}"> -->
10
+      <div
11
+        class="backhome"
12
+        :style="`background:url('${backimg}');background-size: 100% auto;`"
13
+        @click="cancelPopupts"
14
+      ></div>
15
+      <!-- </router-link> -->
11
 
16
 
12
       <div>
17
       <div>
13
-        <div v-if="item==0">
18
+        <div v-if="stater==0">
14
           <!-- 领取屏保 -->
19
           <!-- 领取屏保 -->
15
           <div class="outer3 flex-col">
20
           <div class="outer3 flex-col">
16
             <div class="haibao">
21
             <div class="haibao">
28
             </div>
33
             </div>
29
           </div>
34
           </div>
30
         </div>
35
         </div>
31
-        <div v-else>
36
+        <div v-else style="overflow: auto;height:100vh;">
32
           <!-- 挂历 -->
37
           <!-- 挂历 -->
33
           <div class="page flex-col">
38
           <div class="page flex-col">
34
             <div class="group1 flex-col">
39
             <div class="group1 flex-col">
55
 import { hideLoading } from '@/utils'
60
 import { hideLoading } from '@/utils'
56
 
61
 
57
 export default {
62
 export default {
58
-  name: 'SaveShare',
63
+  name: 'ClickDIV',
59
   components: {
64
   components: {
60
     ShaerPopup: () => import('@/components/ShaerPopup.vue')
65
     ShaerPopup: () => import('@/components/ShaerPopup.vue')
61
   },
66
   },
69
       type: String,
74
       type: String,
70
       default: '取消',
75
       default: '取消',
71
       required: false
76
       required: false
77
+    },
78
+
79
+    stater: {
80
+      type: Number
72
     }
81
     }
73
   },
82
   },
74
 
83
 
75
   data() {
84
   data() {
76
     return {
85
     return {
77
-      item: null,
78
       shaerShow: false,
86
       shaerShow: false,
79
       backimg: require('../assets/saverShaerImg/back.png'),
87
       backimg: require('../assets/saverShaerImg/back.png'),
80
       shaerBut: require('../assets/saverShaerImg/shaerLucky.png'),
88
       shaerBut: require('../assets/saverShaerImg/shaerLucky.png'),
85
   },
93
   },
86
 
94
 
87
   watch: {
95
   watch: {
88
-    show(val) {
89
-      console.log('🚀 ~ file: ClickDIV.vue ~ line 89 ~ show ~ val', val)
90
-      this.showSelf = val
91
-      this.transform()
92
-    }
93
-  },
94
-  created() {
95
-    this.showSelf = this.show
96
-  },
97
-  mounted() {
98
-    hideLoading()
96
+    stater(val, res) {
97
+      console.log('🚀 ~ file: ClickDIV.vue ~ line 98 ~ stater ~ res', res)
98
+    },
99
+    created() {
100
+      // this.showSelf = this.show
101
+    },
102
+    mounted() {
103
+      hideLoading() //loading
99
 
104
 
100
-    this.forbidScroll()
101
-    if (this.show === true) {
102
-      this.transform()
105
+      this.forbidScroll()
106
+      if (this.show === true) {
107
+        this.transform()
108
+      }
103
     }
109
     }
104
   },
110
   },
105
   methods: {
111
   methods: {
106
-    cancelFrom() {
107
-      this.shaerShow = false
108
-    },
109
-    shareClick() {
110
-      this.$router.replace({
111
-        path: 'SaveShare',
112
-        query: { states: 0 }
113
-      })
112
+    /** 取消按钮操作 */
113
+    cancelPopupts() {
114
+      // this.shaerShow = false
115
+      // console.log(22222222222222222222222)
116
+      this.$emit('cancelPopus', true)
114
     },
117
     },
115
-    saveClick() {
116
-      this.$router.replace({
117
-        path: 'SaveShare',
118
-        query: { states: 1 }
119
-      })
118
+
119
+    cancelPopup() {
120
+      this.shaerShow = false
120
     },
121
     },
122
+    // shareClick() {
123
+    //   this.$router.replace({
124
+    //     path: 'SaveShare',
125
+    //     query: { states: 0 }
126
+    //   })
127
+    // },
128
+    // saveClick() {
129
+    //   this.$router.replace({
130
+    //     path: 'SaveShare',
131
+    //     query: { states: 1 }
132
+    //   })
133
+    // },
121
     transform() {
134
     transform() {
122
       setTimeout(() => {
135
       setTimeout(() => {
123
         this.classDivAA = this.show
136
         this.classDivAA = this.show
135
       return zIndexInit++
148
       return zIndexInit++
136
     },
149
     },
137
 
150
 
138
-    /** 取消按钮操作 */
139
-    cancel() {
140
-      // this.$emit('cancel', true)
141
-    },
142
-
143
     /** 确认按钮操作 */
151
     /** 确认按钮操作 */
144
     confirm() {
152
     confirm() {
145
       this.$emit('confirm', true)
153
       this.$emit('confirm', true)
153
 
161
 
154
     /** 恢复页面的滚动 */
162
     /** 恢复页面的滚动 */
155
     sloveBodyOverflow() {
163
     sloveBodyOverflow() {
156
-      this.showSelf = false
157
-
164
+      // this.showSelf = false
158
       document.body.style.overflow = this.bodyOverflow
165
       document.body.style.overflow = this.bodyOverflow
159
     }
166
     }
160
   }
167
   }
250
     .group1 {
257
     .group1 {
251
       .wrap3 {
258
       .wrap3 {
252
         z-index: 13;
259
         z-index: 13;
253
-        width: 98vw;
260
+        width: 100vw;
254
         overflow: hidden;
261
         overflow: hidden;
255
         align-self: center;
262
         align-self: center;
256
         margin-top: 1vw;
263
         margin-top: 1vw;
265
       .wrap5 {
272
       .wrap5 {
266
         height: 137px;
273
         height: 137px;
267
         background-color: #efe9e0;
274
         background-color: #efe9e0;
268
-        margin-top: 19px;
269
         width: 100vw;
275
         width: 100vw;
270
         justify-content: center;
276
         justify-content: center;
271
         align-items: center;
277
         align-items: center;

+ 18
- 33
src/components/Popup.vue View File

1
 <template>
1
 <template>
2
-  <div v-if="showSelf" class="dialog" :style="{'z-index': zIndex}">
3
-    <ClickDIV :show="showPopupClickDIV" @cancel="cancelFrom" />
2
+  <div v-if="showSelf" class="dialog">
3
+    <ClickDIV :show="showPopupClickDIV" @cancelPopus="canckle" :stater="stater" />
4
 
4
 
5
     <div class="dialog-mark" @click.self="closeMyself">
5
     <div class="dialog-mark" @click.self="closeMyself">
6
       <div v-show="myShareShow" class="sharetiptxt" style>
6
       <div v-show="myShareShow" class="sharetiptxt" style>
7
         <img style="width:100%; height:100%;" src="../assets/popupImg/myShare.png" alt />
7
         <img style="width:100%; height:100%;" src="../assets/popupImg/myShare.png" alt />
8
       </div>
8
       </div>
9
       <transition name="dialog">
9
       <transition name="dialog">
10
-        <div class="dialog-sprite" :style="{'z-index': zIndex + 2}">
10
+        <div class="dialog-sprite">
11
           <div class="dialog-body">
11
           <div class="dialog-body">
12
             <div class="card-wrapper">
12
             <div class="card-wrapper">
13
               <div :class="`dialog-popuImag ${classDivAA?'flipped':''}`">
13
               <div :class="`dialog-popuImag ${classDivAA?'flipped':''}`">
32
           </div>
32
           </div>
33
           <!-- 右侧 -->
33
           <!-- 右侧 -->
34
           <div class="section-box">
34
           <div class="section-box">
35
-            <div class="section-box-share" @click="()=>{this.showPopupClickDIV=true}">
35
+            <div class="section-box-share" @click="()=>{this.myShareShow=true}">
36
               <img src="../assets/popupImg/shareImage.png" alt />
36
               <img src="../assets/popupImg/shareImage.png" alt />
37
             </div>
37
             </div>
38
-            <div class="section-box-receive">
39
-              <router-link :to="{path:'SaveShare',query: {  states: 0 }}">
40
-                <img src="../assets/popupImg/receiveImage.png" alt />
41
-              </router-link>
38
+            <div
39
+              class="section-box-receive"
40
+              @click="()=>{this.showPopupClickDIV=true,this.stater=0}"
41
+            >
42
+              <img src="../assets/popupImg/receiveImage.png" alt />
42
             </div>
43
             </div>
43
-            <div class="section-box-save">
44
-              <router-link :to="{path:'SaveShare',query: {  states: 1 }}">
45
-                <img src="../assets/popupImg/saveImage.png" alt />
46
-              </router-link>
44
+            <div class="section-box-save" @click="()=>{this.showPopupClickDIV=true,this.stater=1}">
45
+              <img src="../assets/popupImg/saveImage.png" alt />
47
             </div>
46
             </div>
48
           </div>
47
           </div>
49
         </div>
48
         </div>
64
       default: false,
63
       default: false,
65
       required: true
64
       required: true
66
     },
65
     },
67
-    title: {
68
-      type: String,
69
-      required: true
70
-    },
71
-    showCancel: {
72
-      typs: Boolean,
73
-      default: false,
74
-      required: false
75
-    },
66
+
76
     cancelText: {
67
     cancelText: {
77
       type: String,
68
       type: String,
78
       default: '取消',
69
       default: '取消',
79
       required: false
70
       required: false
80
-    },
81
-    confirmText: {
82
-      type: String,
83
-      default: '确定',
84
-      required: false
85
-    },
86
-    LoadingShow: {
87
-      type: Boolean,
88
-      default: false,
89
-      required: true
90
     }
71
     }
91
   },
72
   },
92
 
73
 
98
       bodyOverflow: '',
79
       bodyOverflow: '',
99
       classDivAA: false,
80
       classDivAA: false,
100
       myShareShow: false,
81
       myShareShow: false,
101
-      showPopupClickDIV: false
82
+      showPopupClickDIV: false,
83
+      stater: null
102
     }
84
     }
103
   },
85
   },
104
   watch: {
86
   watch: {
127
     }
109
     }
128
   },
110
   },
129
   methods: {
111
   methods: {
112
+    canckle() {
113
+      this.showPopupClickDIV = false
114
+    },
130
     shareClick() {
115
     shareClick() {
131
       this.$router.replace({
116
       this.$router.replace({
132
         path: 'SaveShare',
117
         path: 'SaveShare',
195
 
180
 
196
   // 内容层 z-index要比遮罩大,否则会被遮盖
181
   // 内容层 z-index要比遮罩大,否则会被遮盖
197
   .dialog-mark {
182
   .dialog-mark {
198
-    position: absolute;
183
+    position: relative;
199
     top: 0;
184
     top: 0;
200
     height: 0;
185
     height: 0;
201
     width: 100%;
186
     width: 100%;

+ 1
- 22
src/components/ShaerPopup.vue View File

39
 
39
 
40
 <script>
40
 <script>
41
 export default {
41
 export default {
42
-  name: 'Popup',
42
+  name: 'ShaerPopup',
43
 
43
 
44
   props: {
44
   props: {
45
     show: {
45
     show: {
70
       console.log('🚀 ~ file: Popup.vue ~ line 78 ~ show ~ val', val)
70
       console.log('🚀 ~ file: Popup.vue ~ line 78 ~ show ~ val', val)
71
       this.showSelf = val
71
       this.showSelf = val
72
 
72
 
73
-      this.transform()
74
       // this.closeMyself()
73
       // this.closeMyself()
75
 
74
 
76
       // if (!val) {
75
       // if (!val) {
85
   },
84
   },
86
   mounted() {
85
   mounted() {
87
     this.forbidScroll()
86
     this.forbidScroll()
88
-    if (this.show === true) {
89
-      this.transform()
90
-    }
91
   },
87
   },
92
   methods: {
88
   methods: {
93
-    shareClick() {
94
-      this.$router.replace({
95
-        path: 'SaveShare',
96
-        query: { states: 0 }
97
-      })
98
-    },
99
-    saveClick() {
100
-      this.$router.replace({
101
-        path: 'SaveShare',
102
-        query: { states: 1 }
103
-      })
104
-    },
105
-    transform() {
106
-      setTimeout(() => {
107
-        this.classDivAA = this.show
108
-      }, 0)
109
-    },
110
     /** 禁止页面滚动 */
89
     /** 禁止页面滚动 */
111
     forbidScroll() {
90
     forbidScroll() {
112
       this.bodyOverflow = document.body.style.overflow
91
       this.bodyOverflow = document.body.style.overflow

+ 1
- 1
src/pages/SaveShare.vue View File

192
     .wrap5 {
192
     .wrap5 {
193
       height: 137px;
193
       height: 137px;
194
       background-color: #efe9e0;
194
       background-color: #efe9e0;
195
-      margin-top: 19px;
195
+      // margin-top: 19px;
196
       width: 100vw;
196
       width: 100vw;
197
       justify-content: center;
197
       justify-content: center;
198
       align-items: center;
198
       align-items: center;