<!--pages/writeSick/writeSick.wxml-->
<wxs src="../../../filters/filter.wxs" module="filter"></wxs>
<view class="content">
  <view class="ui-navigatorbar">
    <image class="ui-navigatorbar-back" bindtap="goBack" src="{{img_host+'/back.png'}}" />
    <view class="ui-title">填写病情</view>
  </view>
  <view class="infobox">
      <view class="sickHisbox" wx:if="{{is_exist}}">
        <view class="name">病情历史</view>
        <view class="hisBtn" bindtap="goRecord">查看记录</view>
      </view>
    <view class="info" bindtap="showSick">
      <view class="name">所患疾病</view>
      <input type="text" value="{{disease_class_name}}" placeholder="请填写所患疾病名称" class="ipt" disabled="true">
      </input>
    </view>
    <view class="info" bindtap="openPop">
      <view class="name">确诊日期</view>
      <input type="text" auto-focus value="{{filter.formatDay(diagnosis_date) }}" placeholder="请选择日期（年月日）" class="ipt" disabled="true" />
    </view>
    <view class="info">
      <view class="name">病情主诉</view>
    </view>
    <view class="textareaview">
      <view class="textwrap" style="background: #f2f2f2!important;">
        <view class="textbox" hidden="{{hideSick}}">
          <view class="desc"><text>临床症状：</text>如没有力气、食欲不好、眼睛发黄、面色晦暗、尿液发黄、肝区疼痛等等</view>
          <view class="desc"><text>诊疗情况：</text>描述做过哪些检查以及重要结果，是否开始治疗？治疗方案是什么（写出具体药物）、治疗效果如何？</view>
          <view class="desc"><text>希望解答的问题：</text>1、是否需要更换抗病毒药物？ 2、如果需要更换，请问哪种药物更合适？</view>
        </view>
        <van-field show-confirm-bar="{{false}}" maxlength="500" bind:change="handelTextFocus" data-id="hideSick" data-value="disease_desc" custom-style="height: 458rpx!important; border-radius: 10px;position:relative;" input-class="iptclass" class="sickArea" show-word-limit value="{{ disease_desc }}" label="" type="textarea" placeholder="" border="{{ false }}"></van-field>
      </view>
    </view>
     <view class="infobox" style="margin-top: 20rpx;background-color: #fff;padding-bottom: 30rpx;" wx:if="{{inquiry_type==4}}">
      <view class="info">
      <view class="name">用药意向</view>
    </view>
    <view class="radiotip" style="margin:30rpx 32rpx 0;padding-bottom: 20rpx;overflow:hidden">
      <view class="textbox" style="position: static;height:auto;">
        <view class="desc" ><text class="goods" wx:for="{{product}}" wx:key="product_id">{{item.product_name}}{{item.product_spec}}（数量{{item.product_num}}）</text></view>
      </view>
     
    </view>
     </view>
    <view class="info" style="flex-direction: column;height:auto;align-items:flex-start;padding: 40rpx 0;margin-top: 20rpx;">
      <view class="name">上传复诊凭证（最多9张）</view>
      <view class="tip">请上传问诊本人清晰的复诊凭证（病例/处方单/检查报告/住院单），仅接诊医生可见。</view>
      <view class="uploadbox">
        <image wx:for="{{fileList}}" src="{{item}}" mode="aspectFill" class="upload" bindtap="previewImage" data-id="{{idx}}" wx:for-index="idx" wx:key="idx">
          <image src="{{img_host+'/xiaoclose.png'}}" class="close" catchtap="delImg" data-id="{{idx}}"></image>
        </image>
        <view class="upload" bindtap="upload">
          <van-icon name="plus" />
        </view>
      </view>
      <view class="agreebox">
        <van-checkbox value="{{checkSign}}" data-id="checkSign" bind:change="onChangeSign" checked-color="#3cc7c0" label-class="desc">复诊凭证遗失或不在身边，请勾选本项，未上传凭证可能会影响医生对您的诊断</van-checkbox>
      </view>
    </view>
    <view class="sickHis">
      <view class="list">
        <view class="qa" wx:if="{{inquiry_type==4}}">
          <view class="num">{{startIndex}}、</view>
          <view class="titlebox">
            <view class="title">是否服用过您想购买的药品且无相关禁忌？</view>
            <view class="radio">
              <van-radio-group value="{{filter.numberTOstring(is_taboo)}}" data-id="is_taboo" bind:change="onChange" direction="horizontal">
                <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                <van-radio name="0" checked-color="#3cc7c0" style="margin-left: 140rpx;">否</van-radio>
              </van-radio-group>
            </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(is_allergy_history)}}" data-id="is_allergy_history" bind:change="onChange" direction="horizontal">
                <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                <van-radio name="0" checked-color="#3cc7c0" style="margin-left: 140rpx;">否</van-radio>
              </van-radio-group>
              <view class="radiotip" hidden="{{is_allergy_history!=1}}">
                <textarea placeholder=" " class="textarea" show-confirm-bar="{{false}}" cursor-spacing="70" confirm-type="done" value="{{allergy_history}}" bindinput="handelFocus" data-id="hideGuomin" data-value="allergy_history"></textarea>
                <view class="textbox" hidden="{{hideGuomin}}">
                  <view class="desc"><text>过敏史：</text>请填写过敏源，如药物，请写出药名；如食物，请写具体如鸡蛋、牛奶等（限制50个字）</view>
                </view>
                <!-- <text> 过敏史：</text>
                请填写过敏源，如药物，请写出药名；如食物，请写具体如鸡蛋、牛奶等 -->
              </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(is_family_history) }}" data-id="is_family_history" bind:change="onChange" direction="horizontal">
                <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                <van-radio name="0" checked-color="#3cc7c0" style="margin-left: 140rpx;">否</van-radio>
              </van-radio-group>
            </view>
            <view class="radiotip" hidden="{{is_family_history!=1}}">
              <textarea class="textarea" placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70" confirm-type="done" value="{{family_history}}" bindinput="handelFocus" data-id="hideFamilysick" data-value="family_history"></textarea>
              <view class="textbox" hidden="{{hideFamilysick}}">
                <view class="desc"><text>家族病史：</text>如果是肝病，请写明患肝炎、肝硬化、肝衰竭还是肝癌。（限制50个字）</view>
              </view>
              <!-- <text> 过敏史：</text>
                请填写过敏源，如药物，请写出药名；如食物，请写具体如鸡蛋、牛奶等 -->
            </view>
          </view>
        </view>
        <view class="qa" wx:if="{{sex==2}}">
          <view class="num">{{startIndex+3}}、</view>
          <view class="titlebox">
            <view class="title">您是否处于备孕、妊娠、哺乳期？</view>
            <view class="radio">
              <van-radio-group value="{{ filter.numberTOstring(is_pregnant)}}" data-id="is_pregnant" bind:change="onChange" direction="horizontal">
                <van-radio name="1" checked-color="#3cc7c0">是</van-radio>
                <van-radio name="0" checked-color="#3cc7c0" style="margin-left: 140rpx;">否</van-radio>
              </van-radio-group>
            </view>
            <!-- <view class="radiotip" hidden="{{is_pregnant!=1}}">
              <textarea class="textarea" placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70" confirm-type="done" value="{{pregnant}}" bindinput="handelFocus" data-id="hidePregnant" data-value="pregnant"></textarea>
              <view class="textbox"  hiden="{{hidePregnant}}">
                <view class="desc">请描述您目前所处阶段，如备孕中、哺乳期中、妊娠月份。（限制50个字）</view>
              </view>
            </view> -->
          </view>
        </view>
      </view>
    </view>
    <view class="agreebox" style="margin: 20rpx 0 0 0;">
      <view class="xieyi">
        <van-checkbox value="{{ checkAgree }}" data-id="checkAgree" bind:change="onChange" checked-color="#3cc7c0" label-class="desc" label-disabled>胆相照互联网医院平台医生为您提供健康咨询服务，医生建议仅供参考。根据国家互联网诊疗相关政策要求，请您在提交服务前仔细阅读<text bindtap="goAgreement">《风险告知与知情同意书》</text>。继续操作表示您知悉并同意上述全部内容。</van-checkbox>
      </view>

    </view>
    <view class="nextbox">
      <button class="next" type="primary" bindtap="handleThrottle" disabled="{{btnLock}}">下一步</button>
    </view>
  </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="{{ showSick }}" position="bottom" custom-style="height: auto">
    <van-picker show-toolbar title="选择所患疾病" columns="{{ columns }}" value-key="disease_class_name" bind:cancel="onCancel" bind:confirm="onConfirm" />
  </van-popup>
</view>
<dialog bind:confirm="confirm" bind:cancel="cancelAlert" showDialog="{{showdialog}}" message="{{messageTitle}}" cancelBtn="{{cancelBtn}}"></dialog>
<van-dialog
   use-slot
   class="mydailog"
   bind:confirm="agreeConfirm"
  title="温馨提示"
   theme='green'
  show="{{showAgreeDialog}}"
  confirm-button-color="#3CC7C0"
  cancel-button-text="确定"
>
<view class="slotmsg">
  请您先仔细阅读并同意<text class="green" bindtap="goAgreement">《风险告知与知情同意书》</text>
</view>
</van-dialog>
<van-dialog id="van-dialog"  confirm-button-color="#3CC7C0" />