管灌系统农户端微信小程序(嘉峪关应用)
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
<!--pages/home/home.wxml-->
<view class="base-wrapper">
 
  <view class="head-wrapper">
    <view class="head-top">
      <t-avatar class="avatar-example" image="{{image}}" size="120rpx" bind:tap="handleAvatarTap" />
      <view class="head-text-wrapper">
        <text bind:tap="wxLogin">{{userName}}</text>
        <text class="head-bottom">{{userPhone}}</text>
      </view>
      <view class="head-button-wrapper">
        <text class="unbind" bind:tap="unbind">解绑</text>
        <text class="head-bottom" bind:tap="feedBack">联系客服</text>
      </view>
      <view class="scen-view" bind:tap="scenCode">
        <image class="scen-code" src="/images/scen_code.svg" />
        <text>扫码开阀</text>
      </view>
 
    </view>
  </view>
 
  <view class="center-wrapper">
    <view class="center-view" bind:tap="recharge">
      <image src="/images/wallet.svg" />
      <text>充值</text>
    </view>
    <view class="center-view" bind:tap="openValve">
      <image src="/images/valva.svg" />
      <text>开阀</text>
    </view>
    <view class="center-view" bind:tap="openValveList">
      <image src="/images/record.svg" />
      <text>开关阀记录</text>
    </view>
    <view class="center-view" bind:tap="irrigation">
      <image src="/images/irrigation.svg" />
      <text>轮灌</text>
    </view>
  </view>
 
 
  <view class="bottom-title">
    <text class="bottom-title-text">快速关阀</text>
    <text class="refresh-button" bind:tap="startPullDownRefresh">刷新</text>
  </view>
  <view class="divider"></view>
  <!-- refresher-enabled="true" refresher-threshold="50" -->
  <scroll-view class="scroll-view" scroll-x="false" scroll-y="true" refresher-enabled="{{isRefreshing==false?true:false}}" refresher-threshold="50" bindrefresherrefresh="onPullDownRefresh" refresher-triggered="{{isWXRefreshing}}">
    <view wx:if="{{isRefreshing}}" class="refresh-view">
      <view class="dot"></view>
      <view class="dot"></view>
      <view class="dot"></view>
    </view>
    <view class="scroll-bg">
      <view wx:if="{{listData.length > 0}}" class="list-item" wx:for="{{listData}}" wx:key="index">
        <view class="item-left">
          <!-- <image class="item-img" src="/images/pipeline.svg" /> -->
          <text>{{item.intakeNum}}</text>
          <image class="item-img" src="{{item.isOnLine ? '/images/wifi_no.svg' : '/images/wifi_off.svg'}}" />
        </view>
        <view>
          <!-- <t-switch  class="switch" data-item="{{item}}" bindchange="handleChange" value="{{true}}" label="{{['开', '关']}}" slot="note" /> -->
          <text class="item-button" bind:tap="handleChange" data-item="{{item}}">关阀</text>
        </view>
      </view>
    </view>
    <view wx:if="{{listData.length === 0}}" class="noMore-View-home">
      <image class="noMore-img" src="/images/no_more.svg" />
      <text class="noMore-text">没有开泵记录</text>
    </view>
  </scroll-view>
 
  <t-dialog class="dialog" visible="{{showConfirm}}" content="确认关闭{{waterIntakeName}}吗?" confirm-btn="{{ { content: '确认', variant: 'base', theme: 'danger' } }}" close-on-overlay-click="false" cancel-btn="取消" bind:confirm="confirmDialog" bind:cancel="cancelDialog" />
  <t-dialog class="error-dialog" title="{{errorDialogTitle}}" visible="{{showErrorDialog}}" content="{{errorData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="closeDialog" />
  <t-dialog visible="{{showForceConfirm}}" content="当前虚拟卡被占用,是否强制开阀?" confirm-btn="{{ { content: '强制开阀', variant: 'base', theme: 'danger' } }}" cancel-btn="取消" bind:confirm="confirmForceDialog" bind:cancel="cancelDialog" />
 
  <!-- 使用微信原生弹窗组件 -->
  <view class="project-modal" wx:if="{{showProjectDialog}}">
    <view class="project-modal-mask"></view>
    <view class="project-modal-content">
      <view class="project-modal-header">
        <text class="project-modal-title">请选择项目</text>
      </view>
      <view class="project-modal-body">
       
        <radio-group class="project-radio-group" bindchange="onProjectChange">
          <label class="project-radio {{selectedProject === 'JYG' ? 'project-radio-selected' : ''}}">
            <radio value="JYG" checked="{{selectedProject === 'JYG'}}" color="#1890FF" />
            <text>嘉峪关项目</text>
          </label>
          <label class="project-radio {{selectedProject === 'MQ' ? 'project-radio-selected' : ''}}">
            <radio value="MQ" checked="{{selectedProject === 'MQ'}}" color="#1890FF" />
            <text>民勤项目</text>
          </label>
        </radio-group>
      </view>
      <view class="project-modal-footer">
        <button class="project-modal-btn" disabled="{{!selectedProject}}" bindtap="handleProjectConfirm">确认</button>
      </view>
    </view>
  </view>
 
</view>