更新组件演示页面,方便用户直接使用组件,去除tn-button的默认背景色,tn-avatar修改参数默认值,修复tn-avatar-group最开始头像进行了偏移、修复无法使用标签的bug,tn-badge修改参数默认值,tn-collapse-item修复背景颜色失效问题,滚动通知移除默认背景颜色和字体大小,tn-count-down修复时间单位不正确问题,列表组件修复背景颜色问题,tn-nav-bar返回按钮修改为可进行修改的图标,tn-step添加点击步骤进行跳转,tn-loading修复默认激活颜色出错问题,tn-tag移除默认背景颜色,优化阴影大小css

This commit is contained in:
JaylenTech
2022-02-08 19:55:15 +08:00
parent 043ee3f585
commit 946bb52c03
94 changed files with 6296 additions and 4727 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="components-count_down">
<view class="components-count_down tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>countdown倒计时</tn-nav-bar>
@@ -8,26 +8,48 @@
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
<tn-count-down
:timestamp="timestamp"
:backgroundColor="backgroundColor"
:fontColor="fontColor"
:fontSize="fontSize"
:separator="separator"
:separatorColor="separatorColor"
:separatorSize="separatorSize"
:showBorder="showBorder"
:borderColor="borderColor"
:showDays="showDays"
:showHours="showHours"
:showMinutes="showMinutes"
:showSeconds="showSeconds"
:hideZeroDay="hideZeroDay"
@end="countDownEnd"
></tn-count-down>
</dynamic-demo-template>
<demo-title title="基本使用">
<tn-count-down :timestamp="3600"></tn-count-down>
</demo-title>
<demo-title title="显示边框">
<tn-count-down :timestamp="3600" :showBorder="true"></tn-count-down>
</demo-title>
<demo-title title="中文分割时间">
<tn-count-down :timestamp="3600" separator="cn"></tn-count-down>
</demo-title>
<demo-title title="天数为零时不隐藏">
<tn-count-down :timestamp="3600" :hideZeroDay="true"></tn-count-down>
</demo-title>
<demo-title title="显示天">
<tn-count-down :timestamp="360000" :showDays="true" :showHours="false" :showMinutes="false" :showSeconds="false"></tn-count-down>
</demo-title>
<demo-title title="显示天时">
<tn-count-down :timestamp="360000" :showDays="true" :showHours="true" :showMinutes="false" :showSeconds="false"></tn-count-down>
</demo-title>
<demo-title title="显示天时分">
<tn-count-down :timestamp="360000" :showDays="true" :showHours="true" :showMinutes="true" :showSeconds="false"></tn-count-down>
</demo-title>
<demo-title title="显示天时分秒">
<tn-count-down :timestamp="360000" :showDays="true" :showHours="true" :showMinutes="true" :showSeconds="true"></tn-count-down>
</demo-title>
<demo-title title="自定义尺寸">
<tn-count-down :timestamp="3600" :fontSize="60" :separatorSize="60"></tn-count-down>
</demo-title>
<demo-title title="自定义颜色">
<tn-count-down :timestamp="3600" backgroundColor="tn-main-gradient-indigo" fontColor="#FFFFFF"></tn-count-down>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
@@ -35,134 +57,22 @@
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsCountDown',
components: {dynamicDemoTemplate},
components: {demoTitle},
data() {
return {
timestamp: 3600,
backgroundColor: '#FFFFFF',
fontSize: 30,
fontColor: '#080808',
separator: 'en',
separatorSize: 30,
separatorColor: '#080808',
showBorder: true,
borderColor: '#080808',
showDays: true,
showHours: true,
showMinutes: true,
showSeconds: true,
hideZeroDay: false,
tips: ['无需依赖额外的样式文件','使用tn-count-down组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '时间',
optional: ['360', '3600', '543000'],
methods: 'timestampChange',
current: 1
},
{
title: '大小',
optional: ['24', '30', '45'],
methods: 'sizeChange',
current: 1
},
{
title: '边框显示',
optional: ['显示','隐藏'],
methods: 'borderChange'
},
{
title: '分隔符',
optional: ['冒号','中文'],
methods: 'separatorChange'
},
{
title: '自定义颜色',
optional: ['默认','自定义'],
methods: 'customColorChange'
},
{
title: '自定义格式',
optional: ['日时分秒','时分秒'],
methods: 'customFormatChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 切换时间
timestampChange(event) {
this.timestamp = Number(event.name)
},
// 切换边框显示
borderChange(event) {
this.showBorder = event.index === 0 ? true : false
},
// 切换分隔符
separatorChange(event) {
this.separator = event.index === 0 ? 'en' : 'cn'
},
// 切换大小
sizeChange(event) {
this.fontSize = Number(event.name)
this.separatorSize = Number(event.name)
},
// 切换自定义颜色
customColorChange(event) {
switch(event.index) {
case 0:
this.backgroundColor = '#FFFFFF'
this.separatorColor = '#080808'
this.fontColor = '#080808'
this.borderColor = '#080808'
break
case 1:
this.backgroundColor = '#E6E6E6'
this.separatorColor = '#01BEFF'
this.fontColor = '#3D7EFF'
this.borderColor = '#31C9E8'
break
}
},
// 切换自定义格式
customFormatChange(event) {
switch(event.index) {
case 0:
this.showDays = true
this.showHours = true
this.showMinutes = true
this.showSeconds = true
break
case 1:
this.showDays = false
this.showHours = true
this.showMinutes = true
this.showSeconds = true
break
}
},
// 倒计时结束
countDownEnd() {
this.$t.messageUtils.toast('倒计时结束')
}
},
}
}
</script>
<style lang="scss" scoped>
.components-count_down {
min-height: 100vh;
}
</style>