<view class="info-edit">
  <view class="info-item">
    <t-cell class="info-edit__cell" required title="姓名" bordered="{{false}}">
      <t-input bind:change="onNameChange" align="right" borderless placeholder="请输入患者姓名" slot="note" value="{{personInfo.username}}"/>
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.name}}">姓名字数在2至20之间</view>
  </view>
  <view class="info-item">
    <t-cell class="info-edit__cell" required title="性别" bordered="{{false}}">
      <t-radio-group bind:change="onGenderChange" borderless defaultValue="{{personInfo.sex}}" options="{{genderOptions}}" slot="note" t-class="info-edit__gender" value="{{personInfo.sex}}" status="error"/>
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.gender}}">请选择性别</view>
  </view>
  <view class="info-item">
    <t-cell class="info-edit__cell" title="身份证号" bordered="{{false}}">
      <t-input type="idcard" bind:change="onIdInput" align="right" borderless placeholder="请输入身份证号" slot="note" value="{{personInfo.id_number}}" />
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.id}}">身份证号输入有误</view>
  </view>
  <view class="info-item">
    <t-cell required arrow bind:click="showPicker" data-mode="birth" title="出生日期" bordered="{{false}}">
      <t-input align="right" borderless placeholder="请输选择" readonly slot="note" value="{{personInfo.birthday}}" />
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.birthday}}">请选择出生日期</view>
  </view>
  <view class="info-item">
    <t-cell class="info-edit__cell" align="right" required title="年龄" bordered="{{false}}">
      <t-input align="right" borderless placeholder="请输入" readonly slot="note" value="{{personInfo.age}}" type="digit"/>
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.age}}">请输入年龄</view>
  </view>
  <view class="info-item">
    <t-cell class="info-edit__cell" required title="出生体重" bordered="{{false}}">
      <t-input align="right" bind:change="onWeightInput" borderless placeholder="请输入" slot="note" value="{{personInfo.birth_weight}}" suffix="g" type="digit"/>
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.birth_weight}}">请输入出生体重</view>
  </view>
  <view class="info-item">
    <t-cell required arrow bind:click="showPicker" data-mode="operative" title="胆道闭锁手术时间" bordered="{{false}}">
      <t-input align="right" borderless placeholder="请选择" readonly slot="note" value="{{personInfo.operative_date}}" />
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.operative_date}}">请选择胆道闭锁手术时间</view>
  </view>
  <view class="info-item">
    <t-cell title="胎次" required arrow bordered="{{false}}" bind:click="showSelect" data-mode="parity_number" data-list="{{parity_numberList}}" >
      <t-input align="right" borderless placeholder="请选择" readonly slot="note" value="{{parity_numberList[personInfo.parity_number - 1].label}}" />
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.parity_number}}">请选择胎次</view>
  </view>
  <view class="info-item">
    <t-cell title="产次" required arrow bordered="{{false}}" bind:click="showSelect" data-mode="birth_number" data-list="{{birth_numberList}}" >
      <t-input align="right" borderless placeholder="请选择" readonly slot="note" value="{{birth_numberList[personInfo.birth_number - 1].label}}" />
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.birth_number}}">请选择产次</view>
  </view>
  <view class="info-item">
    <t-cell title="受孕方式" required arrow bordered="{{false}}" bind:click="showSelect" data-mode="conception_type" data-list="{{conception_typeList}}">
      <t-input align="right" borderless placeholder="请选择" readonly slot="note" value="{{conception_typeList[personInfo.conception_type - 1].label}}" />
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.conception_type}}">请选择受孕方式</view>
  </view>
  <view class="info-item">
    <t-cell class="info-edit__cell" required bordered="{{false}}" title="孕周">
      <t-input align="right" suffix="周" bind:change="onWeekInput" borderless placeholder="请输入" slot="note" value="{{personInfo.gestational_week}}" type="digit" />
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.gestational_week}}">请输入孕周</view>
  </view>
  <view class="info-item">
    <t-cell title="产检是否有异常(如有，请填写)" bordered="{{false}}" required arrow bind:click="showSelect" data-mode="prenatal_check_type" data-list="{{prenatal_checkList}}" >
      <t-input align="right" borderless placeholder="请选择" readonly slot="note" value="{{prenatal_checkList[personInfo.prenatal_check_type - 1].label}}" />
    </t-cell>
    <t-textarea bind:change="onPrenatalCheckRemarkChange" t-class="external-class" wx:if="{{personInfo.prenatal_check_type == 1}}" placeholder="请输入异常描述" disableDefaultPadding="{{true}}" value="{{personInfo.prenatal_check_remark}}" />
    <view class="info-edit__tips" wx:if="{{errorStatus.prenatal_check_type}}">请选择产检是否有异常</view>
    <view class="info-edit__tips" wx:if="{{personInfo.prenatal_check_type == 1 && errorStatus.prenatal_check_remark}}">请输入异常描述</view>
  </view>
  <view class="info-item">
    <t-cell title="分娩方式" required arrow bordered="{{false}}" bind:click="showSelect" data-mode="delivery_type" data-list="{{deliveryList}}" >
      <t-input align="right" borderless placeholder="请选择" readonly slot="note" value="{{deliveryList[personInfo.delivery_type - 1].label}}" />
    </t-cell>
    <view class="info-edit__tips" wx:if="{{errorStatus.delivery_type}}">请选择分娩方式</view>
  </view>
</view>
<view class="info-edit__save">
  <t-button bind:tap="onSaveInfo" block size="medium" theme="primary">保存</t-button>
</view>
<t-date-time-picker auto-close bind:cancel="hidePicker" bind:change="onPickerChange" cancelBtn="取消" confirmBtn="确认" data-mode="birth" defaultValue="{{timePicker}}" end="{{birthEnd}}" filter="{{birthFilter}}" format="YYYY-MM-DD" mode="date" popup-props="{{ { usingCustomNavbar: true } }}" start="{{birthStart}}" title="选择生日" value="{{timeValue}}" visible="{{birthVisible}}" />
<!-- 下拉选择 -->
<t-picker visible="{{selectVisible}}" value="{{selectValue}}" data-key="value" cancelBtn="取消" confirmBtn="确认" usingCustomNavbar bindchange="onSelectChange" bindcancel="onPickerCancel">
  <t-picker-item options="{{selectList}}"></t-picker-item>
</t-picker>