管灌系统农户端微信小程序(嘉峪关应用)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<view class="container">
  <view class="all-waterIntake" wx:if="{{currentTab === 0}}">
    <view class="search-container">
      <input class="search-input" value="{{inputValue}}" placeholder="请输入取水口编码后点击搜索" bindinput="onInput" />
      <t-button class="search-button" theme="primary" size="large" icon="search" shape="square" aria-label="搜索" bindtap="onSearch" style="background-color: #1890FF; border: none; height: 80rpx;"></t-button>
    </view>
    <view class="search-results" wx:if="{{allWaterPoints.length > 0}}" bindtap="closeSearch">
      <block wx:for="{{allWaterPoints}}" wx:key="index">
        <view class="result-item" bindtap="choseCard"  data-item="{{item}}">
          <text>{{item.intakeNum}}</text>
        </view>
      </block>
    </view>
    <scroll-view class="list-container" scroll-y="true" refresher-enabled="true" refresher-threshold="50" bindrefresherrefresh="onPullDownRefresh_common" refresher-triggered="{{isRefreshing_common}}">
      <block wx:for="{{commonWaterPoints}}" wx:key="index">
        <view class="item">
          <view class="item-left">
            <image class="item-img-left" src="/images/valve.svg" />
            <text class="water-intake-name">{{item.intakeNum}}</text>
            <image class="item-img" src="{{item.isOnLine ? '/images/wifi_no.svg' : '/images/wifi_off.svg'}}" />
          </view>
          <text  class="item-button" bindtap="choseCard" data-item="{{item}}">开阀</text>
        </view>
      </block>
      <view wx:if="{{commonWaterPoints.length === 0}}" class="noMore-View">
        <image class="noMore-img" src="/images/no_more.svg" />
        <text class="noMore-text">没有数据</text>
      </view>
    </scroll-view>
  </view>
 
  <t-dialog class="dialog" visible="{{showConfirm}}" content="确认打开{{choseItem.intakeNum}}吗?" confirm-btn="{{ { content: '确认', variant: 'base', theme: 'danger' } }}" close-on-overlay-click="false" cancel-btn="取消"  bind:confirm="confirmDialog" bind:cancel="closeDialog" />
 
  <t-dialog class="error-dialog"  title="开阀错误" visible="{{showErrorDialog}}" content="{{errorData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="closeErrorDialog" />
 
  <t-dialog visible="{{showForceConfirm}}" content="当前虚拟卡被占用,是否强制开阀?" confirm-btn="{{ { content: '强制开阀', variant: 'base', theme: 'danger' } }}" cancel-btn="取消" bind:confirm="confirmForceDialog" bind:cancel="cancelDialog" />
