陈冉 před 6 roky
rodič
revize
87441d79f1
3 změnil soubory, kde provedl 39 přidání a 22 odebrání
  1. binární
      src/assets/toast.gif
  2. 39
    18
      src/views/vote/signup.vue
  3. 0
    4
      vue.config.js

binární
src/assets/toast.gif Zobrazit soubor


+ 39
- 18
src/views/vote/signup.vue Zobrazit soubor

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div :class="'context theme'+theme">
3
-    <div v-if="isLoading">
4
-      <img src="">
3
+    <div v-if="isLoading" class="prompttoast" @click="closetoast">
4
+      <img :src="BgImage">
5 5
     </div>
6 6
     <div class="ContextBox">
7 7
       <div class="uploadimg">
@@ -52,6 +52,7 @@
52 52
 <script>
53 53
 import { createNamespacedHelpers } from "vuex";
54 54
 import { Toast } from "vant";
55
+import BgImage from "../../assets/toast.gif";
55 56
 const {
56 57
   mapState: mapVoteState,
57 58
   mapActions: mapVoteActions
@@ -60,7 +61,8 @@ export default {
60 61
   name: "signup",
61 62
   data() {
62 63
     return {
63
-      isLoading:false,
64
+      BgImage,
65
+      isLoading: false,
64 66
       messagenum: 0,
65 67
       postData: {
66 68
         photo: "",
@@ -128,6 +130,7 @@ export default {
128 130
             .then(res => {
129 131
               that.uploadimg = res.result.url;
130 132
               that.postData.photo = res.result.url;
133
+              this.closetoast();
131 134
             })
132 135
             .catch(() => {
133 136
               that.isLoading = false;
@@ -135,6 +138,9 @@ export default {
135 138
         };
136 139
       };
137 140
     },
141
+    closetoast(){
142
+this.isLoading=false
143
+    },
138 144
     messageWrite() {
139 145
       this.messagenum = this.postData.message.length;
140 146
     },
@@ -147,16 +153,16 @@ export default {
147 153
         });
148 154
         return false;
149 155
       }
150
-      if(this.theme === 1 && this.postData.message == '') {
156
+      if (this.theme === 1 && this.postData.message == "") {
151 157
         Toast.fail({
152 158
           duration: 2000, // 持续展示 toast
153 159
           forbidClick: true, // 禁用背景点击
154 160
           message: "请先输入寄语!"
155
-        })
156
-        return false
161
+        });
162
+        return false;
157 163
       }
158 164
 
159
-      if(this.postData.phone == ""){
165
+      if (this.postData.phone == "") {
160 166
         Toast.fail({
161 167
           duration: 2000, // 持续展示 toast
162 168
           forbidClick: true, // 禁用背景点击
@@ -173,21 +179,21 @@ export default {
173 179
         });
174 180
         return false;
175 181
       }
176
-      if(this.postData.name == ""){
182
+      if (this.postData.name == "") {
177 183
         Toast.fail({
178 184
           duration: 2000, // 持续展示 toast
179 185
           forbidClick: true, // 禁用背景点击
180 186
           message: "请输入您的姓名!"
181
-        })
182
-        return false
187
+        });
188
+        return false;
183 189
       }
184
-      if(this.theme === 2 && this.postData.addr == '') {
190
+      if (this.theme === 2 && this.postData.addr == "") {
185 191
         Toast.fail({
186 192
           duration: 2000, // 持续展示 toast
187 193
           forbidClick: true, // 禁用背景点击
188 194
           message: "请输入您的所在社区!"
189
-        })
190
-        return false
195
+        });
196
+        return false;
191 197
       }
192 198
 
193 199
       this.voteMember({
@@ -211,7 +217,24 @@ export default {
211 217
   overflow-y: scroll;
212 218
   // display: flex;
213 219
   // justify-content: center;
220
+  .prompttoast {
221
+    width: 100%;
222
+    height: 100%;
223
+    background-color: rgba(1, 1, 1, 0.3);
224
+    display: flex;
225
+    justify-content: center;
226
+    align-items: center;
227
+    position: fixed;
228
+    top: 0;
229
+    left: 0;
230
+    z-index: 5;
214 231
 
232
+    img {
233
+      width: 1rem;
234
+      height: 1rem;
235
+      color: linear-gradient(#929292, #FFFFFF)
236
+    }
237
+  }
215 238
   .ContextBox {
216 239
     width: 94%;
217 240
     // height: 5.85rem;
@@ -266,12 +289,10 @@ export default {
266 289
         background: rgba(220, 229, 236, 0);
267 290
         line-height: 0.22rem;
268 291
         font-weight: bold;
269
-        color: rgba(112,125,138,0.96);
292
+        color: rgba(112, 125, 138, 0.96);
270 293
         padding-top: 0.08rem;
271 294
         margin-left: calc(4.5%);
272 295
         overflow-y: scroll;
273
-
274
-
275 296
       }
276 297
       .number {
277 298
         position: absolute;
@@ -279,7 +300,7 @@ export default {
279 300
         right: 0.05rem;
280 301
 
281 302
         #textNum {
282
-          color: rgba(112,125,138,0.96);
303
+          color: rgba(112, 125, 138, 0.96);
283 304
           font-size: 0.14rem;
284 305
           font-weight: bolder;
285 306
           line-height: 0.2rem;
@@ -384,7 +405,7 @@ export default {
384 405
   textarea::-webkit-input-placeholder {
385 406
     font-size: 0.16rem;
386 407
     font-weight: bolder;
387
-    color: rgba(112,125,138,1);
408
+    color: rgba(112, 125, 138, 1);
388 409
     line-height: 0.22rem;
389 410
   }
390 411
 }

+ 0
- 4
vue.config.js Zobrazit soubor

@@ -7,11 +7,7 @@ module.exports = {
7 7
     proxy: {
8 8
       '/voteapi': {
9 9
         // target: 'http://wechatconfigdev.ycjcjy.com',
10
-<<<<<<< HEAD
11 10
         target: 'http://192.168.0.62:8080', // wf
12
-=======
13
-        target: 'http://localhost:8080', // wf
14
->>>>>>> 83865c56adef1f6c6aea63317940c0a221574425
15 11
         // target: 'http://192.168.0.102:8080', // hyq
16 12
         // target: 'http://192.168.0.11:8080', // zys
17 13
         // target: 'http://dev.ycjcjy.com', // frp