[fix] 修复倒计时显示多余的【:】的问题

This commit is contained in:
zhengliming
2024-01-03 00:08:19 +08:00
parent 344f681181
commit c67be5adf8

View File

@@ -9,18 +9,18 @@
<view class="tn-countdown__item__time" :class="[fontColorClass]" :style="[letterStyle]"> <view class="tn-countdown__item__time" :class="[fontColorClass]" :style="[letterStyle]">
{{ d }} {{ d }}
</view> </view>
<view
class="tn-countdown__separator"
:style="{
fontSize: separatorSize + 'rpx',
color: separatorColor,
paddingBottom: separator === 'en' ? '4rpx' : 0
}"
>
{{ separator === 'en' ? (showHours || showMinutes || showSeconds ? ':' : '') : '天'}}
</view>
</view> </view>
<view
v-if="showHours && (hideZeroDay || (!hideZeroDay && d != '00'))"
class="tn-countdown__separator"
:style="{
fontSize: separatorSize + 'rpx',
color: separatorColor,
paddingBottom: separator === 'en' ? '4rpx' : 0
}"
>
{{ separator === 'en' ? ':' : '天'}}
</view>
<view <view
v-if="showHours" v-if="showHours"
@@ -31,18 +31,19 @@
<view class="tn-countdown__item__time" :class="[fontColorClass]" :style="[letterStyle]"> <view class="tn-countdown__item__time" :class="[fontColorClass]" :style="[letterStyle]">
{{ h }} {{ h }}
</view> </view>
<view
v-if="showMinutes"
class="tn-countdown__separator"
:style="{
fontSize: separatorSize + 'rpx',
color: separatorColor,
paddingBottom: separator === 'en' ? '4rpx' : 0
}"
>
{{ separator === 'en' ? ':' : '时'}}
</view>
</view> </view>
<view
v-if="showMinutes"
class="tn-countdown__separator"
:style="{
fontSize: separatorSize + 'rpx',
color: separatorColor,
paddingBottom: separator === 'en' ? '4rpx' : 0
}"
>
{{ separator === 'en' ? ':' : '时'}}
</view>
<view <view
v-if="showMinutes" v-if="showMinutes"
@@ -53,40 +54,43 @@
<view class="tn-countdown__item__time" :class="[fontColorClass]" :style="[letterStyle]"> <view class="tn-countdown__item__time" :class="[fontColorClass]" :style="[letterStyle]">
{{ m }} {{ m }}
</view> </view>
</view> <view
<view v-if="showSeconds"
v-if="showSeconds" class="tn-countdown__separator"
class="tn-countdown__separator" :style="{
:style="{ fontSize: separatorSize + 'rpx',
fontSize: separatorSize + 'rpx', color: separatorColor,
color: separatorColor, paddingBottom: separator === 'en' ? '4rpx' : 0
paddingBottom: separator === 'en' ? '4rpx' : 0 }"
}" >
> {{ separator === 'en' ? ':' : '分'}}
{{ separator === 'en' ? ':' : '分'}} </view>
</view> </view>
<view
v-if="showSeconds" <view
class="tn-countdown__item" class="tn-countdown__item"
:class="[backgroundColorClass]" :class="[backgroundColorClass]"
:style="[itemStyle]" :style="[itemStyle]"
> >
<view class="tn-countdown__item__time" :class="[fontColorClass]" :style="[letterStyle]"> <view class="tn-countdown__item__time" :class="[fontColorClass]" :style="[letterStyle]">
{{ s }} {{ s }}
</view> </view>
</view> <view
<view class="tn-countdown__separator"
v-if="showSeconds && separator === 'cn'" :style="{
class="tn-countdown__separator" fontSize: separatorSize + 'rpx',
:style="{ color: separatorColor,
fontSize: separatorSize + 'rpx', paddingBottom: separator === 'en' ? '4rpx' : 0
color: separatorColor, }"
paddingBottom: separator === 'en' ? '4rpx' : 0 >
}" {{ separator === 'en' ? '' : '秒'}}
> </view>
</view>
</view> </view>
</view> </view>
</template> </template>