From aec1b6ec73897b5e5f3a85f2985447726a399ed0 Mon Sep 17 00:00:00 2001 From: zuoxiao <zuoxiao> Date: 星期六, 19 四月 2025 15:56:48 +0800 Subject: [PATCH] 更新灌溉计划页面,添加灌溉计划列表刷新标记,优化项目选择器和时间选择器的逻辑;更新样式以提升用户体验,确保在切换标签时只加载必要的数据。 --- pages/createIrrigation/createIrrigation.wxml | 138 ++++++++++++++++++++++++++++++++------------- 1 files changed, 97 insertions(+), 41 deletions(-) diff --git a/pages/createIrrigation/createIrrigation.wxml b/pages/createIrrigation/createIrrigation.wxml index e1a77ca..5963560 100644 --- a/pages/createIrrigation/createIrrigation.wxml +++ b/pages/createIrrigation/createIrrigation.wxml @@ -8,54 +8,89 @@ </view> <!-- 鐏屾簤寮�濮嬫椂闂� --> - <view class="form-item" bindtap="showTimePicker"> - <view class="form-label">鐏屾簤寮�濮嬫椂闂�</view> - <view class="form-input time-input"> + <view class="form-item"> + <view class="form-label"> + 鐏屾簤寮�濮嬫椂闂�(閫夊~) + <image + class="info-icon" + src="/images/info.svg" + mode="aspectFit" + bindtap="showTimeInfo" + ></image> + </view> + <view class="form-input time-input" bindtap="showTimePicker"> <view class="time-text {{startTime ? '' : 'placeholder'}}">{{startTime || '璇烽�夋嫨鐏屾簤寮�濮嬫椂闂�'}}</view> <image class="arrow-icon" src="/images/arrow-right.svg" mode="aspectFit"></image> </view> </view> - <!-- 椤圭洰鍜岃疆鐏岀粍宓屽鍒楄〃 --> - <view class="list-container"> - <!-- 椤圭洰鍒楄〃 --> - <scroll-view scroll-y="true" class="project-list"> - <block wx:for="{{projectList}}" wx:key="id"> - <view class="project-item"> - <!-- 椤圭洰鍚嶇О --> - <view class="project-header" bindtap="toggleProject" data-index="{{index}}"> - <view class="project-title"> - <image class="toggle-icon {{item.expanded ? 'expanded' : ''}}" src="/images/arrow-down.svg" mode="aspectFit"></image> - <view class="project-name">{{item.name}}</view> - </view> - <view class="project-duration">鎬绘椂闀�: {{item.totalDuration || 0}}鍒嗛挓</view> - </view> - - <!-- 杞亴缁勫垪琛� --> - <view class="group-list {{item.expanded ? 'expanded' : ''}}"> - <block wx:for="{{item.groups}}" wx:for-item="group" wx:for-index="groupIndex" wx:key="id"> - <view class="group-item {{group.selected ? 'selected' : ''}}"> - <view class="group-info" bindtap="navigateToGroupDetail" data-project-index="{{index}}" data-group-index="{{groupIndex}}"> - <view class="group-name">{{group.name}}</view> - </view> - <view class="group-duration"> - <input - class="duration-input" - type="number" - value="{{group.duration}}" - bindinput="onDurationInput" - data-project-index="{{index}}" - data-group-index="{{groupIndex}}" - placeholder="0" - catchtap="stopPropagation" - /> - <text class="duration-unit">鍒嗛挓</text> - </view> - </view> - </block> - </view> + <!-- 鏃堕棿鎻愮ず寮圭獥 --> + <t-dialog + visible="{{timeInfoVisible}}" + title="鏃堕棿璁剧疆璇存槑" + content="鈥� 璁剧疆涓ゅ皬鏃跺悗鐨勭亴婧夋椂闂达細\n鍦ㄦ澶勯�夋嫨鍏蜂綋鐨勫紑濮嬫椂闂碶n\n鈥� 璁剧疆涓ゅ皬鏃跺唴鐨勭亴婧夋椂闂达細\n鍒涘缓瀹屾垚鍚庣偣鍑诲彂甯冨嵆鍙珛鍗冲紑濮嬬亴婧�" + confirmBtn="鎴戠煡閬撲簡" + bind:confirm="onTimeInfoConfirm" + bind:cancel="onTimeInfoConfirm" + /> + + <!-- 閫夋嫨椤圭洰 --> + <view class="form-item" bindtap="showProjectPicker"> + <view class="form-label">閫夋嫨椤圭洰</view> + <view class="form-input"> + <view class="picker-text {{selectedProject ? '' : 'placeholder'}}">{{selectedProject ? selectedProject.name : '璇烽�夋嫨椤圭洰'}}</view> + <image class="arrow-icon" src="/images/arrow-right.svg" mode="aspectFit"></image> + </view> + </view> + + <!-- 杞亴缁勫垪琛� --> + <view class="list-container" wx:if="{{selectedProject}}"> + <view class="list-header"> + <view class="list-title-container"> + <view class="list-title">杞亴缁勫垪琛�</view> + <view class="total-duration"> + <text class="total-duration-label">鎬荤亴婧夋椂闂达細</text> + <text class="total-duration-value">{{totalDuration}}鍒嗛挓</text> </view> + </view> + </view> + <scroll-view + scroll-y="true" + class="group-list" + refresher-enabled="{{true}}" + refresher-triggered="{{isRefreshing}}" + bindrefresherrefresh="onGroupListRefresh" + > + <block wx:if="{{selectedProject.groups && selectedProject.groups.length > 0}}"> + <block wx:for="{{selectedProject.groups}}" wx:key="id" wx:for-item="group" wx:for-index="groupIndex"> + <view class="group-item {{group.selected ? 'selected' : ''}}" bindtap="navigateToGroupDetail" data-group-index="{{groupIndex}}"> + <view class="group-info"> + <text class="group-index">{{groupIndex + 1}}.</text> + <view class="group-name"> + <text class="group-name-text">{{group.name || '鏈懡鍚嶈疆鐏岀粍'}}</text> + <text class="group-intake-count">(鍏眥{group.intakeCount}}涓彇姘村彛)</text> + </view> + </view> + <view class="group-duration"> + <input + class="duration-input" + type="number" + value="{{group.duration}}" + bindinput="onDurationInput" + data-group-index="{{groupIndex}}" + placeholder="0" + catchtap="stopPropagation" + /> + <text class="duration-unit">鍒嗛挓</text> + </view> + </view> + </block> </block> + <view wx:else class="empty-container"> + <image class="empty-image" src="/images/empty.svg" mode="aspectFit"></image> + <view class="empty-text">鏆傛棤杞亴缁勬暟鎹�</view> + <view class="empty-text">璇峰埛鏂版垨绋嶅悗鍐嶈瘯</view> + </view> </scroll-view> </view> @@ -70,8 +105,29 @@ visible="{{timePickerVisible}}" mode="{{['date', 'minute']}}" value="{{pickerValue}}" + start="{{pickerValue}}" format="YYYY-MM-DD HH:mm" bindconfirm="onTimePickerConfirm" bindcancel="onTimePickerCancel" + catchtouchmove="stopPropagation" + z-index="{{1000}}" /> + + <!-- 椤圭洰閫夋嫨鍣ㄥ脊绐� --> + <t-picker + visible="{{projectPickerVisible}}" + title="閫夋嫨椤圭洰" + cancelBtn="鍙栨秷" + confirmBtn="纭" + bind:confirm="onProjectPickerConfirm" + bind:cancel="onProjectPickerCancel" + bind:touchmove="stopPropagation" + bind:touchstart="stopPropagation" + bind:touchend="stopPropagation" + z-index="{{1000}}" + > + <t-picker-item options="{{projectOptions}}" value="{{projectPickerValue}}" /> + </t-picker> + + </view> \ No newline at end of file -- Gitblit v1.8.0