<!-- 黑色蒙层 -->
<view class="overlay" wx:if="{{showDialog}}" bindtap="closeDialog"></view>
  <!-- 选择灌溉模式 -->
  <view class="dialog" wx:if="{{showDialog}}">
    <image class="close" src="/images/close.svg" bindtap="handleClost"></image>
    <view class="dialog-content" wx:if="{{dialog_mode}}">
      <view class="dialog-title">请选择开关阀方式</view>
      <button bindtap="postOpenValva">手动开阀手动关阀</button>
      <button bindtap="handleSetDuration">开阀后定时长自动关阀</button>
      <button bindtap="handleSetWaterVolume">开阀后定水量自动关阀</button>
    </view>
    <view class="dialog-content" wx:if="{{dialog_time}}">
      <view class="dialog-title">
      <image class="dialog-title-img" bind:tap="dialogBack" src="/images/back.svg"></image>
      <text class="dialog-title-text">开阀后定时长自动关阀</text>
      </view>
      <view>
        <view class="row">
          <view class="choseitem{{activeIndex === 0 ? 'active' : ''}}" bindtap="handleTimeWrapperTap" data-index="0">
            <view class="chose-wrapper">
              <text class="chose-number">{{irrigateProfile[0].defaultValue}}</text>
              <text class="chose-label">{{irrigateProfile[0].unitText}}</text>
            </view>
          </view>
          <view class="choseitem{{activeIndex === 1 ? 'active' : ''}}" bindtap="handleTimeWrapperTap" data-index="1">
            <view class="chose-wrapper">
              <text class="chose-number">{{irrigateProfile[1].defaultValue}}</text>
              <text class="chose-label">{{irrigateProfile[1].unitText}}</text>
            </view>
          </view>
        </view>
        <view class="row">
          <view class="choseitem{{activeIndex === 2 ? 'active' : ''}}" bindtap="handleTimeWrapperTap" data-index="2">
            <view class="chose-wrapper">
              <text class="chose-number">{{irrigateProfile[2].defaultValue}}</text>
              <text class="chose-label">{{irrigateProfile[2].unitText}}</text>
            </view>
          </view>
          <view class="choseitem{{activeIndex === 3 ? 'active' : ''}}" bindtap="handleTimeWrapperTap" data-index="3">
            <view class="chose-wrapper">
              <text class="chose-number">{{irrigateProfile[3].defaultValue}}</text>
              <text class="chose-label">{{irrigateProfile[3].unitText}}</text>
            </view>
          </view>
        </view>
        <view>
          <t-input label="" value="{{costiomTime}}" placeholder="或在此输入自定义时间"  type="number" bind:change="onTimeInputChange">
          </t-input>
          <t-radio-group bind:change="onGroupOpenTimeTypeChange" wx:if="{{group_time}}" default-value="0" borderless t-class="box">
            <t-radio block="{{false}}" label="分钟" value="0" />
            <t-radio block="{{false}}" label="小时" value="1" />
          </t-radio-group>
          <t-radio-group bind:change="onGroupOpenTimeChange" value="{{radioValue}}" default-value="0" borderless t-class="box">
            <t-radio block="{{false}}" label="现在开阀" value="0" />
            <t-radio block="{{false}}" label="计划开阀时间" value="1" />
          </t-radio-group>
          <text class="open-time" wx:if="{{isShowOpenTime}}">{{openTimeText}}</text>
          <button bindtap="btnOpenOnTime">开阀</button>
        </view>
      </view>
    </view>
    <view class="dialog-content" wx:if="{{dialog_water}}">
      <view class="dialog-title">
      <image class="dialog-title-img" bind:tap="dialogBack" src="/images/back.svg"/>
      <text class="dialog-title-text">开阀后定水量自动关阀</text>
      </view>
      <view>
        <view class="row">
          <view class="choseitem{{activeIndex === 0 ? 'active' : ''}}" bindtap="handleWaterWrapperTap" data-index="0">
            <view class="chose-wrapper">
              <text class="chose-number">{{irrigateProfile[0].defaultValue}}</text>
              <text class="chose-label">{{irrigateProfile[0].unitText}}</text>
            </view>
          </view>
          <view class="choseitem{{activeIndex === 1 ? 'active' : ''}}" bindtap="handleWaterWrapperTap" data-index="1">
            <view class="chose-wrapper">
              <text class="chose-number">{{irrigateProfile[1].defaultValue}}</text>
              <text class="chose-label">{{irrigateProfile[1].unitText}}</text>
            </view>
          </view>
        </view>
        <view class="row">
          <view class="choseitem{{activeIndex === 2 ? 'active' : ''}}" bindtap="handleWaterWrapperTap" data-index="2">
            <view class="chose-wrapper">
              <text class="chose-number">{{irrigateProfile[2].defaultValue}}</text>
              <text class="chose-label">{{irrigateProfile[2].unitText}}</text>
            </view>
          </view>
          <view class="choseitem{{activeIndex === 3 ? 'active' : ''}}" bindtap="handleWaterWrapperTap" data-index="3">
            <view class="chose-wrapper">
              <text class="chose-number">{{irrigateProfile[3].defaultValue}}</text>
              <text class="chose-label">{{irrigateProfile[3].unitText}}</text>
            </view>
          </view>
        </view>
        <view>
          <t-input label="" value="{{costiomWater}}"    suffix="立方米" align="right" type="number" placeholder="或在此输入自定义水量" bind:change="onWaterInputChange">
          </t-input>
          <t-radio-group bind:change="onGroupOpenTimeChange" value="{{radioValue}}" default-value="0" borderless t-class="box">
            <t-radio block="{{false}}" label="现在开阀" value="0" />
            <t-radio block="{{false}}" label="计划开阀时间" value="1" />
          </t-radio-group>
          <text class="open-time" wx:if="{{isShowOpenTime}}">{{openTimeText}}</text>
          <button bindtap="btnOpenOnWater">开阀</button>
        </view>
      </view>
    </view>
  </view>
  <!-- 年月日时分 -->
  <t-date-time-picker title="选择日期和时间" visible="{{datetimeVisible}}" mode="minute" value="{{datetime}}" format="YYYY-MM-DD HH:mm" bindchange="onConfirm" bindpick="onColumnChange" bindcancel="hidePicker" start="{{dateStartTime}}" end="{{dateEndTime}}"/>
 
</view>