<!--界面日期下拉组件-->
<wxs module="mDate">
  var format = function (time) {
    var date = getDate(time);
    var year = date.getFullYear()
    var month = date.getMonth() + 1
    var day = date.getDate()
    return year + '-' + month + '-' + day
  }
  module.exports.format = format;
</wxs>
<van-cell catchtap="choose" data-item="{{item}}" wx:for="{{dateTypeList}}"
  title-class="{{item.value == dateDefault.value?'blue-blue':''}}" wx:key="index" title="{{item.text}}">
  <van-icon wx:if="{{item.value == dateDefault.value && item.value != -2}}" slot="right-icon" name="success"
    class="blue-blue" />
  <view wx:if="{{item.value == dateDefault.value && item.value == -2}}" slot="right-icon" class="blue-blue">
    {{mDate.format(dateSearch[0])}} - {{mDate.format(dateSearch[1]) }}
  </view>
</van-cell>

<!-- 日期 -->
<view class="drop-open" wx:if="{{show}}">
<van-popup show="{{ show }}" custom-style="border-radius:30rpx 30rpx 0 0;" position="bottom" bind:close="onCloseChooseDate" bind:click-overlay="onCloseChooseDate">
  <view style="display:flex;justify-content: space-around;height:80rpx;">
    <view style="line-height:36rpx;width:45%;text-align: left;color:#2E3853;font-size:28rpx;font-weight:400;line-height:80rpx;" catchtap="onCloseChooseDate">取消</view>
    <view style="line-height:36rpx;width:45%;text-align: right;color:#00A7B5;font-size:28rpx;font-weight:400;line-height:80rpx;" catchtap="onConfirmChooseDate">确定</view>
  </view>
  <van-tabs active="{{ active }}" nav-class="nav-class" color="#00A7B5;">
    <van-tab title="从{{mDate.format(dateSearch[0])}}">
      <van-datetime-picker bindonlyinput="changeDate" show-toolbar="{{false}}" data-index="0" type="date" loading="{true}"
        value="{{ dateSearch[0] }}" />
    </van-tab>
    <van-tab title="到{{mDate.format(dateSearch[1])}}">
      <van-datetime-picker type="date" bindonlyinput="changeDate" show-toolbar="{{false}}" data-index="1" loading="{true}"
        value="{{ dateSearch[1] }}" />
    </van-tab>
  </van-tabs>
</van-popup>
</view>