<view class="create-irrigation-container">
|
<!-- 计划编号 -->
|
<view class="form-item">
|
<view class="form-label">计划编号</view>
|
<view class="form-input">
|
<input type="text" placeholder="请输入计划编号" value="{{planCode}}" bindinput="onPlanCodeInput" />
|
</view>
|
</view>
|
|
<!-- 灌溉开始时间 -->
|
<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>
|
|
<!-- 时间提示弹窗 -->
|
<t-dialog
|
visible="{{timeInfoVisible}}"
|
title="时间设置说明"
|
confirmBtn="我知道了"
|
bind:confirm="onTimeInfoConfirm"
|
bind:cancel="onTimeInfoConfirm"
|
>
|
<view slot="content" class="time-info-content">
|
<view class="time-info-item">
|
<view class="info-text-container">
|
<view class="info-title">设置八小时后的灌溉时间</view>
|
<view class="info-desc">在此处选择具体的开始时间</view>
|
</view>
|
</view>
|
<view class="divider"></view>
|
<view class="time-info-item">
|
<view class="info-text-container">
|
<view class="info-title">设置八小时内的灌溉时间</view>
|
<view class="info-desc">创建完成后点击发布即可立即开始灌溉</view>
|
</view>
|
</view>
|
</view>
|
</t-dialog>
|
|
<!-- 选择项目 -->
|
<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>
|
|
<!-- 底部确认按钮 -->
|
<view class="bottom-button">
|
<button class="confirm-button" hover-class="confirm-button-hover" bindtap="onConfirm">确认</button>
|
</view>
|
|
<!-- 时间选择器弹窗 -->
|
<t-date-time-picker
|
title="选择灌溉开始时间"
|
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>
|