city-casereport/miniprogram_npm/tdesign-miniprogram/count-down/count-down.wxml

23 lines
1016 B
Plaintext
Raw Normal View History

2023-12-06 14:22:42 +08:00
<wxs src="../common/utils.wxs" module="_" />
<wxs module="this"> module.exports.format = function(num) { return num < 10 ? '0' + num : num; } </wxs>
<view
style="{{_._style([style, customStyle])}}"
class="{{classPrefix}} {{classPrefix}}--{{theme}} {{classPrefix}}--{{size}} class {{prefix}}-class "
aria-role="option"
>
<slot wx:if="{{content !== 'default'}}" name="content" />
<slot wx:if="{{content !== 'default'}}" />
<block wx:elif="{{theme == 'default' && !splitWithUnit}}">{{formattedTime}}</block>
<block wx:else>
<block wx:for="{{timeRange}}" wx:key="index">
<text class="{{classPrefix}}__item {{prefix}}-class-count">{{this.format(timeData[timeRange[index]])}}</text>
<text
wx:if="{{ splitWithUnit || timeRange.length - 1 !== index}}"
class="{{classPrefix}}__split {{classPrefix}}__split--{{splitWithUnit ? 'text' : 'dot'}} {{prefix}}-class-split"
>{{splitWithUnit ? timeDataUnit[timeRange[index]] : ':'}}</text
>
</block>
</block>
</view>