From ddbd8c7ea87b66d5a9c4362ce284d12a4ae970d1 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期五, 01 十一月 2024 14:24:50 +0800
Subject: [PATCH] 1绑定相关。2首页修改开关阀提示。3.问题反馈相关功能

---
 pages/openCard/openCard.js |   50 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/pages/openCard/openCard.js b/pages/openCard/openCard.js
index a3f47d4..6a6e8f6 100644
--- a/pages/openCard/openCard.js
+++ b/pages/openCard/openCard.js
@@ -14,7 +14,8 @@
     vcId: "",
     activeIndex: -1,
     datetimeVisible: false,
-    datetime: new Date().getTime(),
+    dateStartTime: new Date().getTime(),
+    dateEndTime: new Date().getTime() + 24 * 60 * 60 * 1000,
     datetimeText: '',
     allCardPoints: [], // 鎵�鏈夎櫄鎷熷崱
     irrigateProfile: [], //鑾峰彇鎵�閫夌亴婧夋柟寮忕殑璇︾粏鏁版嵁
@@ -36,7 +37,9 @@
     radioValue: "0", //寮�闃�鏂瑰紡閫変腑鐨勭被鍨�
     costiomTime: "", //鑷畾涔夌亴婧夋椂闂�
     waterAmount: 0, //瀹氶噺寮�闃�鐨勬按閲�
-    costiomWater:"",//杈撳叆鐨勮嚜瀹氫箟姘撮噺
+    costiomWater: "", //杈撳叆鐨勮嚜瀹氫箟姘撮噺
+    isWXRefreshing: false,
+    intakeName: "" //鎵爜寮�闃�浠庨椤典紶鏉ョ殑鍙栨按鍙e悕绉�
   },
   openValva(event) {
     const {
@@ -45,14 +48,20 @@
     if (item.isAlarmValue === true) {
       //閲戦鎶ヨ
       wx.navigateTo({
-        url: '/pages/rechargeMoney/rechargMoney?vcId=' + item.vcId,
+        url: '/pages/rechargeMoney/rechargMoney?vcId=' + item.id,
       })
     } else if (item.inUse === false) {
-      // 閫夋嫨铏氭嫙鍗″悗
-      this.initDialogData();
       this.setData({
-        vcId: item.vcId,
+        vcId: item.id,
       })
+      if (this.data.intakeName) {
+        //鎵爜寮�闃�閫昏緫
+        this.postOpenValva(false);
+      } else {
+        // 閫夋嫨铏氭嫙鍗″悗
+        this.initDialogData();
+      }
+
     }
   },
   handleAutoIrrigation() {},
@@ -62,10 +71,12 @@
    */
   onLoad(options) {
     const {
-      intakeId
+      intakeId,
+      intakeName
     } = options;
     this.setData({
-      intakeId: intakeId
+      intakeId: intakeId,
+      intakeName: intakeName
     })
     console.log('intakeId:' + this.data.intakeId);
     this.getCardList();
@@ -103,7 +114,10 @@
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
    */
   onPullDownRefresh() {
-
+    this.setData({
+      isWXRefreshing: true
+    });
+    this.getCardList();
   },
 
   /**
@@ -163,7 +177,8 @@
     });
     // 鏇存柊鍒楄〃鏁版嵁
     this.setData({
-      allCardPoints: updatedList
+      allCardPoints: updatedList,
+      isWXRefreshing: false
     });
   },
   handleClost() {
@@ -198,7 +213,7 @@
       this.data.waterAmount = parseInt(this.data.irrigateProfile[index].defaultValue)
       this.setData({
         activeIndex: parseInt(index),
-        costiomWater:""
+        costiomWater: ""
       });
     }
   },
@@ -313,6 +328,7 @@
     const data = {
       intakeId: this.data.intakeId, //鍙栨按鍙D
       vcId: this.data.vcId, //铏氭嫙鍗D
+      intakeName: this.data.intakeName, //鍙栨按鍙e悕绉�
       operator: app.globalData.sessionId, //鎿嶄綔鍛�
       forceOpen: !!isforce // 浣跨敤閫昏緫闈炴搷浣滅 !! 鏉ョ‘淇� isForce 鏄竷灏斿��  
     };
@@ -431,11 +447,11 @@
     const data = {
       intakeId: this.data.intakeId, //鍙栨按鍙D
       vcId: this.data.vcId, //铏氭嫙鍗D
-      minutes: this.data.waterAmount, //姘撮噺
+      waterAmount: this.data.waterAmount, //姘撮噺
       operator: app.globalData.sessionId //鎿嶄綔鍛�
     };
     post({
-      url: "/wx/valve/quantify_close",
+      url: "wx/valve/quantify_close",
       data: data
     }).then(response => {
       // 澶勭悊鎴愬姛鍝嶅簲
@@ -472,7 +488,7 @@
       plannedOpenTime: this.data.openTime
     };
     post({
-      url: "/wx/valve/planed_open_quantify_close",
+      url: "wx/valve/planed_open_quantify_close",
       data: data
     }).then(response => {
       // 澶勭悊鎴愬姛鍝嶅簲
@@ -583,7 +599,7 @@
     }
   },
   //杈撳叆鑷畾涔夋按閲忕殑鐩戝惉
-  onWaterInputChange(data){
+  onWaterInputChange(data) {
     console.log(data.detail.value)
     if (data.detail.value !== "") {
       this.setData({
@@ -597,7 +613,7 @@
     }
   },
   // 瀹氶噺寮�娉垫寜閽�
-  btnOpenOnWater(){
+  btnOpenOnWater() {
     if (this.data.waterAmount > 0) {
       if (this.data.isOpenTiming) {
         this.quantifyOpenTime();
@@ -610,7 +626,7 @@
         title: '璇烽�夋嫨鎴栬緭鍏ョ亴婧夋椂闂达紒',
       })
     }
-  }
+  },
 
 
 })
\ No newline at end of file

--
Gitblit v1.8.0