From f3058f900e3143c0245c9b1686397b6e6e561422 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期五, 08 十一月 2024 10:09:48 +0800
Subject: [PATCH] 1.解绑添加二次确认。2.接口返回的金额都是元

---
 pages/home/home.js                    |   38 ++++++++++++++----
 pages/valveList/valveList.js          |    2 
 pages/openCard/openCard.js            |   18 +++++----
 pages/rechargeMoney/rechargMoney.js   |   14 ++-----
 pages/openCard/openCard.wxml          |    2 
 pages/rechargeMoney/rechargMoney.wxml |   12 +++---
 pages/waterIntake/waterIntake.js      |    1 
 pages/home/home.wxml                  |    4 +-
 8 files changed, 54 insertions(+), 37 deletions(-)

diff --git a/pages/home/home.js b/pages/home/home.js
index e311702..54d9a2c 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -34,6 +34,7 @@
     showInfoDialog: false,
     showTipDialog: false,
     options: '',
+    showUnBind: false
   },
 
   openValve: function (e) {
@@ -91,7 +92,7 @@
   onLoad(options) {
     //褰撳紑闃�鎴愬姛鍚庤皟鐢ㄥ埛鏂�
     console.log("onLoad锛�" + options.param);
-    if (options.param) {
+    if (options.param === "1" || options.param === "2") {
       this.setData({
         options: options,
         isLogin: true,
@@ -124,11 +125,19 @@
       //鏈湴娌℃湁缂撳瓨寰俊鐧诲綍
       this.wxLogin();
     }
-    if (this.data.options.param) {
+    if (this.data.options.param === "1") {
       this.setData({
-
         showTipDialog: true,
         tipData: "寮�闃�鍛戒护涓嬪彂鎴愬姛锛岀害20-60绉掑悗鍙埛鏂板揩閫熷叧闃�鍒楄〃鏌ョ湅鎵ц缁撴灉銆�"
+      })
+      setTimeout(() => {
+        this.getOpenList();
+      }, 20000)
+
+    } else if (this.data.options.param === "2") {
+      this.setData({
+        showTipDialog: true,
+        tipData: "棰勭害寮�闃�鍛戒护涓嬪彂鎴愬姛锛屽綋鍒拌揪棰勭害鏃堕棿骞朵笖鎴愬姛寮�闃�鍚庡揩閫熷叧闃�鍒楄〃浼氭樉绀烘湭鍏抽榾璁板綍"
       })
       this.getOpenList();
     }
@@ -268,7 +277,8 @@
     this.setData({
       showForceConfirm: false,
       showConfirm: false,
-      showTipDialog: false
+      showTipDialog: false,
+      showUnBind:false
     });
   },
   /**
@@ -308,7 +318,9 @@
           showTipDialog: true,
           tipData: "鍏抽榾鍛戒护涓嬪彂鎴愬姛锛岀害20-60绉掑悗鍙埛鏂板揩閫熷叧闃�鍒楄〃鏌ョ湅鎵ц缁撴灉銆�"
         })
-        this.getOpenList();
+        setTimeout(() => {
+          this.getOpenList();
+        }, 40000)
       } else {
         wx.showToast({
           title: '鍛戒护鎵ц澶辫触',
@@ -598,11 +610,14 @@
   },
   //瑙g粦
   unbind() {
-    //娓呯┖鏁版嵁
     this.setData({
-      userPhone: "鏈櫥褰�",
-      userName: "璇风櫥褰�",
-      listData: []
+      showUnBind: true
+    })
+  },
+  //纭瑙g粦
+  unBindPost() {
+    this.setData({
+      showUnBind: false
     })
     wx.showLoading({
       title: '姝e湪瑙g粦璇风◢鍊�...', // 鍔犺浇鎻愮ず鏂囧瓧
@@ -641,6 +656,11 @@
       wx.hideLoading();
       // 澶勭悊閿欒鍝嶅簲
       console.error('璇锋眰澶辫触:', error);
+      wx.showToast({
+        title: '瑙g粦澶辫触',
+        icon: 'error',
+        duration: 3000
+      })
     });
   },
   //鐐瑰嚮鎻愮ず鎸夐挳
diff --git a/pages/home/home.wxml b/pages/home/home.wxml
index c43351d..110c3d0 100644
--- a/pages/home/home.wxml
+++ b/pages/home/home.wxml
@@ -93,7 +93,7 @@
         <text class="content-container">
           1.缃戠粶绛変笉鍙姉鍔涘洜绱犲彲鑳藉鑷磋澶囩姸鎬佹樉绀哄欢杩熸垨閿欒銆�
           2.褰撴彁绀烘偍鎿嶄綔澶辫触鍚庢偍鍙◢鍚庡皾璇曢噸鏂版搷浣溿��
-          3.鍦ㄥ畾鏃舵垨瀹氶噺寮�闃�鐨勯绾﹀紡寮�闃�杩囩▼涓紝绯荤粺浠呮樉绀哄彇娑堢姸鎬併�傚綋鐢ㄦ埛鐐瑰嚮鍙栨秷鏃讹紝绋嬪簭浼氬皾璇曟墽琛屽彇娑堟搷浣滐紝浣嗗彲鑳藉洜缃戠粶绛変笉鍙姉鍔涘洜绱犺�屽け璐ャ��
+          3.鍦ㄥ畾鏃舵垨瀹氶噺寮�闃�鐨勯绾﹀紡寮�闃�鍚庯紝鍙湁闃�闂ㄥ埌杈剧害瀹氱殑鏃堕棿鎴愬姛寮�闃�鍚庢湭鍏抽榾璁板綍鎵嶄細鏄剧ず銆�
           4.鎴戜滑璇氭寶鍦伴個璇锋偍閫氳繃鎰忚鍙嶉娓犻亾鎻愬嚭瀹濊吹鐨勫缓璁垨鎰忚銆�
         </text>
 
@@ -101,5 +101,5 @@
     </scroll-view>
   </t-dialog>
   <t-dialog class="dialog" title="閫氱煡缁撴灉" visible="{{showTipDialog}}" content="{{tipData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="cancelDialog" />
-  
+  <t-dialog class="dialog" visible="{{showUnBind}}" content="纭瑙i櫎缁戝畾鍚楋紵" confirm-btn="{{ { content: '纭', variant: 'base', theme: 'danger' } }}" close-on-overlay-click="false" cancel-btn="鍙栨秷" bind:confirm="unBindPost" bind:cancel="cancelDialog" />
 </view>
\ No newline at end of file
diff --git a/pages/openCard/openCard.js b/pages/openCard/openCard.js
index 6a6e8f6..1da3751 100644
--- a/pages/openCard/openCard.js
+++ b/pages/openCard/openCard.js
@@ -1,4 +1,4 @@
-// 寮�鍗¢�夋嫨铏氭嫙鍗�
+// 寮�闃�閫夋嫨铏氭嫙鍗�
 const {
   get,
   post
@@ -264,6 +264,7 @@
       this.setData({
         isOpenTiming: true,
         radioValue: value,
+        dateStartTime: new Date().getTime()
       })
     } else {
       this.setData({
@@ -315,7 +316,8 @@
       dialog_time: false,
       dialog_water: false,
       dialog_mode: true,
-      group_time: false
+      group_time: false,
+      activeIndex: -1
     })
   },
   //绔嬪嵆寮�娉�
@@ -343,7 +345,7 @@
       wx.hideLoading();
       //瀹屾垚鍚庡洖鍒伴椤�
       wx.reLaunch({
-        url: '/pages/home/home?param=true' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
+        url: '/pages/home/home?param=1' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
       });
 
     }).catch(error => {
@@ -387,7 +389,7 @@
       wx.hideLoading();
       //瀹屾垚鍚庡洖鍒伴椤�
       wx.reLaunch({
-        url: '/pages/home/home?param=true' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
+        url: '/pages/home/home?param=1' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
       });
     }).catch(error => {
       // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢�
@@ -415,7 +417,7 @@
       plannedOpenTime: this.data.openTime
     };
     post({
-      url: "wx/valve/timed_close",
+      url: "wx/valve/planed_open_timed_close",
       data: data
     }).then(response => {
       // 澶勭悊鎴愬姛鍝嶅簲
@@ -424,7 +426,7 @@
       wx.hideLoading();
       //瀹屾垚鍚庡洖鍒伴椤�
       wx.reLaunch({
-        url: '/pages/home/home?param=true' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
+        url: '/pages/home/home?param=2' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
       });
     }).catch(error => {
       // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢�
@@ -460,7 +462,7 @@
       wx.hideLoading();
       //瀹屾垚鍚庡洖鍒伴椤�
       wx.reLaunch({
-        url: '/pages/home/home?param=true' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
+        url: '/pages/home/home?param=1' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
       });
     }).catch(error => {
       // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢�
@@ -497,7 +499,7 @@
       wx.hideLoading();
       //瀹屾垚鍚庡洖鍒伴椤�
       wx.reLaunch({
-        url: '/pages/home/home?param=true' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
+        url: '/pages/home/home?param=2' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
       });
     }).catch(error => {
       // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢�
diff --git a/pages/openCard/openCard.wxml b/pages/openCard/openCard.wxml
index 1a0dba6..b735497 100644
--- a/pages/openCard/openCard.wxml
+++ b/pages/openCard/openCard.wxml
@@ -1,4 +1,4 @@
-<!--pages/openCard/openCard.wxml 寮�鍗℃椂鐨勮櫄鎷熷崱-->
+<!--pages/openCard/openCard.wxml 寮�闃�鏃剁殑铏氭嫙鍗�-->
 <view class="container">
 
   <scroll-view class="list-container" scroll-y="true" scroll-x="false" refresher-enabled="true" bindrefresherrefresh="onPullDownRefresh" refresher-triggered="{{isWXRefreshing}}">
diff --git a/pages/rechargeMoney/rechargMoney.js b/pages/rechargeMoney/rechargMoney.js
index c12738e..1d9d079 100644
--- a/pages/rechargeMoney/rechargMoney.js
+++ b/pages/rechargeMoney/rechargMoney.js
@@ -105,7 +105,7 @@
     const data = {
       sessionId: getApp().globalData.sessionId,
       vcId: this.data.vcId, //铏氭嫙鍗D
-      rechargeAmount: this.data.moneyList[this.data.activeIndex].rechargeAmount//锛堝崟浣嶆槸鍒嗭級
+      rechargeAmount: this.data.moneyList[this.data.activeIndex].rechargeAmount//锛堝崟浣嶆槸鍏冿級
     };
     console.log("postCloseValaue" + data);
     post({
@@ -200,9 +200,10 @@
       this.getRechargList();
     }
   },
+  //澶勭悊鍏呭�艰褰曠殑鏁版嵁
   updateDisplayText() {
     const updatedList = this.data.allRechargeList.map(item => {
-      let morny = item.rechargeAmount / 100 + "鍏�"
+      let morny = item.rechargeAmount  + "鍏�"
       return {
         ...item,
         morny
@@ -219,15 +220,8 @@
       url: 'wx/virtual_card/gerRechargeProfiles'
     };
     get(params).then(data => {
-      const updatedList=   data.content.map(item=>{
-        let money=item.rechargeAmount/100;
-        return {
-          ...item,
-          money
-        }; 
-      })
       this.setData({
-        moneyList: updatedList ,
+        moneyList: data.content ,
       })
     }).catch(err => {
       // 閿欒鍥炶皟
diff --git a/pages/rechargeMoney/rechargMoney.wxml b/pages/rechargeMoney/rechargMoney.wxml
index 421db30..904084a 100644
--- a/pages/rechargeMoney/rechargMoney.wxml
+++ b/pages/rechargeMoney/rechargMoney.wxml
@@ -17,19 +17,19 @@
     <view class="row">
       <view class="item{{activeIndex === 0 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="0">
         <view class="money-wrapper">
-          <text class="money-number">{{moneyList[0].money}}</text>
+          <text class="money-number">{{moneyList[0].rechargeAmount}}</text>
           <text class="money-label">鍏�</text>
         </view>
       </view>
       <view class="item{{activeIndex === 1 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="1">
         <view class="money-wrapper">
-          <text class="money-number">{{moneyList[1].money}}</text>
+          <text class="money-number">{{moneyList[1].rechargeAmount}}</text>
           <text class="money-label">鍏�</text>
         </view>
       </view>
       <view class="item{{activeIndex === 2 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="2">
         <view class="money-wrapper">
-          <text class="money-number">{{moneyList[2].money}}</text>
+          <text class="money-number">{{moneyList[2].rechargeAmount}}</text>
           <text class="money-label">鍏�</text>
         </view>
       </view>
@@ -37,19 +37,19 @@
     <view class="row">
       <view class="item{{activeIndex === 3 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="3">
         <view class="money-wrapper">
-          <text class="money-number">{{moneyList[3].money}}</text>
+          <text class="money-number">{{moneyList[3].rechargeAmount}}</text>
           <text class="money-label">鍏�</text>
         </view>
       </view>
       <view class="item{{activeIndex === 4 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="4">
         <view class="money-wrapper">
-          <text class="money-number">{{moneyList[4].money}}</text>
+          <text class="money-number">{{moneyList[4].rechargeAmount}}</text>
           <text class="money-label">鍏�</text>
         </view>
       </view>
       <view class="item{{activeIndex === 5 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="5">
         <view class="money-wrapper">
-          <text class="money-number">{{moneyList[5].money}}</text>
+          <text class="money-number">{{moneyList[5].rechargeAmount}}</text>
           <text class="money-label">鍏�</text>
         </view>
       </view>
diff --git a/pages/valveList/valveList.js b/pages/valveList/valveList.js
index 894e7fa..1c5d89f 100644
--- a/pages/valveList/valveList.js
+++ b/pages/valveList/valveList.js
@@ -99,7 +99,7 @@
     this.setData({
       isPhysicalRefreshing: true,
     })
-    this.getPhysicalListData();
+    this.getPhysicalListData(true);
   },
   //鑾峰彇瀹炰綋鍗″垪琛�
   getPhysicalListData(isRefresh) {
diff --git a/pages/waterIntake/waterIntake.js b/pages/waterIntake/waterIntake.js
index 7824332..2d5be31 100644
--- a/pages/waterIntake/waterIntake.js
+++ b/pages/waterIntake/waterIntake.js
@@ -1,4 +1,5 @@
 // pages/waterIntake/waterIntake.js
+//甯哥敤鍙栨按鍙e垪琛ㄩ〉
 const {
   get,
   post

--
Gitblit v1.8.0