<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 
  }
  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   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 }}" position="bottom" bind:close="onCloseChooseDate" bind:click-overlay="onCloseChooseDate">
  <view style="display:flex;justify-content: space-around;height:80rpx;">
    <view style="width:45%;text-align: left;color:#b6b6b6;line-height:80rpx;" catchtap="onCloseChooseDate">取消</view>
    <view style="width:45%;text-align: right;color:#1989fa;line-height:80rpx;" catchtap="onConfirmChooseDate">确定</view>
  </view>
  <van-tabs active="{{ active }}" >
    <van-tab title="从{{  mdate.format(dateSearch[0]) }}">
      <van-datetime-picker bindonlyinput="changeDate" data-index="0" show-toolbar="{{false}}" type="year-month" loading="{true}"
        value="{{  dateSearch[0] }}" />
    </van-tab>
    <van-tab title="到{{ mdate.format(dateSearch[1]) }}">
      <van-datetime-picker type="year-month" bindonlyinput="changeDate" show-toolbar="{{false}}" data-index="1" loading="{true}"
        value="{{  dateSearch[1] }}" />
    </van-tab>
  </van-tabs>
</van-popup>
</view>