From d18a0c9fe708dcf58253b54ef2938b5e864b24df Mon Sep 17 00:00:00 2001
From: zuoxiao <zuoxiao>
Date: 星期一, 28 四月 2025 14:39:30 +0800
Subject: [PATCH] 优化水摄入页面的确认弹窗逻辑,调整showConfirm状态的设置位置,并移除不必要的代码注释,提升代码可读性和维护性。
---
pages/irrigation/irrigation.wxml | 59 +++++++++++++++++++++++++++++++----------------------------
1 files changed, 31 insertions(+), 28 deletions(-)
diff --git a/pages/irrigation/irrigation.wxml b/pages/irrigation/irrigation.wxml
index b5af43c..1864f3e 100644
--- a/pages/irrigation/irrigation.wxml
+++ b/pages/irrigation/irrigation.wxml
@@ -10,7 +10,17 @@
</view>
<!-- 涓棿鍒楄〃 - 浣跨敤scroll-view瀹炵幇涓嬫媺鍒锋柊 -->
- <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}}">
+ <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}}"
+ lower-threshold="100"
+ bindscrolltolower="{{currentTab === 1 ? 'onReachBottom' : ''}}"
+ enhanced="{{true}}"
+ id="scrollView">
<view wx:if="{{isRefreshing}}" class="refresh-view">
<view class="dot"></view>
<view class="dot"></view>
@@ -20,8 +30,8 @@
<block wx:if="{{currentList.length > 0}}">
<view class="list-item" wx:for="{{currentList}}" wx:key="id" bindtap="onItemTap" data-id="{{item.id}}" data-status="{{item.status}}">
<!-- 鐘舵�佹爣绛� -->
- <view class="status-tag {{item.status === '1' ? 'draft' : item.status === '2' ? 'published' : item.status === '3' ? 'executing' : 'completed'}}">
- {{item.status === '1' ? '鑽夌' : item.status === '2' ? '鏈墽琛�' : item.status === '3' ? '鎵ц涓�' : '宸插畬鎴�'}}
+ <view class="status-tag {{item.status === '1' ? 'draft' : item.status === '2' ? 'published' : item.status === '3' ? 'executing' : item.status === '5' ? 'terminated' : 'completed'}}">
+ {{item.status === '1' ? '鑽夌' : item.status === '2' ? '鏈墽琛�' : item.status === '3' ? '鎵ц涓�' : item.status === '5' ? '宸茬粓姝�' : '宸插畬鎴�'}}
</view>
<!-- 涓昏鍐呭鍖� -->
@@ -57,36 +67,16 @@
</view>
</view>
</view>
-
- <!-- 鎵ц涓姸鎬侀澶栦俊鎭� -->
- <block wx:if="{{item.status === '3'}}">
- <view class="executing-info">
- <view class="info-item">
- <view class="info-icon">
- <image src="/images/progress-icon.svg" mode="aspectFit"></image>
- </view>
- <view class="info-content">
- <view class="info-label">宸茬亴婧夋椂闂�</view>
- <view class="info-value">{{item.irrigatedTime}}</view>
- </view>
- </view>
- <view class="info-item">
- <view class="info-icon">
- <image src="/images/group-icon.svg" mode="aspectFit"></image>
- </view>
- <view class="info-content">
- <view class="info-label">宸茬亴婧夎疆缁�</view>
- <view class="info-value">{{item.irrigatedGroups}}</view>
- </view>
- </view>
- </view>
- </block>
</view>
<!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
- <view class="action-section" catchtap="stopPropagation" wx:if="{{item.status !== '4'}}">
+ <view class="action-section" catchtap="stopPropagation" wx:if="{{item.status === '1'||item.status === '2'||item.status === '3'}}">
<block wx:if="{{item.status === '1'}}">
<view class="action-buttons">
+ <button class="action-button delete-button" hover-class="delete-button-hover" bindtap="onDelete" data-id="{{item.id}}">
+ <image src="/images/delete_bt.svg" mode="aspectFit"></image>
+ <text>鍒犻櫎</text>
+ </button>
<button class="action-button publish-button" hover-class="publish-button-hover" bindtap="onPublish" data-id="{{item.id}}">
<image src="/images/publish-icon.svg" mode="aspectFit"></image>
<text>鍙戝竷</text>
@@ -112,6 +102,19 @@
</view>
</view>
</view>
+
+ <!-- 鍔犺浇鏇村鎻愮ず - 浠呭湪鍘嗗彶璁″垝鏍囩椤垫樉绀� -->
+ <view wx:if="{{currentTab === 1}}" class="loading-more-container">
+ <view wx:if="{{loadingMore}}" class="loading-more">
+ <view class="loading-dot"></view>
+ <view class="loading-dot"></view>
+ <view class="loading-dot"></view>
+ <text>鍔犺浇涓�...</text>
+ </view>
+ <view wx:elif="{{!hasMoreData && completedList.length > 0}}" class="no-more-data">
+ <text>鈥� 宸插姞杞藉叏閮ㄦ暟鎹� 鈥�</text>
+ </view>
+ </view>
</block>
<block wx:else>
--
Gitblit v1.8.0