<view class="toptip {{tipStaus}} text-white {{tipType}}" style='top:{{CustomBar}}px;'>{{tipText}}</view>
<cu-custom bgColor="bg-color" isBack="{{true}}" title="预警配置">
  <!-- <view slot="content">预警配置</view> -->
</cu-custom>
<view>
  <view class="name">
    <text>预警名称</text>
    <view>
      <input type="text" value="{{name}}" bindinput="setName" disabled="{{isEdit == 'N'}}"
        placeholder="请输入自定义预警名称"></input>
    </view>
  </view>
  <scroll-view scroll-y enable-back-to-top>
    <view>
      <block wx:for="{{ lists }}" wx:for-item="item" wx:for-index="index" wx:key="index">
        <view class="warningList {{ item.isTouchMove ? 'touch-move-active' : '' }}" bindtouchstart="touchStart"
          bindtouchmove="{{isEdit == 'N' ? '':'touchMove'}}" data-index="{{ index }}">
          <view class="ewarning info">
            <view class="name">
              <text>分类</text>
              <view>
                <picker mode="selector" bindchange="setType" value="{{lists[index].type}}" range="{{seleteType}}"
                  data-index="{{index}}" range-key="name" disabled="{{isEdit == 'N'}}">
                  <view class="picker">
                    {{lists[index].type ? lists[index].name : '请选择'}}
                  </view>
                </picker>
              </view>
            </view>
            <view class="temperature">
              <text>温度设置</text>
              <view>
                <input type="text" data-index="{{index}}" bindinput="getValue" value="{{item.minTemp}}"
                  data-type="minTemp" placeholder="最低温度" disabled="{{isEdit == 'N'}}"></input>
                <view>~</view>
                <input type="text" data-index="{{index}}" bindinput="getValue" data-type="maxTemp" placeholder="最高温度"
                  value="{{item.maxTemp}}" disabled="{{isEdit == 'N'}}"></input>
              </view>
            </view>
            <view class="name">
              <text>次数</text>
              <view>
                <input type="text" data-index="{{index}}" data-type="maxCount" value="{{item.maxCount}}"
                  bindinput="getValue" placeholder="请输入发出预警次数" disabled="{{isEdit == 'N'}}"></input>
              </view>
            </view>
          </view>
          <view class="scrollText">
            <view class="del" bindtap="delList" data-index="{{index}}" data-groupid="{{item.id}}"> 删除 </view>
          </view>
        </view>
      </block>
    </view>
  </scroll-view>
  <view class="submit" bindtap='addList' wx:if="{{isEdit == 'Y'}}">
    <image src="/img/bg-add.png"></image> 新增预警配置
    <!-- <button class='add-li' bindtap='delList'>删除选项</button> -->
  </view>
  <view class="foot" bindtap="submit" wx:if="{{isEdit == 'Y'}}">
    <text>确认配置</text>
  </view>
</view>