<navigator class="common_fix common_home" wx:if="{{currentPages == 1}}" open-type="reLaunch" url="/pages/home/index" hover-class="none">
  <text class="icon icon-home"></text>
</navigator>
<view class='bar-bottom buttons-row'>
  <button id="addPresonInfo" bindtap="{{msgType==0?'addCard':'submit'}}" class='button button-subtitle' data-act="add" data-needClothesSize="{{datas.needClothesSize}}" data-needShoeSize="{{datas.needShoeSize}}" data-id="">{{msgType==0?'新增出行人':'保存'}}</button>
</view>
<view class="tab-bar white-bg" wx:if="{{isSelected}}">
  <view class="tab-item purchase_info {{msgType == 0 ? 'tab-active' : ''}}" data-index="0" bindtap="setTabbar">
    <view class="label">出行人信息</view>
  </view>
  <view class="tab-item purchase_info {{msgType == 1 ? 'tab-active' : ''}}" data-index="1" bindtap="setTabbar">
    <view class="label">购买信息</view>
  </view>
</view>
 <!-- <view class="tab-bar white-bg" wx:if="{{isSelected}}">
  <view class="tab-item {{ctype == 0 ? 'active' : ''}}" data-index="0" bindtap="setTabbar">
    <view class="label">儿童单飞信息</view>
  </view>
  <view class="tab-item {{ctype == 1 ? 'active' : ''}}" data-index="1" bindtap="setTabbar">
    <view class="label">亲子每人信息</view>
  </view>
