Baozhangchao 3 лет назад
Родитель
Сommit
5e3384f47d
4 измененных файлов: 72 добавлений и 102 удалений
  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 Просмотреть файл

@@ -1,16 +1,21 @@
1 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 17
       <div>
13
-        <div v-if="item==0">
18
+        <div v-if="stater==0">
14 19
           <!-- 领取屏保 -->
15 20
           <div class="outer3 flex-col">
16 21
             <div class="haibao">
@@ -28,7 +33,7 @@
28 33
             </div>
29 34
           </div>
30 35
         </div>
31
-        <div v-else>
36
+        <div v-else style="overflow: auto;height:100vh;">
32 37
           <!-- 挂历 -->
33 38
           <div class="page flex-col">
34 39
             <div class="group1 flex-col">
@@ -55,7 +60,7 @@
55 60
 import { hideLoading } from '@/utils'
56 61
 
57 62
 export default {
58
-  name: 'SaveShare',
63
+  name: 'ClickDIV',
59 64
   components: {
60 65
     ShaerPopup: () => import('@/components/ShaerPopup.vue')
61 66
   },
@@ -69,12 +74,15 @@ export default {
69 74
       type: String,
70 75
       default: '取消',
71 76
       required: false
77
+    },
78
+
79
+    stater: {
80
+      type: Number
72 81
     }
73 82
   },
74 83
 
75 84
   data() {
76 85
     return {
77
-      item: null,
78 86
       shaerShow: false,
79 87
       backimg: require('../assets/saverShaerImg/back.png'),
80 88
       shaerBut: require('../assets/saverShaerImg/shaerLucky.png'),
@@ -85,39 +93,44 @@ export default {
85 93
   },
86 94
 
87 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 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 134
     transform() {
122 135
       setTimeout(() => {
123 136
         this.classDivAA = this.show
@@ -135,11 +148,6 @@ export default {
135 148
       return zIndexInit++
136 149
     },
137 150
 
138
-    /** 取消按钮操作 */
139
-    cancel() {
140
-      // this.$emit('cancel', true)
141
-    },
142
-
143 151
     /** 确认按钮操作 */
144 152
     confirm() {
145 153
       this.$emit('confirm', true)
@@ -153,8 +161,7 @@ export default {
153 161
 
154 162
     /** 恢复页面的滚动 */
155 163
     sloveBodyOverflow() {
156
-      this.showSelf = false
157
-
164
+      // this.showSelf = false
158 165
       document.body.style.overflow = this.bodyOverflow
159 166
     }
160 167
   }
@@ -250,7 +257,7 @@ export default {
250 257
     .group1 {
251 258
       .wrap3 {
252 259
         z-index: 13;
253
-        width: 98vw;
260
+        width: 100vw;
254 261
         overflow: hidden;
255 262
         align-self: center;
256 263
         margin-top: 1vw;
@@ -265,7 +272,6 @@ export default {
265 272
       .wrap5 {
266 273
         height: 137px;
267 274
         background-color: #efe9e0;
268
-        margin-top: 19px;
269 275
         width: 100vw;
270 276
         justify-content: center;
271 277
         align-items: center;

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

@@ -1,13 +1,13 @@
1 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 5
     <div class="dialog-mark" @click.self="closeMyself">
6 6
       <div v-show="myShareShow" class="sharetiptxt" style>
7 7
         <img style="width:100%; height:100%;" src="../assets/popupImg/myShare.png" alt />
8 8
       </div>
9 9
       <transition name="dialog">
10
-        <div class="dialog-sprite" :style="{'z-index': zIndex + 2}">
10
+        <div class="dialog-sprite">
11 11
           <div class="dialog-body">
12 12
             <div class="card-wrapper">
13 13
               <div :class="`dialog-popuImag ${classDivAA?'flipped':''}`">
@@ -32,18 +32,17 @@
32 32
           </div>
33 33
           <!-- 右侧 -->
34 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 36
               <img src="../assets/popupImg/shareImage.png" alt />
37 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 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 46
             </div>
48 47
           </div>
49 48
         </div>
@@ -64,29 +63,11 @@ export default {
64 63
       default: false,
65 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 67
     cancelText: {
77 68
       type: String,
78 69
       default: '取消',
79 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,7 +79,8 @@ export default {
98 79
       bodyOverflow: '',
99 80
       classDivAA: false,
100 81
       myShareShow: false,
101
-      showPopupClickDIV: false
82
+      showPopupClickDIV: false,
83
+      stater: null
102 84
     }
103 85
   },
104 86
   watch: {
@@ -127,6 +109,9 @@ export default {
127 109
     }
128 110
   },
129 111
   methods: {
112
+    canckle() {
113
+      this.showPopupClickDIV = false
114
+    },
130 115
     shareClick() {
131 116
       this.$router.replace({
132 117
         path: 'SaveShare',
@@ -195,7 +180,7 @@ export default {
195 180
 
196 181
   // 内容层 z-index要比遮罩大,否则会被遮盖
197 182
   .dialog-mark {
198
-    position: absolute;
183
+    position: relative;
199 184
     top: 0;
200 185
     height: 0;
201 186
     width: 100%;

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

@@ -39,7 +39,7 @@
39 39
 
40 40
 <script>
41 41
 export default {
42
-  name: 'Popup',
42
+  name: 'ShaerPopup',
43 43
 
44 44
   props: {
45 45
     show: {
@@ -70,7 +70,6 @@ export default {
70 70
       console.log('🚀 ~ file: Popup.vue ~ line 78 ~ show ~ val', val)
71 71
       this.showSelf = val
72 72
 
73
-      this.transform()
74 73
       // this.closeMyself()
75 74
 
76 75
       // if (!val) {
@@ -85,28 +84,8 @@ export default {
85 84
   },
86 85
   mounted() {
87 86
     this.forbidScroll()
88
-    if (this.show === true) {
89
-      this.transform()
90
-    }
91 87
   },
92 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 90
     forbidScroll() {
112 91
       this.bodyOverflow = document.body.style.overflow

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

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