From 61e89d748cc7f5456c20866e672a4bde153534f1 Mon Sep 17 00:00:00 2001
From: zuoxiao <zuoxiao>
Date: 星期一, 21 四月 2025 17:18:53 +0800
Subject: [PATCH] 优化项目配置,重构项目URL管理逻辑,改为使用动态配置;更新灌溉组详情页面,添加详细信息展示和请求逻辑,提升用户体验;更新首页项目选择器,支持动态项目列表展示。

---
 pages/home/home.wxml |   99 +++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 78 insertions(+), 21 deletions(-)

diff --git a/pages/home/home.wxml b/pages/home/home.wxml
index b4f283b..327b1dd 100644
--- a/pages/home/home.wxml
+++ b/pages/home/home.wxml
@@ -3,16 +3,20 @@
 
   <view class="head-wrapper">
     <view class="head-top">
-      <t-avatar class="avatar-example" image="{{image}}" size="120rpx" />
+      <t-avatar class="avatar-example" image="{{image}}" size="120rpx" bind:tap="handleAvatarTap" />
       <view class="head-text-wrapper">
-        <text>{{userName}}</text>
+        <text bind:tap="wxLogin">{{userName}}</text>
         <text class="head-bottom">{{userPhone}}</text>
       </view>
       <view class="head-button-wrapper">
-        <text class="unbind" bind:tap="feedBack">瑙g粦</text>
+        <text class="unbind" bind:tap="unbind">瑙g粦</text>
         <text class="head-bottom" bind:tap="feedBack">鑱旂郴瀹㈡湇</text>
       </view>
-      <image class="scen-code" src="/images/scen_code.svg" bind:tap="scenCode"/>
+      <view class="scen-view" bind:tap="scenCode">
+        <image class="scen-code" src="/images/scen_code.svg" />
+        <text>鎵爜寮�闃�</text>
+      </view>
+
     </view>
   </view>
 
@@ -29,18 +33,20 @@
       <image src="/images/record.svg" />
       <text>寮�鍏抽榾璁板綍</text>
     </view>
-    <view class="center-view" bind:tap="feedBack">
-      <image src="/images/question.svg" />
-      <text>闂鍙嶉</text>
+    <view class="center-view" bind:tap="irrigation">
+      <image src="/images/irrigation.svg" />
+      <text>杞亴</text>
     </view>
   </view>
 
 
   <view class="bottom-title">
-    <text class="bottom-title-text">蹇�熷叧闃�</text>
+    <view class="title-center">
+      <text class="bottom-title-text">蹇�熷叧闃�</text>
+      <image class="info-img" bind:tap="infoShow" src="/images/info.svg"></image>
+    </view>
     <text class="refresh-button" bind:tap="startPullDownRefresh">鍒锋柊</text>
   </view>
-  <view class="divider"></view>
   <!-- refresher-enabled="true" refresher-threshold="50" -->
   <scroll-view class="scroll-view" scroll-x="false" scroll-y="true" refresher-enabled="{{isRefreshing==false?true:false}}" refresher-threshold="50" bindrefresherrefresh="onPullDownRefresh" refresher-triggered="{{isWXRefreshing}}">
     <view wx:if="{{isRefreshing}}" class="refresh-view">
@@ -49,16 +55,29 @@
       <view class="dot"></view>
     </view>
     <view class="scroll-bg">
-      <view wx:if="{{listData.length > 0}}" class="list-item" wx:for="{{listData}}" wx:key="index">
-        <view class="item-left">
-          <!-- <image class="item-img" src="/images/pipeline.svg" /> -->
-          <text>{{item.intakeNum}}</text>
-          <image class="item-img" src="{{item.isOnLine ? '/images/wifi_no.svg' : '/images/wifi_off.svg'}}" />
-        </view>
-        <view>
-          <!-- <t-switch  class="switch" data-item="{{item}}" bindchange="handleChange" value="{{true}}" label="{{['寮�', '鍏�']}}" slot="note" /> -->
-          <text class="item-button" bind:tap="handleChange" data-item="{{item}}">鍏抽榾</text>
-        </view>
+      <view wx:if="{{listData.length > 0}}" wx:for="{{listData}}" wx:key="index">
+        <t-swipe-cell>
+          <view class="swipe-cell">
+            <view class="list-item">
+              <view class="item-left">
+                <view class="left-intake-name">
+                  <image class="item-img-left" src="/images/valve.svg" />
+                  <text class="water-intake-name">{{item.intakeNum}}</text>
+                  <image class="item-img" src="{{item.isOnLine ? '/images/wifi_no.svg' : '/images/wifi_off.svg'}}" />
+                </view>
+                <view class="left-time">
+                  <image class="item-img" src="/images/time.svg" />
+                  <text class="flow-time">{{item.time}}</text>
+                  <text class="flow-rate">鐬椂娴侀噺锛歿{item.waterInstant}} m鲁/h</text>
+                </view>
+              </view>
+              <view class="item-right">
+                <text class="item-button" bind:tap="handleChange" data-item="{{item}}">鍏抽榾</text>
+              </view>
+            </view>
+          </view>
+          <view slot="right" class="delete-btn" bind:tap="onDelete" data-item="{{item}}">{{item.deleteText}}</view>
+        </t-swipe-cell>
       </view>
     </view>
     <view wx:if="{{listData.length === 0}}" class="noMore-View-home">
