更新灌溉详情页面,添加命令发布失败数的显示和样式,优化状态管理逻辑以提升用户体验。
|  |  |  | 
|---|
|  |  |  | "t-picker-item": "tdesign-miniprogram/picker-item/picker-item", | 
|---|
|  |  |  | "t-input": "tdesign-miniprogram/input/input", | 
|---|
|  |  |  | "t-button": "tdesign-miniprogram/button/button", | 
|---|
|  |  |  | "t-dialog": "tdesign-miniprogram/dialog/dialog", | 
|---|
|  |  |  | "t-toast": "tdesign-miniprogram/toast/toast" | 
|---|
|  |  |  | "t-dialog": "tdesign-miniprogram/dialog/dialog" | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | "enablePullDownRefresh": false, | 
|---|
|  |  |  | "backgroundColor": "#f5f5f5", | 
|---|
|  |  |  | 
|---|
|  |  |  | groupList: [], | 
|---|
|  |  |  | planId: '', | 
|---|
|  |  |  | planStatusText: '', | 
|---|
|  |  |  | planStatusClass: '' | 
|---|
|  |  |  | planStatusClass: '', | 
|---|
|  |  |  | failureCount: 0 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | stopTime: data.planStopTime, | 
|---|
|  |  |  | groupList: groupList, | 
|---|
|  |  |  | planStatusText: planStatusText, | 
|---|
|  |  |  | planStatusClass: planStatusClass | 
|---|
|  |  |  | planStatusClass: planStatusClass, | 
|---|
|  |  |  | failureCount: data.failureCount || 0 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | <text class="label">灌溉结束时间:</text> | 
|---|
|  |  |  | <text class="value">{{stopTime}}</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 取水口命令发布失败数 --> | 
|---|
|  |  |  | <view class="time-info" wx:if="{{failureCount > 0}}"> | 
|---|
|  |  |  | <text class="label">命令发布失败数:</text> | 
|---|
|  |  |  | <text class="value error-text">{{failureCount}}</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 轮灌组列表 --> | 
|---|
|  |  |  | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 命令发布失败数样式 */ | 
|---|
|  |  |  | .time-info .error-text { | 
|---|
|  |  |  | color: #ff4d4f; | 
|---|
|  |  |  | font-weight: bold; | 
|---|
|  |  |  | background-color: rgba(255, 77, 79, 0.1); | 
|---|
|  |  |  | padding: 4rpx 12rpx; | 
|---|
|  |  |  | border-radius: 4rpx; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 项目列表样式 */ | 
|---|
|  |  |  | .project-list { | 
|---|
|  |  |  | flex: 1; | 
|---|
|  |  |  | 
|---|
|  |  |  | color: #F44336; | 
|---|
|  |  |  | padding-left: 20rpx; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .failure-count { | 
|---|
|  |  |  | margin-top: 10rpx; | 
|---|
|  |  |  | font-size: 28rpx; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .failure-count .label { | 
|---|
|  |  |  | color: #666; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .failure-count .error-text { | 
|---|
|  |  |  | color: #ff4d4f; | 
|---|
|  |  |  | font-weight: bold; | 
|---|
|  |  |  | margin-left: 8rpx; | 
|---|
|  |  |  | } | 
|---|