<navbar back home text="编辑信息"></navbar>
<view style="height:{{navigationBarHeight}} "></view>
<form bindsubmit="formSubmit" tt:if="{{showPage}}">
  <view class='section'>
    <text>姓名</text>
    <input tt:if="{{username}}" name="username" type="text" placeholder='{{username}}' />
    <input tt: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 tt:if="{{flag==1}}" class='input' placeholder='请输入生日' disabled/>
      <view tt:if="{{flag==2}}" class="picker"> {{date}}</view>
    </picker>
    <image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image>
  </view>
  <view class='section'>
    <text>身高</text>
    <input tt:if="{{height}}" name="height" type="text" placeholder="请填写身高单位cm" placeholder='{{height}}'/>
    <input tt:if="{{!height}}" name="height" type="text" placeholder="请填写身高单位cm" />
  </view>
  <view class='section'>
    <text>体重</text>
    <input tt:if="{{weight}}" name="weight" type="text" placeholder="请填写体重单位kg" placeholder='{{weight}}'/>
    <input tt: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" tt:for="{{items}}" tt: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' tt:if="{{address}}">{{address}}</view>
    <view class='names' tt:if="{{!address}}">请选择地址</view>
    <image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image>
  </view>
  <view class="child_add" bindtap="childAdd">+ 添加子女信息</view>

  <view class="child_box" tt:for="{{childArr}}" tt:kye="index">
    <view class="contBox">
      <view class='contBox_section'>
        <text>姓名</text>
        <input tt:if="{{item.name}}" type="text" placeholder='{{item.name}}' bindinput="chidName" data-index="{{index}}" />
        <input tt: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 tt:if="{{!item.birthdate}}" class='contBox_picker' placeholder='请输入生日' disabled/>
          <view tt: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}}"> 删除</view>

  </view>
  <button class='btn' tt:if="{{!username}}" formType="submit" hover-class='active' style='background: linear-gradient(270deg, #DDAB5A, #B8832D)'>完成</button>
  <button class='btn' tt:if="{{username}}" formType="submit" hover-class='active' style='background: linear-gradient(270deg, #DDAB5A, #B8832D);'>完成</button>
</form>