From c6ad105d1b743bcfd8aa6ee2781d39039f319a87 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期四, 04 七月 2024 11:28:51 +0800
Subject: [PATCH] 添加tag

---
 pages/waterIntake/waterIntake.js |   42 ++++++++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/pages/waterIntake/waterIntake.js b/pages/waterIntake/waterIntake.js
index 81ded95..68f5a3c 100644
--- a/pages/waterIntake/waterIntake.js
+++ b/pages/waterIntake/waterIntake.js
@@ -13,7 +13,12 @@
     isRefreshing_common: false,
     showConfirm: false,
     waterIntakeName: "",
-    choseItem: null
+    choseItem: null,
+    errorData: '', //閿欒鍐呭
+    showErrorDialog: false,
+    confirmBtn: {
+      content: '纭'
+    },
   },
 
   // 鍒囨崲 Tabs
@@ -67,7 +72,8 @@
     };
     post({
       url: "wx/valve/open_wx",
-      data: data
+      data: data,
+      timeout: 180000
     }).then(response => {
 
       // 澶勭悊鎴愬姛鍝嶅簲
@@ -84,13 +90,12 @@
       wx.hideLoading();
       // 澶勭悊閿欒鍝嶅簲
       console.error('璇锋眰澶辫触:', error);
-      if (error.code === "1002") {
-        wx.showToast({
-          title: '寮�闃�澶辫触',
-          icon: 'error',
-          duration: 3000 // 鎻愮ず鐨勬寔缁椂闂达紝鍗曚綅姣
-        })
-      }
+
+      this.setData({
+        showErrorDialog: true,
+        errorData: error.msg
+      })
+
     });
   },
 
@@ -151,7 +156,7 @@
    */
   getallWaterPoints: function (intakeNum) {
     let params = {
-      url: 'project/intake/all_intakes'
+      url: 'wx/intake/all_intakes'
     };
     if (intakeNum) {
       params.data = {
@@ -178,13 +183,18 @@
         this.setData({
           isRefreshing_all: false
         });
+        wx.showToast({
+          title: error.msg,
+          icon: 'error',
+          duration: 3000 // 鎻愮ず鐨勬寔缁椂闂达紝鍗曚綅姣
+        })
         console.error('Failed to add item:', error);
       });
   },
   //鑾峰彇甯哥敤鍙栨按鍙�
   getcommonWaterPoints() {
     get({
-        url: 'project/intake/used_intakes',
+        url: 'wx/intake/used_intakes',
         data: {
           operator: getApp().globalData.sessionId
         }
@@ -209,7 +219,7 @@
           isRefreshing_common: false
         });
         wx.showToast({
-          title: error.code,
+          title: error.msg,
           icon: 'error',
           duration: 3000 // 鎻愮ず鐨勬寔缁椂闂达紝鍗曚綅姣
         })
@@ -227,7 +237,7 @@
   },
   confirmDialog() {
     this.setData({
-      showConfirm:false
+      showConfirm: false
     })
     this.postOpenValva(this.data.choseItem.intakeId);
   },
@@ -235,6 +245,10 @@
     this.setData({
       showConfirm: false
     })
+  },
+  closeErrorDialog() {
+    this.setData({
+      showErrorDialog: false
+    })
   }
-
 })
\ No newline at end of file

--
Gitblit v1.8.0