dk-dropdown-date-month.wxml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <wxs module="mdate">
  2. var format = function (time) {
  3. var date = getDate(time);
  4. var year = date.getFullYear()
  5. var month = date.getMonth() + 1
  6. var day = date.getDate()
  7. return year + '-' + month
  8. }
  9. module.exports.format = format;
  10. </wxs>
  11. <van-cell catchtap="choose" data-item="{{item}}" wx:for="{{dateTypeList}}"
  12. title-class="{{item.value == dateDefault.value?'blue-blue':''}}" wx:key="index" title="{{item.text}}">
  13. <van-icon wx:if="{{item.value == dateDefault.value && item.value != -2}}" slot="right-icon" name="success"
  14. class="blue-blue" />
  15. <view slot="right-icon" class="blue-blue">
  16. {{mdate.format(dateSearch[0])}} - {{mdate.format(dateSearch[1])}}
  17. </view>
  18. </van-cell>
  19. <!-- 日期 -->
  20. <view class="drop-open" wx:if="{{show}}">
  21. <van-popup show="{{ show }}" position="bottom" bind:close="onCloseChooseDate" bind:click-overlay="onCloseChooseDate">
  22. <view style="display:flex;justify-content: space-around;height:80rpx;">
  23. <view style="width:45%;text-align: left;color:#b6b6b6;line-height:80rpx;" catchtap="onCloseChooseDate">取消</view>
  24. <view style="width:45%;text-align: right;color:#1989fa;line-height:80rpx;" catchtap="onConfirmChooseDate">确定</view>
  25. </view>
  26. <van-tabs active="{{ active }}" >
  27. <van-tab title="从{{ mdate.format(dateSearch[0]) }}">
  28. <van-datetime-picker bindonlyinput="changeDate" data-index="0" show-toolbar="{{false}}" type="year-month" loading="{true}"
  29. value="{{ dateSearch[0] }}" />
  30. </van-tab>
  31. <van-tab title="到{{ mdate.format(dateSearch[1]) }}">
  32. <van-datetime-picker type="year-month" bindonlyinput="changeDate" show-toolbar="{{false}}" data-index="1" loading="{true}"
  33. value="{{ dateSearch[1] }}" />
  34. </van-tab>
  35. </van-tabs>
  36. </van-popup>
  37. </view>