count-down.wxml 1.1 KB

12345678910111213141516171819202122
  1. <view class="t-class {{classPrefix}} {{classPrefix}}--{{size}} {{classPrefix}}--{{theme}}">
  2. <slot wx:if="{{content !== 'default'}}" />
  3. <block wx:elif="{{theme == 'default'}}">{{formattedTime}}</block>
  4. <block wx:else>
  5. <text class="{{classPrefix}}__item">{{_.format(timeData.hours)}}</text>
  6. <text class="{{classPrefix}}__split {{classPrefix}}__split--{{splitWithUnit ? 'text' : 'dot'}}"
  7. >{{splitWithUnit ? '时' : ':'}}</text
  8. >
  9. <text class="{{classPrefix}}__item">{{_.format(timeData.minutes)}}</text>
  10. <text class="{{classPrefix}}__split {{classPrefix}}__split--{{splitWithUnit ? 'text' : 'dot'}}"
  11. >{{splitWithUnit ? '分' : ':'}}</text
  12. >
  13. <text class="{{classPrefix}}__item">{{_.format(timeData.seconds)}}</text>
  14. <text
  15. wx:if="{{splitWithUnit || millisecond}}"
  16. class="{{classPrefix}}__split {{classPrefix}}__split--{{splitWithUnit ? 'text' : 'dot'}}"
  17. >{{splitWithUnit ? '秒' : ':'}}</text
  18. >
  19. </block>
  20. </view>
  21. <wxs module="_"> module.exports.format = function(num) { return num < 10 ? '0' + num : num; } </wxs>