</view> -->
<view class='content'>
  <block wx:if="{{msgType==0}}">
    <view class="cards-tips"><view class="tips-content"> 请{{isSelected ? "设置" : "选择"}}出行人证件信息，用于签订旅游合同并购买保险。</view></view>
    <view class="head_label" wx:if="{{isSelected}}">
      <view class="title">证件类型</view>
      <view class="switch">
        <text class="switch_label {{ctype == 0 ? 'switch_label_active' : 'switch_label_noactive'}}" data-index="0" bindtap="swtichTab">儿童</text>
        <text class="switch_label {{ctype == 1 ? 'switch_label_active' : 'switch_label_noactive'}}" data-index="1" bindtap="swtichTab">亲子</text>
      </view>
    </view>
    <view class='noData' hidden='{{list.length > 0 ? true : false}}'><text class="icon icon-info"></text><text>~还没有添加任何人员~</text></view>
    <view class="list-block" wx:if='{{list.length > 0 && ctype == 0}}'>
      <checkbox-group class="check_people" name="id" id="check" bindchange="checkboxChange">
      <view class="card-list item-content" wx:for-items="{{list}}" wx:key="id">
        <label class="item-inner label-checkbox" style="flex: 1;">
          <view class='item-media' hidden="{{isSelected}}"><checkbox color='#fff' value="{{item.id}}|{{item.name}}|{{item.parent ? item.parent.name : ''}}|{{item.weight}}|{{item.height}}|{{item.bodyType}}|{{item.disabled}}|{{item.birthdayStr}}|{{item.idcard}}|{{index}}|{{item.clothesSize || ''}}|{{item.shoesSize || ''}}|{{item.id}}|{{item.sex}}" data-index="{{index}}" checked="{{item.default ? true:false}}" /></view>
          <view class='item-text'>
            <view class="card-list-info">
              <text class="name"><text style="font-weight: 700;">{{item.name}}</text><text class="" style="font-size: 20rpx;margin-left: 20rpx;">{{item.position}}<text wx:if="{{item.perfect}}" class="perfect">待完善</text>\n</text>
              </text>
              <text>{{item.sex == 1 ? '男':'女'}} {{item.birthdayStr}} {{item.height}}CM {{item.weight}}KG {{item.bodyType == '0'?'偏瘦':item.bodyType == '1'?'正常':item.bodyType == '2'?'偏胖':''}}\n{{item.cardTypeStr}}：{{item.idcard}}</text>
            </view>
            <view class="card-list-info" style="border-top: 2rpx solid #eee;" wx:if="{{item.parent}}">
              <text class="name">{{item.parent.name}}<text class="" style="font-size: 20rpx;margin-left: 20rpx;">监护人\n</text></text>
              <text>{{item.parent.sex == 1 ? '男':'女'}} {{item.parent.birthdayStr}}\n{{item.parent.cardTypeStr}}：{{item.parent.idcard}}</text>
            </view>
          </view>
        </label>
        <view class='item-icon card-modfiy'>
            <view class='icon icon-bj font23' id="editPersonInfo" bindtap='addCard' data-act="edit" data-id="{{item.id}}" data-parentid="{{item.parent ? item.parent.id : ''}}" data-name="{{item.name}}" data-sex="{{item.sex}}" data-birthday="{{item.birthdayStr}}" data-cardtype="{{item.cardType}}" data-weight="{{item.weight}}" data-idcard="{{item.idcard}}" data-clothessize="{{item.clothesSize}}" data-shoessize="{{item.shoesSize}}" data-height="{{item.height}}" data-bodyType="{{item.bodyType}}" data-needClothesSize="{{datas.needClothesSize}}" data-needShoeSize="{{datas.needShoeSize}}"></view>
          </view>
      </view>
      </checkbox-group>
    </view>
    <view class="list-block" wx:if='{{list.length > 0 && ctype == 1}}'>
      <checkbox-group class="check_people" name="id" bindchange="checkboxChange">
      <view class="card-list item-content" wx:for-items="{{list}}" wx:key="id">
        <label class="item-inner label-checkbox" style="flex: 1;">
          <view class='item-media' hidden="{{isSelected}}"><checkbox color='#fff' value="{{item.id}}|{{item.name}}|{{item.parent ? item.parent.name : ''}}|{{item.weight}}|{{item.height}}|{{item.bodyType}}|{{item.disabled}}|{{item.birthdayStr}}|{{item.idcard}}|{{index}}|{{item.clothesSize || ''}}|{{item.shoesSize || ''}}|{{item.id}}|{{item.sex}}" data-index="{{index}}" checked="{{item.default ? true:false}}" /></view>
          <view class='item-text'>
            <view class="card-list-info">
              <text class="name"><text style="font-weight: 700;">{{item.name}}</text> <text class="" style="font-size: 20rpx;margin-left: 20rpx;">{{item.position}}<text wx:if="{{item.perfect}}" class="perfect">待完善</text>\n</text></text>
              <text>{{item.sex == 1 ? '男':'女'}} {{item.birthdayStr}}<text wx:if="{{item.height && item.weight}}"> {{item.height}}CM {{item.weight}}KG {{item.bodyType == '0'?'偏瘦':item.bodyType == '1'?'正常':item.bodyType == '2'?'偏胖':''}}</text><text class="subtitleColor" wx:else> 请补充身高、体重等</text>\n{{item.cardTypeStr}}：{{item.idcard}}</text>
            </view>
          </view>
        </label>
        <view class='item-icon card-modfiy'>
            <view class='icon icon-bj font23' id="editPersonInfo" bindtap='addCard' data-act="edit" data-id="{{item.id}}" data-parentid="{{item.parent ? item.parent.id : ''}}" data-name="{{item.name}}" data-sex="{{item.sex}}" data-birthday="{{item.birthdayStr}}" data-clothessize="{{item.clothesSize}}" data-shoessize="{{item.shoesSize}}" data-cardtype="{{item.cardType}}" data-weight="{{item.weight}}" data-idcard="{{item.idcard}}" data-height="{{item.height}}" data-bodyType="{{item.bodyType}}" data-needClothesSize="{{datas.needClothesSize}}" data-needShoeSize="{{datas.needShoeSize}}"></view>
          </view>
      </view>
      </checkbox-group>
    </view>
    <view class='load-more' hidden="{{list.length < 5 ? true : false}}">下面没有了哦</view>
  </block>
  <block wx:else>
    <view class="form-table">
      <view class="column">
        <view class="it-tit">联系手机号码</view>
        <view class="it-lab">
          <input class="weui-input contactPhone" type="number" value="{{info.contactPhone}}" placeholder="请填写手机号以便接收通知" data-type="contactPhone" bindblur="bindInfo"/>
        </view>
      </view>
      <view class="column">
        <view class="it-tit">电子邮箱</view>
        <view class="it-lab">
          <input class="weui-input email" value="{{info.email}}" placeholder="请填写邮箱以便接收电子合同" data-type="email" bindblur="bindInfo"/>
        </view>
      </view>
      <view class="column">
        <view class="it-tit">邮寄地址</view>
        <view class="it-lab">
          <textarea auto-height="true" class="weui-input mailAddress" value="{{info.mailAddress}}" placeholder="请填写正确收货地址以便邮寄" bindtap="chooseAddress" disabled style="width: 100%;"/>
        </view>
      </view>
      <view class="column">
        <view class="it-tit">街道社区</view>
        <view class="it-lab">
          <input class="weui-input street" value="{{info.street}}" placeholder="请填写社区以便安排活动事宜" data-type="street" bindblur="bindInfo"/>
        </view>
      </view>
    </view>
  </block>
</view>
<address show="{{showAddress}}" data="{{info.mailAddress}}" data-name="address" bind:submit="submitAddress"  bind:close="close" />