<!--pages/memberDetail/memberDetail.wxml-->
<wxs src="../../../filters/filter.wxs" module="filter"></wxs>
<nav navName="家庭成员详情"></nav>
 <view class="page">
  <!--<view class="ui-navigatorbar" style="background: #FFFFFF;border-bottom: 1rpx solid #E3E4E5;">
    <image class="ui-navigatorbar-back" bindtap="goBack" src="{{img_host+'/back.png'}}" />
    <view class="ui-title">家庭成员详情</view>
  </view> -->
  <view class="progressbox" hidden="{{!(tab==1)}}">
    <view class="progess" >
      <view class="circle active">1</view>
      <!-- <view class="circle finished">✓</view> -->
      <div class="line "></div>
      <view class="circle">2</view>
      <div class="line"></div>
      <view class="circle">3</view>
    </view>
    <view class="textbox">
      <view class="textcell active">基本信息</view>
      <view class="textcell">个人情况</view>
      <view class="textcell">健康情况</view>
    </view>
  </view>
  <view class="progressbox" hidden="{{!(tab==2)}}">
    <view class="progess" >
   
      <view class="circle finished">
       <image src="{{img_host+'/complete_info.png'}}" class="img"></image>
      </view>
      <div class="line active"></div>
      <view class="circle active">2</view>
      <div class="line"></div>
      <view class="circle">3</view>
    </view>
    <view class="textbox">
      <view class="textcell active">基本信息</view>
      <view class="textcell">个人情况</view>
      <view class="textcell">健康情况</view>
    </view>
  </view>
  <view class="progressbox" hidden="{{!(tab==3)}}">
    <view class="progess" >
   
      <view class="circle finished">
        <image src="{{img_host+'/complete_info.png'}}" class="img"></image>
      </view>
      <div class="line active"></div>
      <view class="circle finished">
        <image src="{{img_host+'/complete_info.png'}}" class="img"></image>
      </view>
      <div class="line active"></div>
      <view class="circle active">3</view>
    </view>
    <view class="textbox">
      <view class="textcell active">基本信息</view>
      <view class="textcell">个人情况</view>
      <view class="textcell">健康情况</view>
    </view>
  </view>
  <view class="cellbox {{notallowEdit?'active':''}}">
    <view class="step1" hidden="{{!(tab==1)}}">
      <view class="cell" bindtap="openTips">
        <view class="cellrow">
          <view class="name">
            姓名 <text class="red">*</text>
          </view>
          <view class="iptbox">
            <input type="text" value="{{user_info.name}}"  	bindinput="handleIpt"  data-id="name" placeholder="请填写患者真实姓名" placeholder-class="placeholder" class="ipt" disabled="{{notallowEdit || family_id?true:false}}" />

          </view>
        </view>
      </view>
      <view class="cell" bindtap="openTips">
        <view class="cellrow">
          <view class="name">
            身份证号 <text class="red">*</text>
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请填写患者真实身份证号" value="{{user_info.id_number}}" 	bindinput="handleIpt"  data-id="id_number" placeholder-class="placeholder" class="ipt" disabled="{{notallowEdit || family_id?true:false }}" />

          </view>
        </view>
      </view>
      <view class="cell" bindtap="onOpenCity">
        <view class="cellrow">
          <view class="name">
            所在城市
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请选择患者所在城市" value="{{(user_info.province +user_info.city+user_info.county)?(user_info.province +user_info.city+user_info.county):'' }}" placeholder-class="placeholder" class="ipt" disabled="{{true}}" />
            <image src="{{img_host+'/righticon.png'}}"  class="righticon"></image>
          </view>
        </view>
      </view>
      <view class="cell" bindtap="openPicker">
        <view class="cellrow">
          <view class="name">
            患者关系
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请选择与患者关系" value="{{relation_name}}" placeholder-class="placeholder" class="ipt" disabled="{{true}}" />
            <image src="{{img_host+'/righticon.png'}}" class="righticon"></image>
          </view>
        </view>
      </view>
      <view class="cell">
        <view class="cellrow">
          <view class="name">
            联系电话
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请输入联系电话"  bindinput="handleIpt"  data-id="mobile"  value="{{user_info.mobile}}" placeholder-class="placeholder" class="ipt" disabled="{{notallowEdit}}" />
          </view>
        </view>
      </view>
      <view class="cell">
        <view class="cellrow">
          <view class="name">
            身高(cm)
          </view>
          <view class="iptbox">
            <input type="digit" placeholder="请输入身高（35cm-250cm)" value="{{user_info.height}}" bindinput="handleIpt"  data-id="height"  placeholder-class="placeholder" class="ipt" disabled="{{notallowEdit}}" />
          </view>
        </view>
      </view>
      <view class="cell">
        <view class="cellrow">
          <view class="name">
            体重(kg)
          </view>
          <view class="iptbox">
            <input type="digit" placeholder="请输入体重（2kg-200kg）" value="{{user_info.weight}}" bindinput="handleIpt"  data-id="weight" placeholder-class="placeholder" class="ipt" disabled="{{notallowEdit}}" />
          </view>
        </view>
      </view>
      <view class="cell" bindtap="openMaritalPicker">
        <view class="cellrow">
          <view class="name">
            婚姻状况
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请选择婚姻状况" value="{{marital_name}}" placeholder-class="placeholder" class="ipt" disabled="{{true}}" />
            <image src="{{img_host+'/righticon.png'}}" class="righticon"></image>
          </view>
        </view>
      </view>
      <view class="cell" bindtap="showNation">
        <view class="cellrow">
          <view class="name">
            民族
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请选择民族" value="{{user_info.nation_name}}" placeholder-class="placeholder" class="ipt" disabled="{{true}}" />
            <image src="{{img_host+'/righticon.png'}}" class="righticon"></image>
          </view>
        </view>
      </view>
      <view class="cell" bindtap="showJob">
        <view class="cellrow">
          <view class="name">
            职业
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请选择职业" value="{{user_info.job_name}}" placeholder-class="placeholder" class="ipt" disabled="{{true}}" />
            <image src="{{img_host+'/righticon.png'}}" class="righticon"></image>
          </view>
        </view>
      </view>
      <view class="cell">
        <view class="cellrow">
          <view class="name">
            默认就诊人
          </view>
          <view class="iptbox">
            <van-switch checked="{{user_info.is_default==1?true:false}}" active-color="#3CC7C0" inactive-color="#f2f2f2" bind:change="onChange" size="26px"  disabled="{{notallowEdit}}"/>
          </view>
        </view>
      </view>
    </view>
    <view class="step2" hidden="{{!(tab==2)}}">
      <view class="sickHis">
        <view class="list">
          <view class="qa">
            <view class="num">1、</view>
            <view class="titlebox">
              <view class="title">您是否有过敏史？</view>
              <view class="radio" >
                <van-radio-group value="{{ filter.numberTOstring(personInfo.is_allergy_history) }}" class="singlegroup" data-id="is_allergy_history" bind:change="onChangeRadio" direction="horizontal">
                  <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                  <van-radio name="0" checked-color="#3cc7c0">否</van-radio>
                </van-radio-group>
              </view>
              <!-- hidden="{{checkGuomin!=1}}" -->
              <view class="radiotip" hidden="{{personInfo.is_allergy_history!=1}}">
                <textarea placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70"	confirm-type="done" bindinput="handelFocus"  value="{{personInfo.allergy_history}}" data-id="hideGuomin" data-value="allergy_history"></textarea>
                <view class="textbox" hidden="{{hideGuomin}}">
                  <view class="desc"><text>过敏史：</text>请填写过敏源，如药物，请写出药名；如食物，请写具体如鸡蛋、牛奶等（限制50个字）</view>
                </view>
              </view>
            </view>
          </view>
          <view class="qa">
            <view class="num">2、</view>
            <view class="titlebox">
              <view class="title">您是否有家族病史？</view>
              <view class="radio">
                <van-radio-group class="singlegroup" value="{{filter.numberTOstring(personInfo.is_family_history)}}"   data-id="is_family_history" bind:change="onChangeRadio" direction="horizontal">
                  <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                  <van-radio name="0" checked-color="#3cc7c0">否</van-radio>
                </van-radio-group>
              </view>
              <view class="radiotip" hidden="{{personInfo.is_family_history!=1}}">
                <textarea placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70"	confirm-type="done"  bindinput="handelFocus"  value="{{personInfo.family_history}}" data-id="hideFamilysick" data-value="family_history"></textarea>
                <view class="textbox" hidden="{{hideFamilysick}}">
                  <view class="desc"><text>家族病史：</text>请详细填写相关家族病史（限制50个字）</view>
                </view>
              </view>
            </view>
          </view>
          <view class="qa" wx:if="{{sex==2}}">
            <view class="num">{{startIndex}}、</view>
            <view class="titlebox">
              <view class="title">您是否处于备孕、妊娠、哺乳期？</view>
              <view class="radio">
                <van-radio-group value="{{ filter.numberTOstring(personInfo.is_pregnant) }}"  bind:change="onChangeRadio"   data-id="is_pregnant"  direction="horizontal" class="singlegroup">
                  <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                  <van-radio name="0" checked-color="#3cc7c0">否</van-radio>
                </van-radio-group>
              </view>
              <view class="radiotip" hidden="{{personInfo.is_pregnant!=1}}">
                <textarea placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70"	confirm-type="done"  bindinput="handelFocus"  value="{{personInfo.pregnant}}" data-id="hidePregnant" data-value="pregnant"></textarea>
                <view class="textbox" hidden="{{hidePregnant}}">
                  <view class="desc">请描述您目前所处阶段，如备孕中、哺乳期中、妊娠月份。（限制50个字）</view>
                </view>
              </view>
            </view>
          </view>
          <view class="qa">
            <view class="num">{{startIndex+1}}、</view>
            <view class="titlebox">
              <view class="title">是否做过手术</view>
              <view class="radio">
                <van-radio-group  value="{{ filter.numberTOstring(personInfo.is_operation) }}"  data-id="is_operation"  bind:change="onChangeRadio" direction="horizontal" class="singlegroup">
                  <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                  <van-radio name="0" checked-color="#3cc7c0">否</van-radio>
                </van-radio-group>
              </view>
              <view class="radiotip" hidden="{{personInfo.is_operation !=1}}">
                <textarea placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70"	confirm-type="done"  bindinput="handelFocus"  value="{{personInfo.operation}}" data-id="hideOperation" data-value="operation"></textarea>
                <view class="textbox" hidden="{{hideOperation}}">
                  <view class="desc">请描述具体手术名称和做手术医院</view>
                </view>
              </view>
            </view>
          </view>
          <view class="qa">
            <view class="num">{{startIndex+2}}、</view>
            <view class="titlebox">
              <view class="title">是否有饮酒史</view>
              <view class="radio">
                <van-radio-group value="{{ filter.numberTOstring(personInfo.drink_wine_status) }}"   data-id="drink_wine_status"  bind:change="onChangeRadio" direction="horizontal" class="group">
                  <van-radio name="1" checked-color="#3cc7c0">从不</van-radio>
                  <van-radio name="2" checked-color="#3cc7c0">偶尔</van-radio>
                  <van-radio name="3" checked-color="#3cc7c0">经常</van-radio>
                  <van-radio name="4" checked-color="#3cc7c0">每天</van-radio>
                  <van-radio name="5" checked-color="#3cc7c0">已戒酒</van-radio>
                </van-radio-group>
              </view>
            </view>
          </view>
          <view class="qa">
            <view class="num">{{startIndex+3}}、</view>
            <view class="titlebox">
              <view class="title">是否有吸烟史</view>
              <view class="radio">
                <van-radio-group value="{{ filter.numberTOstring(personInfo.smoke_status) }}"  data-id="smoke_status" bind:change="onChangeRadio" direction="horizontal" class="group">
                  <van-radio name="1" checked-color="#3cc7c0">从不</van-radio>
                  <van-radio name="2" checked-color="#3cc7c0">偶尔</van-radio>
                  <van-radio name="3" checked-color="#3cc7c0">经常</van-radio>
                  <van-radio name="4" checked-color="#3cc7c0">每天</van-radio>
                  <van-radio name="5" checked-color="#3cc7c0">已戒烟</van-radio>
                </van-radio-group>
              </view>
            </view>
          </view>
          <view class="qa">
            <view class="num">{{startIndex+4}}、</view>
            <view class="titlebox">
              <view class="title">是否有接触过化学物</view>
              <view class="radio">
                <van-radio-group value="{{filter.numberTOstring(personInfo.chemical_compound_status)}}"   data-id="chemical_compound_status"    bind:change="onChangeRadio" direction="horizontal" class="group">
                  <van-radio name="1" checked-color="#3cc7c0">从不</van-radio>
                  <van-radio name="2" checked-color="#3cc7c0">偶尔</van-radio>
                  <van-radio name="3" checked-color="#3cc7c0">经常</van-radio>
                  <van-radio name="4" checked-color="#3cc7c0">每天</van-radio>
                </van-radio-group>
              </view>
             
              <view class="radiotip" wx:if="{{(personInfo.chemical_compound_status!=1 && personInfo.chemical_compound_status)}}">
                <textarea placeholder=" "  show-confirm-bar="{{false}}" cursor-spacing="70"	confirm-type="done" value="{{personInfo.chemical_compound_describe}}" bindinput="handelFocus"  data-id="hideChemical" data-value="chemical_compound_describe"></textarea>
                <view class="textbox" hidden="{{hideChemical}}">
                  <view class="desc"><text>化学物：</text>请详细填写接触过的相关化学物（限制50个字）</view>
                </view>
              </view>

            </view>
          </view>
        </view>
      </view>
    </view>
    <view class="step3" hidden="{{!(tab==3)}}">
      <view class="cell" bindtap="showSick">
        <view class="cellrow">
          <view class="name">
            所患疾病
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请填写所患疾病名称" value="{{healthyInfo.disease_class_name}}" placeholder-class="placeholder" class="ipt" disabled="true"/>

          </view>
        </view>
      </view>
      <view class="cell" bindtap="openPop">
        <view class="cellrow">
          <view class="name">
            确诊日期
          </view>
          <view class="iptbox">
            <input type="text" value="{{healthyInfo.diagnosis_date}}" placeholder="请选择日期（年月日）" placeholder-class="placeholder" class="ipt" disabled="{{true}}" />
            <image src="{{img_host+'/righticon.png'}}" class="righticon"></image>

          </view>
        </view>
      </view>
      <view class="cell">
        <view class="cellrow">
          <view class="name">
            确诊医院
          </view>
          <view class="iptbox">
            <input type="text" placeholder="请填写确诊医院名称" value="{{healthyInfo.diagnosis_hospital}}" bindinput="handelHealthyIpt"  data-id="diagnosis_hospital" placeholder-class="placeholder" data-value="diagnosis_hospital" class="ipt" />

          </view>
        </view>
      </view>
      <view class="sickHis" style="margin-top: 0;padding:1rpx 32rpx 0rpx;">
        <view class="list" style="border-bottom:none">
          <view class="qa" style="border-bottom: 0;">
            <view class="titlebox">
              <view class="title">正在服药？</view>
              <view class="radio" >
                <van-radio-group value="{{filter.numberTOstring(healthyInfo.is_take_medicine)}}"  data-id="is_take_medicine" bind:change="onChangeHealthyRadio" direction="horizontal">
                  <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                  <van-radio name="0" checked-color="#3cc7c0">否</van-radio>
                </van-radio-group>
              </view>
              <view class="radiotip" hidden="{{healthyInfo.is_take_medicine!=1}}">
                <textarea placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70"	confirm-type="done" value="{{healthyInfo.drugs_name}}" bindinput="handelHealthyIpt"  data-id="hideDrug" data-value="drugs_name"></textarea>
                <view class="textbox" hidden="{{hideDrug}}">
                  <view class="desc"><text>正在服药：</text>请详细填写所服药物（限制50个字）</view>
                </view>
              </view>

            </view>
          </view>
        </view>
      </view>


    </view>
  </view>
  <button class="btn next stepbtn1" wx:if="{{!notallowEdit && tab==1}}" bindtap="handleBasicInfo" disabled="{{isloading}}">下一步</button>
  <button class="btn next stepbtn2" wx:if="{{!notallowEdit && tab==2}}"  bindtap="handlePersonInfo"  disabled="{{isloading}}">下一步</button>
  <button class="btn next" wx:if="{{!notallowEdit && tab==3}}"  bindtap="handleHealthyInfo"  disabled="{{isloading}}">完成</button>
