dateTime.wxml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <view class="tui-datetime-picker">
  2. <view class="tui-mask {{isShow?'tui-mask-show':''}}" catchtouchmove="stop" bindtap="hide"></view>
  3. <view class="tui-header {{isShow?'tui-show':''}}">
  4. <view class="tui-picker-header" catchtouchmove="stop">
  5. <view class="tui-btn-picker" style="color:{{cancelColor}}" hover-class="tui-opacity" hover-stay-time="150" bindtap="hide">取消</view>
  6. <view class="tui-btn-picker" style="color:{{color}}" hover-class="tui-opacity" hover-stay-time="150" bindtap="btnFix">确定</view>
  7. </view>
  8. <view class="tui-picker-body">
  9. <picker-view value="{{value}}" bindchange="change" class="tui-picker-view">
  10. <picker-view-column wx:if="{{!reset && type!=4}}">
  11. <view class="tui-column-item" wx:for="{{years}}" wx:key="index">
  12. {{ item }}
  13. <text class="tui-text">年</text>
  14. </view>
  15. </picker-view-column>
  16. <picker-view-column wx:if="{{!reset && type!=4}}">
  17. <view class="tui-column-item" wx:for="{{months}}" wx:key="index">
  18. {{ parse.formatNum(item)}}
  19. <text class="tui-text">月</text>
  20. </view>
  21. </picker-view-column>
  22. <picker-view-column wx:if="{{!reset && (type==1 || type==2)}}">
  23. <view class="tui-column-item" wx:for="{{days}}" wx:key="index">
  24. {{ parse.formatNum(item) }}
  25. <text class="tui-text">日</text>
  26. </view>
  27. </picker-view-column>
  28. <picker-view-column wx:if="{{!reset && (type==1 || type==4)}}">
  29. <view class="tui-column-item" wx:for="{{hours}}" wx:key="index">
  30. {{ parse.formatNum(item) }}
  31. <text class="tui-text">时</text>
  32. </view>
  33. </picker-view-column>
  34. <picker-view-column wx:if="{{!reset && (type==1 || type==4)}}">
  35. <view class="tui-column-item" wx:for="{{minutes}}" wx:key="index">
  36. {{ parse.formatNum(item) }}
  37. <text class="tui-text">分</text>
  38. </view>
  39. </picker-view-column>
  40. </picker-view>
  41. </view>
  42. </view>
  43. </view>
  44. <wxs module="parse">
  45. module.exports = {
  46. formatNum: function(num) {
  47. return num < 10 ? "0" + num : num + "";
  48. }
  49. }
  50. </wxs>