Răsfoiți Sursa

fix: 车牌管理刷新异常

John-Hong 2 ani în urmă
părinte
comite
eccc229559

+ 43 - 14
src/pages/parkingFee/parkingReceipt/parkingApplication.vue

@@ -205,6 +205,8 @@ import { mapState } from 'vuex';
 // import MemberCacheTool from '@/utils/member-cache-tool.js';
 import uni from '@/utils/uniHooks';
 import { getUrlParams } from '@/utils/index.js';
+import { Dialog, Toast } from 'vant';
+
 export default {
   data() {
     return {
@@ -364,18 +366,24 @@ export default {
             self.headerInfo = headerInfo;
             // console.log('发票抬头--', self.headerInfo);
           } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
+            // uni.showToast({
+            //   title: res.data.msg,
+            //   duration: 2000,
+            //   icon: 'none',
+            // });
+            Toast({
+              message: res.data.msg,
             });
           }
         },
         fail: () => {
-          uni.showToast({
+          Toast({
+            message: '服务器开小差了呢,请您稍后再试',
+          });
+          /* uni.showToast({
             title: '服务器开小差了呢,请您稍后再试',
             icon: 'none',
-          });
+          }); */
         },
       });
     },
@@ -404,17 +412,23 @@ export default {
             self.invoiceAmount = (datas.invoiceAmount / 100).toFixed(2);
             self.orderInfo = datas.list[0];
           } else {
-            uni.showToast({
+            /* uni.showToast({
               title: res.data.msg,
               duration: 2000,
               icon: 'none',
+            }); */
+            Toast({
+              message: res.data.msg,
             });
           }
         },
         fail: () => {
-          uni.showToast({
+          /* uni.showToast({
             title: '服务器开小差了呢,请您稍后再试',
             icon: 'none',
+          }); */
+          Toast({
+            message: '服务器开小差了呢,请您稍后再试',
           });
         },
       });
@@ -450,28 +464,37 @@ export default {
               this.condition.mailbox = '';
             }
           } else {
-            uni.showToast({
+            /* uni.showToast({
               title: res.data.msg,
               duration: 2000,
               icon: 'none',
+            }); */
+            Toast({
+              message: res.data.msg,
             });
           }
         },
         fail: () => {
-          uni.showToast({
+          Toast({
             title: '服务器开小差了呢,请您稍后再试',
-            icon: 'none',
           });
+          /* uni.showToast({
+            title: '服务器开小差了呢,请您稍后再试',
+            icon: 'none',
+          }); */
         },
       });
     },
     submit() {
       const self = this;
       if (!self.condition.mailbox) {
-        uni.showToast({
+        /* uni.showToast({
           title: '请输入电子邮箱地址',
           duration: 2000,
           icon: 'none',
+        }); */
+        Toast({
+          message: '请输入电子邮箱地址',
         });
         return false;
       }
@@ -526,18 +549,24 @@ export default {
               //     res.data.data.id,
               // })
             } else {
-              uni.showToast({
+              /* uni.showToast({
                 title: res.data.msg,
                 duration: 2000,
                 icon: 'none',
+              }); */
+              Toast({
+                message: res.data.msg,
               });
             }
           },
           fail: () => {
             self.isSubmitFlag = true;
-            uni.showToast({
+            /* uni.showToast({
               title: '服务器开小差了呢,请您稍后再试',
               icon: 'none',
+            }); */
+            oast({
+              message: '服务器开小差了呢,请您稍后再试',
             });
           },
         });

+ 40 - 14
src/pages/parkingFee/vehicleAddOrEdit.vue

@@ -221,7 +221,7 @@ import uniPop from '@/components/uni-popup/uni-popup.vue';
 import plateNumber from '@/components/plate-number/plateNumber.vue';
 // const app = getApp()
 import uni from '@/utils/uniHooks';
-import { Dialog } from 'vant';
+import { Dialog, Toast } from 'vant';
 
 const app = {};
 import { LICENSE_PLATE_TYPE_ARR } from '@/constants.js';
@@ -402,13 +402,22 @@ export default {
                 //   duration: 1300,
                 //   icon: 'none',
                 // });
-                Dialog.alert({
+                Toast({
+                  message: '绑定车牌成功',
+                  onClose: () => {
+                    this.$router.replace({
+                      path: `vehicleManagement`,
+                    });
+                    // this.$router.back();
+                  },
+                });
+                /* Dialog.alert({
                   message: '绑定车牌成功',
                   confirmButtonColor: '#333',
                 }).then(() => {
                   // on confirm
                   this.$router.back();
-                });
+                }); */
                 // setTimeout(() => {
                 //   this.$router.back();
                 // }, 1500);
@@ -420,13 +429,16 @@ export default {
               //   duration: 2000,
               //   icon: 'none',
               // });
-              Dialog.alert({
+              Toast({
+                message: message,
+              });
+              /* Dialog.alert({
                 message: message,
                 confirmButtonColor: '#333',
               }).then(() => {
                 // on confirm
                 // this.$router.back();
-              });
+              }); */
             }
           })
           .catch((err) => {
@@ -437,13 +449,16 @@ export default {
             //   duration: 2000,
             //   icon: 'none',
             // });
-            Dialog.alert({
+            Toast({
+              message: '修改车牌失败',
+            });
+            /* Dialog.alert({
               message: '修改车牌失败',
               confirmButtonColor: '#333',
             }).then(() => {
               // on confirm
               // this.$router.back();
-            });
+            }); */
           });
       } else {
         kipAddMemberVehicles(
@@ -464,7 +479,10 @@ export default {
                   confirmButtonColor: '#333',
                 }).then(() => {
                   // on confirm
-                  this.$router.back();
+                  this.$router.replace({
+                    path: `vehicleManagement`,
+                  });
+                  // this.$router.back();
                 });
                 // setTimeout(() => {
                 //   // this.$router.back();
@@ -480,31 +498,39 @@ export default {
               //   duration: 2000,
               //   icon: 'none',
               // });
-              Dialog.alert({
+              Toast({
+                message: message,
+              });
+              /* Dialog.alert({
                 message: message,
                 confirmButtonColor: '#333',
               }).then(() => {
                 // on confirm
                 // this.$router.back();
-              });
+              }); */
             }
           })
           .catch((err) => {
             uni.hideLoading();
-            console.log(366);
-            console.error(err);
+            // console.log(366);
+            // console.error(err);
             // uni.showToast({
             //   title: '绑定车牌失败',
             //   duration: 2000,
             //   icon: 'none',
             // });
-            Dialog.alert({
+
+            Toast({
+              message: '绑定车牌失败',
+            });
+
+            /* Dialog.alert({
               message: '绑定车牌失败',
               confirmButtonColor: '#333',
             }).then(() => {
               // on confirm
               // this.$router.back();
-            });
+            }); */
           });
       }
     },

+ 2 - 2
src/pages/parkingFee/vehicleManagement.vue

@@ -260,7 +260,7 @@ export default {
   methods: {
     // 添加车牌号
     toAdd() {
-      this.$router.push({ path: '/vehicleAddOrEdit' });
+      this.$router.replace({ path: '/vehicleAddOrEdit' });
     },
     // 跳转支付页面
     toPay(carno) {
@@ -335,7 +335,7 @@ export default {
         carno_old: item.vehicleNo,
         redirect_url: 'pages/parkingFee/vehicleAddOrEdit',
       });
-      this.$router.push({
+      this.$router.replace({
         path: `/vehicleAddOrEdit?id=${id}&carno=${vehicleNo}&carType=${carType}`,
       });
     },