<navbar back home text="编辑信息"></navbar>
<view style="height:{{navigationBarHeight}} "></view>
<form bindsubmit="formSubmit" wx:if="{{showPage}}">
  <view wx:if="{{type}}">
    <view class='section'>
      <text>姓名</text>
      <input wx:if="{{username}}" name="username" type="text" placeholder='{{username}}' />
      <input wx:if="{{!username}}" name="username" type="text" placeholder='请填写名字' />
    </view>
    <view class="section sec">
      <text>生日</text>
      <picker mode="date" value="{{date}}" start="1930-09-01" end="{{dateEnd}}" bindchange="bindDateChange">
        <input wx:if="{{flag==1}}" class='input' placeholder='请输入生日' disabled />
        <view wx:if="{{flag==2}}" class="picker"> {{date}}</view>
      </picker>
      <!-- <image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image> -->
    </view>
    <view class='section'>
      <text>身高</text>
      <input wx:if="{{height}}" name="height" type="text" placeholder='请填写身高单位cm' placeholder='{{height}}cm' />
      <input wx:if="{{!height}}" name="height" type="text" placeholder='请填写身高单位cm' />
    </view>
    <view class='section'>
      <text>体重</text>
      <input wx:if="{{weight}}" name="weight" type="text" placeholder='请填写体重单位kg' placeholder='{{weight}}kg' />
      <input wx:if="{{!weight}}" name="weight" type="text" placeholder='请填写体重单位kg' />
    </view>
    <view class="section section_gap">
      <text>性别</text>
      <radio-group class="radio-group" bindchange="radioChange">
        <radio class="radio" wx:for-items="{{items}}" wx:key="name" value="{{item.name}}" checked="{{item.checked}}">
          <text>{{item.value}}</text>
        </radio>
      </radio-group>
    </view>

    <view class='address sec' bindtap='address'>
      <text>住址</text>
      <view class='names' wx:if="{{address}}">{{address}}</view>
      <view class='names' wx:if="{{!address}}">请选择地址</view>
      <!-- <image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image> -->
    </view>
  </view>

  <view wx:else>
    <view class="child_add" bindtap="childAdd">+ 添加子女信息</view>

    <view class="child_box" wx:for="{{childArr}}" wx:key="index">
      <view class="contBox">
        <view class='contBox_section'>
          <text>姓名</text>
          <input wx:if="{{item.name}}" type="text" value='{{item.name}}' bindinput="chidName" data-index="{{index}}" />
          <input wx:if="{{!item.name}}" type="text" placeholder='请输入' bindinput="chidName" data-index="{{index}}" />
        </view>

        <view class="contBox_section sec">
          <text>生日</text>
          <picker class="contBox_picker" mode="date" value="{{date}}" start="1930-09-01" end="{{dateEnd}}" bindchange="chidBirthday" data-index="{{index}}">
            <input wx:if="{{!item.birthdate}}" class='contBox_picker' placeholder='请输入生日' disabled />
            <view wx:if="{{item.birthdate}}" class="contBox_picker"> {{item.birthdate}}</view>
          </picker>
          <image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image>
        </view>

        <view class="contBox_section section_gap">
          <text>性别</text>
          <radio-group class="radio-group" bindchange="childSex" data-index="{{index}}">
            <radio class="radio" value="1" checked="{{item.sex==1?true:false}}">
              <text>男</text>
            </radio>
            <radio class="radio" value="2" checked="{{item.sex==2?true:false}}">
              <text>女</text>
            </radio>
          </radio-group>
        </view>
      </view>

      <view class="det_child_box" bindtap="childDel" data-index="{{index}}" data-id="{{item.id}}">删除</view>
    </view>


  </view>

  <view class="btns">
    <button class="submit" type="primary" wx:if="{{!username}}" formType="submit" hover-class='active'>完成</button>
    <button class="submit" wx:if="{{username}}" type="primary" formType="submit" hover-class='active'>完成</button>
  </view>

</form>