Эх сурвалжийг харах

Merge pull request #92 from John-Hong/release-2.8.0

车辆管理ui优化
Tron 2 жил өмнө
parent
commit
235f3004ad

+ 18 - 10
src/pages/parkingFee/mixins/vehicleAddOrEdit.js

@@ -170,12 +170,14 @@ export default {
             uni.hideLoading();
             if (result && result.code == '000000') {
               if (result.data) {
-                console.log(22);
                 Toast({
                   message: '修改车牌成功',
+                  position: 'top',
                   onClose: () => {
-                    this.$router.back();
-                  },
+                    this.$router.replace({
+                      path: `vehicleManagement`,
+                    });
+                  }
                 });
               }
             } else {
@@ -189,6 +191,7 @@ export default {
             uni.hideLoading();
             Toast({
               message: '修改车牌失败',
+              position: 'top',
             });
           });
       } else {
@@ -201,7 +204,16 @@ export default {
             // const result = resp.data;
             if (result && result.code == '000000') {
               if (result.data) {
-                Dialog.alert({
+                Toast({
+                  message: '绑定车牌成功',
+                  position: 'top',
+                  onClose: () => {
+                    this.$router.replace({
+                      path: `vehicleManagement`,
+                    });
+                  }
+                });
+               /* Dialog.alert({
                   message: '绑定车牌成功',
                   confirmButtonColor: '#333',
                 }).then(() => {
@@ -210,7 +222,7 @@ export default {
                     path: `vehicleManagement`,
                   });
                   // this.$router.back();
-                });
+                });*/
                 // setTimeout(() => {
                 //   // this.$router.back();
                 //   this.$router.replace({
@@ -220,13 +232,9 @@ export default {
               }
             } else {
               const message = result.message || '绑定车牌失败';
-              // uni.showToast({
-              //   title: message,
-              //   duration: 2000,
-              //   icon: 'none',
-              // });
               Toast({
                 message: message,
+                position: 'top',
               });
               /* Dialog.alert({
                message: message,

+ 28 - 20
src/pages/parkingFee/mixins/vehicleManagement.js

@@ -45,6 +45,7 @@ export default {
       preUrl: '',
       deleteDialogSwitch: false,
       deleteSuccessDialogSwitch: false,
+      show: false, // 删除车牌时提示内容
     };
   },
 
@@ -193,24 +194,28 @@ export default {
         path: `vehicleAddOrEdit?id=${id}&carno=${vehicleNo}&carType=${carType}`,
       });
     },
+    activeCarnoFilter(str){
+      return str.replace(/(.{2})/, '$1·')
+    },
     // 删除
     toDelete(item) {
       this.activeId = item.id;
       this.activeCarno = item.vehicleNo;
+      this.show = true
 
-      Dialog.confirm({
-        title: '删除已绑定车牌',
-        message: '是否确认删除已经绑定车牌' + '\n' + this.activeCarno,
-        confirmButtonColor: '#333',
-      })
-        .then(() => {
-          // on confirm
-          this.doDelete();
-        })
-        .catch(() => {
-          // on cancel
-          // this.cancelDelete();
-        });
+      // Dialog.confirm({
+      //   title: '删除已绑定车牌',
+      //   message: '是否确认删除已经绑定车牌' + '\n' + this.activeCarno,
+      //   confirmButtonColor: '#333',
+      // })
+      //   .then(() => {
+      //     // on confirm
+      //     this.doDelete();
+      //   })
+      //   .catch(() => {
+      //     // on cancel
+      //     // this.cancelDelete();
+      //   });
       // this.deleteDialogSwitch = true;
     },
     doDelete() {
@@ -227,15 +232,18 @@ export default {
             if (result.data) {
               // this.deleteDialogSwitch = false;
               // this.deleteSuccessDialogSwitch = true;
-
-              Dialog.alert({
+              
+              Toast({
                 message: '删除成功',
-                confirmButtonColor: '#333',
-              }).then(() => {
-                // on confirm
-                // this.doDelete();
-                this.getKipMemberVehicles();
+                type: 'success',
+                position: 'top',
+                duration: 5000,
+                className: 'top300',
+                icon: require('../static/images/success.svg')
               });
+              setTimeout(() => {
+                this.getKipMemberVehicles();
+              }, 1500)
               // _this.$refs.deleteSuccessDialog.open()
               return;
             }

+ 6 - 0
src/pages/parkingFee/static/images/success.svg

@@ -0,0 +1,6 @@
+<svg width="74" height="74" viewBox="0 0 74 74" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="&#231;&#188;&#150;&#231;&#187;&#132;">
+<path id="fill" fill-rule="evenodd" clip-rule="evenodd" d="M73 37C73 17.12 56.88 1 37 1C17.12 1 1 17.12 1 37C1 56.88 17.12 73 37 73C56.88 73 73 56.88 73 37Z" stroke="white" stroke-width="2" stroke-dasharray="0"/>
+<path id="fill_2" d="M19.2109 38.1289L30.7509 50.0489L53.0209 27.5889" stroke="white" stroke-width="2" stroke-dasharray="0"/>
+</g>
+</svg>

+ 30 - 0
src/pages/parkingFee/vehicleManagement.vue

@@ -133,6 +133,10 @@
       <div class="add_plate_btn">+添加车牌号</div>
       <div class="btnpb"></div>
     </div>
+    <van-dialog class="dialog-box" v-model="show" title="删除已绑定车牌" show-cancel-button confirm-button-color="var(--k-color-primary-01, #064c8a)" @confirm="doDelete">
+      <div class="info">是否确认删除已经绑定车牌</div>
+      <div class="activeCarno">{{ activeCarnoFilter(activeCarno) }}</div>
+    </van-dialog>
   </div>
 </template>
 
@@ -513,4 +517,30 @@ export default {
     color: #ffffff;
   }
 }
+
+.dialog-box {
+  border-radius: 10px;
+  
+  .van-dialog__header {}
+  /deep/ .van-dialog__content {
+    margin-top: 34px;
+    
+    text-align: center;
+    font-family: 'PingFang SC';
+    font-style: normal;
+    font-weight: 400;
+    font-size: 30px;
+    color: #333333;
+    .info {
+      margin-bottom: 20px;  
+    }
+    .activeCarno {
+      font-family: 'PingFang SC';
+      font-style: normal;
+      font-weight: 500;
+      font-size: 36px;
+      margin-bottom: 28px;
+    }
+  }
+}
 </style>

+ 27 - 0
src/styles/common.less

@@ -100,3 +100,30 @@ button {
   --k-color-primary-disabled: var(--k-color-primary-05); /* 对应色值表第五行 */
 }
 
+
+/*vant 样式补充*/
+/*toast*/
+//.toast-dark {
+//  @toast-background-color: rgba(0, 0, 0, 0.8);
+//}
+
+@toast-background-color: rgba(0, 0, 0, 0.8);
+
+.van-toast{
+  border-radius: 10px;
+  padding: 25px 42px;
+  background-color: @toast-background-color;
+  .van-toast__text {
+    font-family: 'PingFang SC';
+    font-style: normal;
+    font-weight: 400;
+    font-size: 28px;
+    color: #FFFFFF;
+  }
+  &.top300{
+    top: 300PX;
+  }
+}
+.van-toast--top {
+  top: 312px;
+}