dk-dropdown-date-hour-mon-sec.wxml 1.2 KB

12345678910111213141516171819202122232425
  1. <!--界面日期下拉组件-->
  2. <wxs module="mDate">
  3. var format = function (time) {
  4. var date = getDate(time);
  5. var year = date.getFullYear()
  6. var month = date.getMonth() + 1
  7. var day = date.getDate()
  8. var hour = date.getHours()
  9. var minute = date.getMinutes()
  10. var second = date.getSeconds()
  11. return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
  12. }
  13. module.exports.format = format;
  14. </wxs>
  15. <!-- 日期 -->
  16. <view class="drop-open" wx:if="{{show}}">
  17. <van-popup show="{{ show }}" position="bottom" customStyle="border-radius: 30rpx 30rpx 0px 0px;" bind:close="onCloseChooseDate" bind:click-overlay="onCloseChooseDate">
  18. <view style="display:flex;justify-content: space-around;height:80rpx;">
  19. <view style="width:45%;text-align: left;color:#b6b6b6;line-height:80rpx;" catchtap="onCloseChooseDate">取消</view>
  20. <view style="width:45%;text-align: right;color:#00A7B5;line-height:80rpx;" catchtap="onConfirmChooseDate">确定</view>
  21. </view>
  22. <van-datetime-picker show-toolbar="{{false}}" bindonlyinput="changeDate" type="datetime" loading="{true}" value="{{ timeValue }}" formatter="{{formatter}}" />
  23. </van-popup>
  24. </view>