فهرست منبع

fix: 接口报错时的提示

allen 3 ماه پیش
والد
کامیت
14322021cf
2فایلهای تغییر یافته به همراه6 افزوده شده و 7 حذف شده
  1. 6 5
      pages/cb/shuifeizs/control.vue
  2. 0 2
      pages/equipList/index.vue

+ 6 - 5
pages/cb/shuifeizs/control.vue

@@ -100,12 +100,13 @@ export default {
           'Content-Type': 'application/json',
         },
       });
-      if (res.code === '000000') {
-        uni.showToast({
-          title: res.msg,
-          icon: 'none',
-        });
+      if (res.code !== '000000') {
+        item.value = item.value == 1 ? 0 : 1;
       }
+      uni.showToast({
+        title: res.msg,
+        icon: 'none',
+      });
     },
     controlClick(index) {
       this.activeIndex = index;

+ 0 - 2
pages/equipList/index.vue

@@ -268,7 +268,6 @@ export default {
         };
         this.list.push(obj);
       }
-      console.log('设备列表11111111111111', this.list);
       if (res.length) {
         this.type_id = this.list[0].id;
         this.device_model = this.list[0].device_model;
@@ -301,7 +300,6 @@ export default {
       this.width = '90%';
     },
     modification(item) {
-      console.log(item, 'itemimteitmetie');
       uni.navigateTo({
         url:
           './modification?data=' + JSON.stringify(item) + '&id=' + this.type_id,