@@ -67,7 +86,45 @@
     </view>
   </scroll-view>
 
-  <t-dialog class="dialog" visible="{{showConfirm}}" content="纭鍏抽棴{{waterIntakeName}}鍚楋紵" confirm-btn="{{ { content: '纭', variant: 'base', theme: 'danger' } }}" close-on-overlay-click="false" cancel-btn="鍙栨秷"  bind:confirm="confirmDialog" bind:cancel="closeDialog" />
-  <t-dialog class="error-dialog"  title="鍏抽榾閿欒" visible="{{showErrorDialog}}" content="{{errorData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="closeDialog" />
+  <t-dialog class="dialog" visible="{{showConfirm}}" content="纭鍏抽棴{{waterIntakeName}}鍚楋紵" confirm-btn="{{ { content: '纭', variant: 'base', theme: 'danger' } }}" close-on-overlay-click="false" cancel-btn="鍙栨秷" bind:confirm="confirmDialog" bind:cancel="cancelDialog" />
+  <t-dialog class="error-dialog" title="{{errorDialogTitle}}" visible="{{showErrorDialog}}" content="{{errorData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="closeDialog" />
+  <t-dialog visible="{{showForceConfirm}}" content="褰撳墠铏氭嫙鍗¤鍗犵敤锛屾槸鍚﹀己鍒跺紑闃�锛�" confirm-btn="{{ { content: '寮哄埗寮�闃�', variant: 'base', theme: 'danger' } }}" cancel-btn="鍙栨秷" bind:confirm="confirmForceDialog" bind:cancel="cancelDialog" />
 
+  <!-- 浣跨敤寰俊鍘熺敓寮圭獥缁勪欢 -->
+  <view class="project-modal" wx:if="{{showProjectDialog}}">
+    <view class="project-modal-mask"></view>
+    <view class="project-modal-content">
+      <view class="project-modal-header">
+        <text class="project-modal-title">璇烽�夋嫨椤圭洰</text>
+      </view>
+      <view class="project-modal-body">
+        <scroll-view scroll-y class="project-scroll-view">
+          <radio-group class="project-radio-group" bindchange="onProjectChange">
+            <label wx:for="{{projectList}}" wx:key="index" class="project-radio {{selectedProject === item.key ? 'project-radio-selected' : ''}}">
+              <radio value="{{item.key}}" checked="{{selectedProject === item.key}}" color="#1890FF" />
+              <text>{{item.displayName}}</text>
+            </label>
+          </radio-group>
+        </scroll-view>
+      </view>
+      <view class="project-modal-footer">
+        <button class="project-modal-btn" disabled="{{!selectedProject}}" bindtap="handleProjectConfirm">纭</button>
+      </view>
+    </view>
+  </view>
+  <t-dialog class="dialog" title="閫氱煡缁撴灉" visible="{{showTipDialog}}" content="{{tipData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="cancelDialog" />
+  <t-dialog visible="{{showInfoDialog}}" title="鍙嬫儏鎻愮ず" confirm-btn="{{ confirmBtn  }}" bind:confirm="confirmBtnInfoDialog">
+    <!-- 閫傞厤skyline锛屽鍔爐ype="list" -->
+    <scroll-view slot="content" type="list" scroll-y class="long-content">
+      <view class="content-container">
+        <text class="content-container">
+          1.缃戠粶绛変笉鍙姉鍔涘洜绱犲彲鑳藉鑷磋澶囩姸鎬佹樉绀哄欢杩熸垨閿欒銆傦紙褰撹繘琛屼簡寮�闃�鎴栧叧闃�鎿嶄綔鍚庝細鏈変竴瀹氬欢鏃舵墠鍙‘璁ゆ槸鍚︽搷浣滄垚鍔燂級
+          2.褰撴彁绀烘偍鎿嶄綔澶辫触鍚庢偍鍙◢鍚庡皾璇曢噸鏂版搷浣溿��
+          3.鍦ㄥ畾鏃舵垨瀹氶噺寮�闃�鐨勯绾﹀紡寮�闃�鍚庯紝鍙湁闃�闂ㄥ埌杈剧害瀹氱殑鏃堕棿鎴愬姛寮�闃�鍚庢湭鍏抽榾璁板綍鎵嶄細鏄剧ず銆�
+          4.鎴戜滑璇氭寶鍦伴個璇锋偍閫氳繃鎰忚鍙嶉娓犻亾鎻愬嚭瀹濊吹鐨勫缓璁垨鎰忚銆�
+        </text>
+
+      </view>
+    </scroll-view>
+  </t-dialog>
 </view>
\ No newline at end of file

--
Gitblit v1.8.0