</view>
<van-popup show="{{ show }}" position="bottom" custom-style="height: auto">
  <van-datetime-picker title="选择确诊日期" min-date="{{ minDate }}" toolbar-class="dateTitle" type="date" value="{{ currentDate }}" bind:cancel="handleClose" bind:confirm="handleConfirm" max-date="{{ maxDate }}" formatter="{{ formatter }}" />
</van-popup>
<van-popup show="{{ showPicker }}" round position="bottom" custom-style="height:auto" bind:close="closePicker">
  <van-picker show-toolbar title="选择与患者之间的关系" columns="{{ pickercolumns }}" bind:cancel="closePicker" bind:confirm="onConfirmPicker" />
</van-popup>
<van-popup show="{{ showMarital }}" round position="bottom" custom-style="height:auto" bind:close="closeMaritalPicker">
  <van-picker show-toolbar title="请选择婚姻状况" columns="{{ maritalColumn }}" bind:cancel="closeMaritalPicker" bind:confirm="onConfirmMaritalPicker" />
</van-popup>
<van-popup show="{{ showCity}}" round position="bottom" custom-style="height: 50%" bind:close="onClose">
  <van-picker columns="{{ columns }}" show-toolbar title="选择地区" columns="{{ columns }}" value-key="area_name" bind:cancel="onCancel" bind:change="onChangePicker" bind:confirm="onConfirm" />
</van-popup>
<van-popup show="{{ showSick }}" position="bottom" custom-style="height: auto">
    <van-picker show-toolbar title="选择所患疾病" columns="{{ sickcolumns }}" value-key="disease_class_name" bind:cancel="onCancelSick" bind:confirm="onConfirmSick" />
  </van-popup>
  <!-- <van-popup show="{{ showNation }}" position="bottom" custom-style="height: auto">
    <van-picker show-toolbar title="选择民族" columns="{{ nationcolumns }}" value-key="nation_name" bind:cancel="onCancelSick" bind:confirm="onConfirmNation" />
  </van-popup> -->
  <van-popup show="{{ showNation }}" position="bottom" custom-style="height: auto">
    <van-picker show-toolbar title="选择民族" columns="{{ nationcolumns }}" value-key="nation_name" bind:cancel="onCancelNation" bind:confirm="onConfirmNation" />
  </van-popup>
  <van-popup show="{{ showJob }}" position="bottom" custom-style="height: auto">
    <van-picker show-toolbar title="选择职业" columns="{{ jobcolumns }}" value-key="job_name" bind:cancel="onCancelJob" bind:confirm="onConfirmJob" />
  </van-popup>