<wxs src="../../filters/filter.wxs" module="filters"></wxs>
<nav bind:goSearch="goSearch" id="nav"></nav>
<view class="page">
    <view class="banner">
      <image src="../../static/banner.jpg" mode="widthFix" class="bannerImg"/>
    </view>
<van-dropdown-menu active-color="#3881F7">
  <van-dropdown-item id="item1" title="{{status_title}}"  title-class="droptitle {{select_status?'active':''}}">
    <view class="row">
      <view class="rowcell {{item.select?'active':''}}" wx:for="{{statusList}}" wx:key="value" bindtap="chooseStatus" data-id="item1" data-value="{{item.value}}" data-name="{{item.text}}" data-select="{{item.select}}" data-index="{{index}}">{{item.text}}</view>
    </view>
  </van-dropdown-item>
  <van-dropdown-item id="item2" title="{{casetype_title}}" title-class="droptitle {{select_type?'active':''}}">
    <view class="row type">
      <view class="rowcell {{item.select?'active':''}}" wx:for="{{typeList}}" wx:key="value" bindtap="chooseStatus" data-id="item2" data-value="{{item.value}}" data-name="{{item.text}}" data-select="{{item.select}}" data-index="{{index}}">{{item.text}}</view>
    </view>
  </van-dropdown-item>
</van-dropdown-menu>

<view class="scrollwraper">
    <scroll-view scroll-y style="width: 100%;height:100%" 	bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}"	refresher-threshold="100"	refresher-enabled="true"  bindscrolltolower="lower"  id="scroller" 	bounces="false">
  
<view class="viewcon" style="padding-bottom: 0;margin: 0 32rpx 16rpx;" >
    <van-swipe-cell right-width="{{65 }}" wx:if="{{hasDraft && showDraft}}"  async-close
  bind:close="onCloseSwipe">
        <van-cell-group>
           <view class="viewcell" bind:tap="goCreate" style="margin: 0;" > 
            <view class="left">
                <van-image width="94rpx" height="94rpx"  round src="{{caseDraft.sex==1?img_host+'/man.png':img_host+'/woman.png'}}" />
                <view class="info">
                   <view class="name">草稿</view>
                   <view class="date">{{draftTime}}</view>
                </view>
            </view>
            <view class="btn">待提交</view>
          </view> 
        </van-cell-group>
   <view slot="right" class="van-swipe-cell__right">删除</view>
</van-swipe-cell>
       
      </view>
      <view wx:if="{{list.length>0 }}" class="viewcon">
         
         <view class="viewcell" wx:for="{{list}}" wx:key="id" bind:tap="goDetail" data-id="{{item.id}}" data-status="{{item.status}}" data-reason="{{item.reason}}">
            <view class="left">
                <van-image width="94rpx" height="94rpx"  round src="{{item.sex==1?img_host+'/man.png':img_host+'/woman.png'}}" />
                <view class="info">
                   <view class="name">{{item.userName}}({{item.uid}})</view>
                   <view class="date">{{filters.transforDay(item.createTime,'date')}}</view>
                </view>
            </view>
            <view class="btn {{item.status==1?'active':item.status==2?'red':''}}">{{item.status==0?'待审核':item.status==1?'已通过':item.status==2?'待修改':'未知'}}</view>
         </view> 
        
        
     </view>
     
      <view class="nonedata" wx:elif="{{!showDraft && list.length==0}}">
         <image src="{{img_host+'/noCase.png'}}"  class="nocase" />
         <view class="nodatatip">暂无病例，<text class="link" bind:tap="goCreate">点击创建病例</text></view>
      </view>
    </scroll-view>
  </view>
</view>
<dialog showDialog="{{showCheck}}" showCancel="{{showCancel}}" bind:confirm="onConfirm" bind:cancel="onCancel"  title="审核未通过"  confirmText="去修改" showTip="{{true}}" message="{{reason}}"></dialog>
<dialog showDialog="{{showAgree}}" bind:confirm="onConfirmAgree" bind:cancel="onCancelAgree"  title="项目协议"  confirmText="查看" message="创建病例前需签署《人工肝病例登记系统》电子协议书"></dialog>
<dialog showDialog="{{showAuth}}" bind:confirm="onConfirmAuth" 
showCancel="{{showCancel}}"bind:cancel="onCancelAuth"  confirmText="去认证" showCancel="{{false}}"  message="{{authMessage}}"></dialog>
<dialog showDialog="{{showDelDraft}}" showCancel="{{showCancel}}" bind:confirm="onConfirmDelDraft" bind:cancel="onCancelDelDraft"  title="注意"  confirmText="确定"  message="确定删除草稿？"></dialog>
<van-overlay show="{{ showEntryTip }}" zIndex="9999999">
 <view class="wrapper">
  <view class="privacyBox">
  <view class="title">温馨提示</view>
  <view class="entrymsg">
    <view> 亲爱的用户，感谢您信任并使用人工肝病例登录系统！我们依据最新法律法规的要求，制定了<text class="navigator" bindtap="goAgreement" data-id="2">《隐私协议》</text>。请您仔细阅《隐私协议》，并确认了解我们对您的个人信息处理原则。</view>
    <view>如您同意《隐私协议》，请点击“同意”开始使用我们的产品和服务。</view>
  </view>
<view class="btnbox">
   <view class="cancel" bindtap="onCloseEntry">不同意</view>
  <button id="agree-btn" 
  plain
  class="confirm" 
  open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="onConfirmEntry">同意并继续</button>
</view>
</view>
 </view>
</van-overlay> 
<van-overlay show="{{ showEntryTip_second }}" zIndex="99999999">
 <view class="wrapper">
  <view class="privacyBox">
  <view class="title">温馨提示</view>
<view class="entrymsg" >
 <view> 很抱歉，如您不同意《隐私协议》，可能无法继续正常使用我们的服务，请您先同意哦~</view>
</view>
<view class="btnbox">
   <view class="cancel" bindtap="onCloseEntry_second">不同意</view>
  <button id="agree-btn" 
  plain
  class="confirm" 
  bindtap="onConfirmEntry_second">好的</button>
</view>
</view>
 </view>
</van-overlay> 