<!--packageE/form/form.wxml-->
<view class="diy-form">
  <view class="form" wx:if="{{datas.form.title}}" style="background-size: 100% auto; background-color: {{datas.preview_color.color}}; background-image: url({{datas.preview_color.isColor == 2 ? datas.preview_color.image : ''}})">
    <view style="padding:20rpx 24rpx; background-color:{{datas.preview_color.color}};font-size: 14px;font-weight: bold;text-align: center">{{datas.form.title}}</view>
    <view class="main" wx:if="{{status==0}}" >
      <block wx:for="{{diydata}}" wx:for-index="idx" wx:key="idx">
        <view wx:if="{{item.type == 'diyinput'}}">
          <van-field wx:if="{{item.data.tp_must == 1}}" required value="{{item.value}}" label="{{item.data.tp_name}}：" placeholder="{{item.data.placeholder}}" bind:blur="tpnameinp" data-idex="{{idx}}" default-value="#ffffff" />
          <van-field wx:if="{{item.data.tp_must == 0}}" value="{{item.value}}" label="{{item.data.tp_name}}：" placeholder="{{item.data.placeholder}}" bind:blur="tpnameinp" data-idex="{{idx}}"  default-value="#ffffff"/>
        </view>
        <view class="image-list" wx:if="{{item.type == 'diyimage'}}" style="background-color:{{params.bgcolor}};">
          <view class="otherphoto section">
            <view class="top">
              <view class="span cellTitleStyle">
              <text style="color:red;font-size:26rpx;">*</text>
              {{item.data.tp_name}}：</view>
            </view>
            <view class="imgflex">
              <block wx:for-item="val" wx:for-index="index_1" wx:key="{{index_1}}" wx:for="{{item.imgUrls}}">
                <view class="photobox">
                  <image src="{{val}}" mode='widthFix' />
                  <view class="i" data-index="{{idx}}" data-indexc="{{index_1}}" catchtap="removeImg"></view>
                </view>
              </block>
              <view class="photoshow" data-name="{{item.name}}" catchtap="onRead_1" data-idex="{{idx}}">
                <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/up_icon.png" mode='widthFix' />
              </view>
            </view>
          </view>
        </view>
        <block wx:if="{{item.type == 'diytextarea'}}">
          <view class="cell_box" style="background-color:{{params.bgcolor}};">
            <view class="title">
              <text wx:if="{{item.data.tp_must}}" style="color:red;">*</text>
              {{item.data.tp_name}}
            </view>
            <van-cell-group>
              <van-field type="textarea" value="{{item.value.value.value}}" placeholder="{{item.data.placeholder}}" border="{{false}}" maxlength="{{100}}" data-idex="{{idx}}" bind:blur="diytextareainp" default-value="{{params.bgcolor}}" />
            </van-cell-group>
          </view>
        </block>
        <block wx:if="{{item.type == 'diycheckbox'}}">
          <view class="cell_box" style="background-color:{{params.bgcolor}};">
            <view class="title">
              <text wx:if="{{item.data.tp_must}}" style="color:red;">*</text>
              {{item.data.tp_name}}
            </view>
            <van-cell-group>
              <van-checkbox-group wx:for="{{item.data.tp_text}}" wx:key="index" wx:for-item="ck" value="{{item.value}}" data-idex="{{idx}}" bind:change="checkboxinp">
                <van-checkbox name="{{ck}}">{{ck}}</van-checkbox>
              </van-checkbox-group>
            </van-cell-group>
          </view>
        </block>
        <block wx:if="{{item.type == 'diyselect'}}">
          <van-cell-group>
            <van-cell data-index="{{index}}" is-link bind:click="diyselectBtn" data-idex="{{idx}}" selectCell="{{params.bgcolor}}" value="{{item.value}}">
              <view solt="title" style="text-align: left;height:100%;text-align: left;height: 100%;display: flex;align-items: center;">
                <view wx:if="{{item.data.tp_must}}">*</view>
                <text>{{item.data.tp_name}}</text>
              </view>
            </van-cell>
          </van-cell-group>
        </block>
        <block wx:if="{{item.type == 'diyradio'}}">
          <view class="cell_box" style="background-color:#ffffff;">
            <view class="title">
              <text wx:if="{{item.data.tp_must}}" style="color:red;">*</text>
              {{item.data.tp_name}}
            </view>
            <van-cell-group class="radio">
              <van-radio-group wx:for="{{item.data.tp_text}}" wx:for-item="ritem" value="{{item.value}}" wx:for-index="index_radio" wx:key="index_radio" data-idex="{{idx}}" bind:change="raidinp">
                <van-radio name="{{ritem}}">{{ritem}}</van-radio>
              </van-radio-group>
            </van-cell-group>
          </view>
        </block>
        <block wx:if="{{item.type == 'diycity'}}">
          <van-cell-group>
            <van-cell title-style="color: #969799;" required="{{item.data.tp_must?true:false}}" center="{{true}}" title="{{item.data.tp_name}}：" data-idex="{{idx}}" bind:click="showAddBtn" value="{{item.value}}" selectCell="{{params.bgcolor}}" is-link />
          </van-cell-group>
        </block>
        <block wx:if="{{item.type == 'diydate'}}">
          <van-cell title-style="color: #969799;" required="{{item.data.tp_must?true:false}}" center="{{true}}" bind:click="openPicker" data-idex="{{idx}}" title="{{item.data.tp_name}}" value="{{item.shoTime}}" selectCell="{{params.bgcolor}}" is-link />
        </block>
        <block wx:if="{{item.type == 'diyusername'}}">
          <van-field wx:if="{{item.data.tp_must == 1}}" required value="{{item.value}}" placeholder="{{item.data.placeholder}}" data-idex="{{idx}}" bind:blur="tpnameinp" default-value="{{params.bgcolor}}">
            <text slot="label" class="cellTitleStyle">{{item.data.tp_name}}:</text>
          </van-field>
          <van-field wx:if="{{item.data.tp_must == 0}}" value="{{item.value}}" placeholder="{{item.data.placeholder}}" data-idex="{{idx}}" bind:blur="tpnameinp" default-value="{{params.bgcolor}}">
            <text slot="label" class="cellTitleStyle">{{item.data.tp_name}}:</text>
          </van-field>
        </block>
        <block wx:if="{{item.type == 'diypassword'}}">
          <van-field type="password" wx:if="{{item.data.tp_must == 1}}" required value="{{item.value}}" label="{{item.data.tp_name}}：" placeholder="{{item.data.placeholder}}" data-idex="{{idx}}" bind:blur="tpnameinp" default-value="#ffffff" />
          <van-field type="password" wx:if="{{item.data.tp_must == 0}}" value="{{item.value}}" label="{{item.data.tp_name}}：" placeholder="{{item.data.placeholder}}" data-idex="{{idx}}" bind:blur="tpnameinp" default-value="#ffffff" />
        </block>
      </block>
    </view>
    <block wx:for="{{diydata}}" wx:key="index">
      <block wx:if="{{item.type == 'diyselect'}}">
        <van-action-sheet show="{{item.diysishow}}" data-index="{{index}}" actions="{{item.sitem}}" bind:close="sitemClose" bind:select="sitemSelectBtn" cancel-text="取消" bind:cancel="sitemClose" />
      </block>
    </block>
    <block wx:for="{{diydata}}" wx:key="index">
      <block wx:if="{{item.type == 'diycity'}}">
        <view class="b-mask {{item.showAdd}}" data-idex="{{index}}" bindtap="_closeDateLw"></view>
        <view class="dateBe {{item.showAdd}}">
          <view class="head">
            <view class="ll" data-idex="{{index}}" bindtap="_closeDateLw">取消</view>
            <view class="rr" data-idex="{{index}}" bindtap="resultAdd">确定</view>
          </view>
          <view class="main">
            <picker-view indicator-style="height: 50px;" style="width: 100%; height: 300px;" value="{{[pickerValue[0],pickerValue[1],pickerValue[2]]}}" bindchange="bindChange">
              <picker-view-column id="provinceData">
                <view wx:for="{{provinceData}}" wx:for-index="pidx" wx:key="pidx" style="line-height: 50px">{{item.areaname}}</view>
              </picker-view-column>
              <picker-view-column id="cityData">
                <view wx:for="{{cityData}}" wx:for-index="pidx" wx:key="pidx" style="line-height: 50px">{{item.areaname}}</view>
              </picker-view-column>
              <picker-view-column id="districtData">
                <view wx:for="{{districtData}}" wx:for-index="pidx" wx:key="pidx" style="line-height: 50px">{{item.areaname}}</view>
              </picker-view-column>
            </picker-view>
          </view>
        </view>
      </block>
    </block>
    <block wx:for="{{diydata}}" wx:key="index">
      <block wx:if="{{item.type == 'diydate'}}">
        <van-popup position="bottom" show="{{item.timeShow}}" data-idex="{{index}}" bind:close="dateClose">
          <van-datetime-picker type="date" value="{{currentDate}}" data-idex="{{index}}" bind:cancel="dateClose" bind:confirm="birthdayconfirm" min-date="{{startDate}}"/>
        </van-popup>
      </block>
    </block>
    <view class="b-mask {{showCity1}}" bindtap="_closeDateLw_1"></view>
    <view class="dateBe {{showCity1}}">
      <view class="head">
        <view class="ll" bindtap="_closeDateLw_1">取消</view>
        <view class="rr" bindtap="resultAdd_1">确定</view>
      </view>
      <view class="main">
        <picker-view indicator-style="height: 50px;" style="width: 100%; height: 300px;" value="{{[pickerValue[0],pickerValue[1],pickerValue[2]]}}" bindchange="bindChange">
          <picker-view-column id="provinceData">
            <view wx:for="{{provinceData}}" wx:for-index="pidx" wx:key="pidx" style="line-height: 50px">{{item.areaname}}</view>
          </picker-view-column>
          <picker-view-column id="cityData">
            <view wx:for="{{cityData}}" wx:for-index="pidx" wx:key="pidx" style="line-height: 50px">{{item.areaname}}</view>
          </picker-view-column>
          <picker-view-column id="districtData">
            <view wx:for="{{districtData}}" wx:for-index="pidx" wx:key="pidx" style="line-height: 50px">{{item.areaname}}</view>
          </picker-view-column>
        </picker-view>
      </view>
    </view>
    <view class="main" wx:if="{{status===1}}">
      <block wx:for="{{formList}}" wx:for-index="idx" wx:key="idx">
        <view wx:if="{{item.data_type == '88'||item.data_type=='99'}}">
          <van-field wx:if="{{item.tp_must == 1}}" required readonly="true" value="{{item.value}}" label="{{item.title}}" default-value="#ffffff" input-align="right"/>
          <van-field wx:if="{{item.tp_must == 0}}" readonly="true" value="{{item.value}}" label="{{item.title}}" default-value="#ffffff" input-align="right"/>
        </view>
        <block wx:if="{{item.data_type == '5'}}">
          <view class="cell_box" style="background-color:#ffffff;border-bottom:solid 1px #ccc">
            <view class="title">
              {{item.title}}
            </view>
          </view>
          <view class="wrap">
            <view wx:for="{{item.value}}" wx:key="index" wx:index="{{index}}" class="photo">
              <image src="{{item}}"></image>
            </view>
          </view>
        </block>
        <block wx:if="{{item.data_type == '1'}}">
          <view class="cell_box" style="background-color:#ffffff;">
            <view class="title">
              {{item.title}}
            </view>
            <van-cell-group>
              <van-field type="textarea" readonly="true" value="{{item.value}}" border="{{false}}" maxlength="{{100}}" data-idex="{{idx}}" bind:blur="diytextareainp" default-value="#ffffff" />
            </van-cell-group>
          </view>
        </block>
        <van-cell-group>
          <block wx:if="{{item.data_type == '3'||item.data_type == '0'||item.data_type == '4'||item.data_type == '2'||item.data_type == '7'||item.data_type == '9'}}">
            <van-cell title="{{item.title}}" value="{{item.value}}" selectCell="#ffffff" />
          </block>
        </van-cell-group>
      </block>
    </view>
    <view class="btn" style="background-color:{{datas.preview_color.color}};padding-bottom: 5px;">
      <view class="save" catchtap="submit" wx:if="{{status==0}}">立即提交</view>
      <view class="button" wx:if="{{status==1}}">已提交</view>
    </view>
  </view>
</view>
