管灌系统农户端微信小程序(嘉峪关应用)
zuoxiao
2025-04-07 5d3ed12a593020ec7fd9b5af50991f68b191e649
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<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="时间设置说明"
    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">
              <view class="group-name">{{group.name || '未命名轮灌组'}}  (共{{group.intakeCount}}个取水口)</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.png" 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>