<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="top">
    <text>预警名称</text>
    <view>
      <input type="text" value="{{name}}" bindinput="setName" placeholder="请输入自定义预警名称"></input>
    </view>
  </view>
  <block wx:for="{{lists}}" wx:key="{{index}}">
    <view class="ewarning">
      <view class="top">
        <text>分类</text>
        <view>
        <!-- lists[index].type  -->
          <picker mode="selector" bindchange="setType" value="{{lists[index].type}}" range="{{seleteType}}" data-index="{{index}}" range-key="name">
            <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" data-type="minTemp" placeholder="最低温度"></input>
          <view>~</view>
          <input type="text" data-index="{{index}}" bindinput="getValue" data-type="maxTemp" placeholder="最高温度"></input>
        </view>
      </view>
      <view class="top">
        <text>次数</text>
        <view>
          <input type="number" data-index="{{index}}" data-type="maxCount" bindinput="getValue" placeholder="请输入发出预警次数"></input>
        </view>
      </view>
    </view>
  </block>
  <view class="submit" bindtap='addList'>
    <image src="/img/bg-add.png"></image> 新增预警配置
    <!-- <button class='add-li' bindtap='delList'>删除选项</button> -->
  </view>
  <view class="foot" bindtap="submit">
    <text>确认配置</text>
  </view>
</view>