mirror of
https://gitee.com/TSpecific/tuniao-ui.git
synced 2026-06-06 19:44:38 +08:00
更新组件演示页面,方便用户直接使用组件,去除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:
@@ -9,7 +9,7 @@
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="demoTips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-button fontColor="tn-color-white" @click="showActionSheet">弹出ActionSheet</tn-button>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showActionSheet">弹出ActionSheet</tn-button>
|
||||
</dynamic-demo-template>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<view class="tn-flex tn-flex-wrap tn-flex-col-center tn-flex-row-center">
|
||||
<tn-button style="width: 100%;" width="100%" fontColor="tn-color-white" @click="showCalendar">弹出日历</tn-button>
|
||||
<tn-button style="width: 100%;" width="100%" backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showCalendar">弹出日历</tn-button>
|
||||
<view v-if="result !== ''" class="calendar-result tn-border-dashed">
|
||||
{{ result }}
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-collapse">
|
||||
<view class="components-collapse tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>Collapse折叠面板</tn-nav-bar>
|
||||
@@ -8,28 +8,65 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<tn-collapse v-if="!customCollapse" :accordion="accordion" :headStyle="headStyle" :bodyStyle="bodyStyle" :itemStyle="itemStyle" :arrow="arrow" :arrowColor="arrowColor" :hoverClass="hoverClass" @change="change">
|
||||
<tn-collapse-item v-for="(item, index) in list" :key="index" :title="item.title" :disabled="item.disabled" :align="align">
|
||||
<view class="collapse-item-content">
|
||||
<demo-title title="手风琴模式">
|
||||
<tn-collapse>
|
||||
<tn-collapse-item v-for="(item, index) in list" :key="index" :title="item.title">
|
||||
<view class="tn-text-break-word">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
</tn-collapse-item>
|
||||
</tn-collapse>
|
||||
<tn-collapse v-else :accordion="accordion" :headStyle="headStyle" :bodyStyle="bodyStyle" :itemStyle="itemStyle" :arrow="arrow" :arrowColor="arrowColor" :hoverClass="hoverClass" @change="change">
|
||||
<tn-collapse-item title="足迹" :align="align">
|
||||
<tn-list-cell>广州</tn-list-cell>
|
||||
<tn-list-cell>深圳</tn-list-cell>
|
||||
<tn-list-cell>佛山</tn-list-cell>
|
||||
</tn-collapse-item>
|
||||
<tn-collapse-item title="时间">
|
||||
<tn-list-cell>12月</tn-list-cell>
|
||||
<tn-list-cell>11月</tn-list-cell>
|
||||
<tn-list-cell>10月</tn-list-cell>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="允许全部展开">
|
||||
<tn-collapse :accordion="false">
|
||||
<tn-collapse-item v-for="(item, index) in list" :key="index" :title="item.title">
|
||||
<view class="tn-text-break-word">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
</tn-collapse-item>
|
||||
</tn-collapse>
|
||||
</dynamic-demo-template>
|
||||
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="禁止第二项展开">
|
||||
<tn-collapse>
|
||||
<tn-collapse-item v-for="(item, index) in list" :key="index" :title="item.title" :disabled="index === 1">
|
||||
<view class="tn-text-break-word">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
</tn-collapse-item>
|
||||
</tn-collapse>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="关闭点击效果">
|
||||
<tn-collapse hoverClass="">
|
||||
<tn-collapse-item v-for="(item, index) in list" :key="index" :title="item.title">
|
||||
<view class="tn-text-break-word">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
</tn-collapse-item>
|
||||
</tn-collapse>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="隐藏箭头">
|
||||
<tn-collapse :arrow="false">
|
||||
<tn-collapse-item v-for="(item, index) in list" :key="index" :title="item.title">
|
||||
<view class="tn-text-break-word">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
</tn-collapse-item>
|
||||
</tn-collapse>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义样式">
|
||||
<tn-collapse :headStyle="headStyle" :bodyStyle="bodyStyle" :itemStyle="itemStyle">
|
||||
<tn-collapse-item v-for="(item, index) in list" :key="index" :title="item.title" align="center">
|
||||
<view class="tn-text-break-word">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
</tn-collapse-item>
|
||||
</tn-collapse>
|
||||
</demo-title>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -37,158 +74,46 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsCollapse',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
title: '关雎',
|
||||
content: '关关雎鸠,在河之洲。窈窕淑女,君子好逑。参差荇菜,左右流之。窈窕淑女,寤寐求之。求之不得,寤寐思服。悠哉悠哉,辗转反侧。参差荇菜,左右采之。窈窕淑女,琴瑟友之。参差荇菜,左右芼之。窈窕淑女,钟鼓乐之。',
|
||||
disabled: false
|
||||
content: '关关雎鸠,在河之洲。窈窕淑女,君子好逑。参差荇菜,左右流之。窈窕淑女,寤寐求之。求之不得,寤寐思服。悠哉悠哉,辗转反侧。参差荇菜,左右采之。窈窕淑女,琴瑟友之。参差荇菜,左右芼之。窈窕淑女,钟鼓乐之。'
|
||||
},
|
||||
{
|
||||
title: '长歌行',
|
||||
content: '青青园中葵,朝露待日晞。阳春布德泽,万物生光辉。常恐秋节至,焜黄华叶衰。百川东到海,何时复西归?少壮不努力,老大徒伤悲!',
|
||||
disabled: false
|
||||
content: '青青园中葵,朝露待日晞。阳春布德泽,万物生光辉。常恐秋节至,焜黄华叶衰。百川东到海,何时复西归?少壮不努力,老大徒伤悲!'
|
||||
},
|
||||
{
|
||||
title: '秋风辞',
|
||||
content: '秋风起兮白云飞,草木黄落兮雁南归。兰有秀兮菊有芳,怀佳人兮不能忘。泛楼船兮济汾河,横中流兮扬素波。少壮几时兮奈老何!',
|
||||
disabled: false
|
||||
content: '秋风起兮白云飞,草木黄落兮雁南归。兰有秀兮菊有芳,怀佳人兮不能忘。泛楼船兮济汾河,横中流兮扬素波。少壮几时兮奈老何!'
|
||||
}
|
||||
],
|
||||
accordion: true,
|
||||
headStyle: {},
|
||||
bodyStyle: {},
|
||||
itemStyle: {},
|
||||
arrow: true,
|
||||
arrowColor: '#AAAAAA',
|
||||
hoverClass: 'tn-hover',
|
||||
align: 'left',
|
||||
|
||||
customCollapse: false,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-collapse、tn-collapse-item组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '手风琴模式',
|
||||
optional: ['开启','关闭'],
|
||||
methods: 'accoraionChange'
|
||||
},
|
||||
{
|
||||
title: '禁用打开',
|
||||
optional: ['无','禁止第二项打开'],
|
||||
methods: 'disabledChange'
|
||||
},
|
||||
{
|
||||
title: '点击效果',
|
||||
optional: ['默认','无'],
|
||||
methods: 'hoverClassChange'
|
||||
},
|
||||
{
|
||||
title: '箭头显示',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'arrowChange'
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'styleChange'
|
||||
},
|
||||
{
|
||||
title: '自定义Item内容',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customItemChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
headStyle: {
|
||||
backgroundColor: '#EFEFEF'
|
||||
},
|
||||
bodyStyle: {
|
||||
backgroundColor: '#EFEFEF'
|
||||
},
|
||||
itemStyle: {
|
||||
backgroundColor: '#EFEFEF',
|
||||
borderRadius: '20rpx',
|
||||
overflow: 'hidden'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换手风琴模式
|
||||
accoraionChange(event) {
|
||||
this.accordion = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换Item禁止打开
|
||||
disabledChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.list[1].disabled = false
|
||||
} else {
|
||||
this.list[1].disabled = true
|
||||
}
|
||||
|
||||
},
|
||||
// 切换点击效果
|
||||
hoverClassChange(event) {
|
||||
this.hoverClass = event.index === 0 ? 'tn-hover' : ''
|
||||
},
|
||||
// 切换箭头显示
|
||||
arrowChange(event) {
|
||||
this.arrow = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换自定义样式
|
||||
styleChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.headStyle = {}
|
||||
this.bodyStyle = {}
|
||||
this.itemStyle = {}
|
||||
this.arrowColor = '#AAAAAA'
|
||||
this.align = 'left'
|
||||
break
|
||||
case 1:
|
||||
this.headStyle = {
|
||||
borderBottom: '1rpx solid #AAAAAA'
|
||||
}
|
||||
this.bodyStyle = {
|
||||
margin: '10rpx'
|
||||
}
|
||||
this.itemStyle = {
|
||||
'text-indent': '2em'
|
||||
}
|
||||
this.arrowColor = '#E6E6E6'
|
||||
this.align = 'center'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换自定义item内容
|
||||
customItemChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.customCollapse = false
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(1, true)
|
||||
break
|
||||
case 1:
|
||||
this.customCollapse = true
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(1, false)
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
// 面板发生了改变
|
||||
change() {
|
||||
setTimeout(() => {
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
}, 300)
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.collapse-item-content {
|
||||
word-wrap: break-word;
|
||||
.components-collapse {
|
||||
background-color: $tn-bg-gray-color;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-count_scroll">
|
||||
<view class="components-count_scroll tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>countScroll数字滚动</tn-nav-bar>
|
||||
@@ -8,16 +8,37 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-count-scroll
|
||||
:value="value"
|
||||
:height="height"
|
||||
:fontColor="fontColor"
|
||||
:fontSize="fontSize"
|
||||
:bold="bold"
|
||||
:duration="duration"
|
||||
></tn-count-scroll>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="基本使用">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-count-scroll :value="888.88"></tn-count-scroll>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-count-scroll :value="9999"></tn-count-scroll>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="加长持续时间">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-count-scroll :value="888.88" :duration="0.5"></tn-count-scroll>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-count-scroll :value="9999" :duration="3"></tn-count-scroll>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="字体加大加粗">
|
||||
<tn-count-scroll :value="888.88" :height="100" :fontSize="100" :bold="true"></tn-count-scroll>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义颜色">
|
||||
<tn-count-scroll :value="888.88" fontColor="#E88C30"></tn-count-scroll>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -26,85 +47,22 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsCountTo',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
value: 888.88,
|
||||
height: 32,
|
||||
fontColor: '#080808',
|
||||
fontSize: 32,
|
||||
bold: false,
|
||||
duration: 1.2,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-count-scroll组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '值',
|
||||
optional: ['90','1234','888.88'],
|
||||
methods: 'valueChange',
|
||||
current: 2
|
||||
},
|
||||
{
|
||||
title: '持续时间',
|
||||
optional: ['默认','0.5', '3'],
|
||||
methods: 'durationChange'
|
||||
},
|
||||
{
|
||||
title: '加粗',
|
||||
optional: ['默认','加粗'],
|
||||
methods: 'boldChange'
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customStyleChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换值
|
||||
valueChange(event) {
|
||||
this.value = Number(event.name)
|
||||
},
|
||||
// 切换持续时间
|
||||
durationChange(event) {
|
||||
this.duration = event.index === 0 ? 1.2 : Number(event.name)
|
||||
},
|
||||
// 切换加粗
|
||||
boldChange(event) {
|
||||
this.bold = event.index === 0 ? false : true
|
||||
},
|
||||
// 切换自定义样式
|
||||
customStyleChange(event) {
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.height = 32
|
||||
this.fontColor = '#080808'
|
||||
this.fontSize = 32
|
||||
break
|
||||
case 1:
|
||||
this.height = 80
|
||||
this.fontColor = '#E88C30'
|
||||
this.fontSize = 80
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.components-count_scroll {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-count_to">
|
||||
<view class="components-count_to tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>countTo数字跳转</tn-nav-bar>
|
||||
@@ -8,16 +8,37 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-count-to
|
||||
:startVal="startVal"
|
||||
:endVal="endVal"
|
||||
:fontColor="fontColor"
|
||||
:fontSize="fontSize"
|
||||
:decimals="decimals"
|
||||
:bold="bold"
|
||||
></tn-count-to>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="基本使用">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-count-to :startVal="0" :endVal="1000"></tn-count-to>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-count-to :startVal="100" :endVal="2000"></tn-count-to>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="显示小数">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-count-to :startVal="0" :endVal="1000.9" :decimals="1"></tn-count-to>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-count-to :startVal="0" :endVal="1000.99" :decimals="2"></tn-count-to>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="字体加大加粗显示">
|
||||
<tn-count-to :startVal="0" :endVal="1000" :bold="true" :fontSize="100"></tn-count-to>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义字体颜色">
|
||||
<tn-count-to :startVal="0" :endVal="1000" fontColor="#A4E82F"></tn-count-to>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -26,85 +47,22 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsCountTo',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
fontColor: '#080808',
|
||||
fontSize: 50,
|
||||
startVal: 0,
|
||||
endVal: 1000,
|
||||
duration: 2000,
|
||||
decimals: 0,
|
||||
bold: false,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-count-to组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '滚动范围',
|
||||
optional: ['0-1000','100-2500'],
|
||||
methods: 'valChange'
|
||||
},
|
||||
{
|
||||
title: '小数显示位数',
|
||||
optional: ['不显示','1','2'],
|
||||
methods: 'decimalsChange'
|
||||
},
|
||||
{
|
||||
title: '加粗',
|
||||
optional: ['默认','加粗'],
|
||||
methods: 'boldChange'
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customStyleChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换开始结束值
|
||||
valChange(event) {
|
||||
const value = event.name.split('-')
|
||||
this.startVal = Number(value[0])
|
||||
this.endVal = Number(value[1])
|
||||
},
|
||||
// 切换小数显示
|
||||
decimalsChange(event) {
|
||||
this.decimals = event.index === 0 ? 0 : Number(event.name)
|
||||
},
|
||||
// 切换加粗
|
||||
boldChange(event) {
|
||||
this.bold = event.index === 0 ? false : true
|
||||
},
|
||||
// 切换自定义样式
|
||||
customStyleChange(event) {
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.fontColor = '#080808'
|
||||
this.fontSize = 50
|
||||
break
|
||||
case 1:
|
||||
this.fontColor = '#A4E82F'
|
||||
this.fontSize = 100
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.components-count_to {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
|
||||
<view class="components-fab">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>fab悬浮按钮</tn-nav-bar>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<view>请点击下边悬浮按钮</view>
|
||||
</dynamic-demo-template>
|
||||
|
||||
</view>
|
||||
|
||||
<tn-fab
|
||||
:btnList="btnList"
|
||||
:left="left"
|
||||
:right="right"
|
||||
:bottom="bottom"
|
||||
:width="width"
|
||||
:height="height"
|
||||
:iconSize="iconSize"
|
||||
:backgroundColor="backgroundColor"
|
||||
:fontColor="fontColor"
|
||||
:icon="icon"
|
||||
:animationType="animationType"
|
||||
:showMask="showMask"
|
||||
@click="clickFabItem"
|
||||
>
|
||||
</tn-fab>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
export default {
|
||||
name: 'componentsFab',
|
||||
components: {dynamicDemoTemplate},
|
||||
data() {
|
||||
return {
|
||||
|
||||
left: 'auto',
|
||||
right: 40,
|
||||
bottom: 100,
|
||||
width: 88,
|
||||
height: 88,
|
||||
iconSize: 64,
|
||||
backgroundColor: '#01BEFF',
|
||||
fontColor: '#FFFFFF',
|
||||
icon: 'open',
|
||||
animationType: 'up',
|
||||
showMask: true,
|
||||
btnList: [
|
||||
{
|
||||
icon: 'logo-tuniao',
|
||||
text: '图鸟科技',
|
||||
bgColor: '#E72F8C'
|
||||
},
|
||||
{
|
||||
text: 'UI',
|
||||
textSize: 32,
|
||||
bgColor: '#FF7043'
|
||||
},
|
||||
{
|
||||
icon: 'share-triangle',
|
||||
iconSize: 32,
|
||||
iconColor: '#AAAAAA',
|
||||
bgColor: '#24F083',
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-fab组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '悬浮按钮位置',
|
||||
optional: ['左侧','右侧'],
|
||||
methods: 'positionChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '自定义悬浮按钮信息',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customFabChange'
|
||||
},
|
||||
{
|
||||
title: '自定义尺寸',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'sizeChange'
|
||||
},
|
||||
{
|
||||
title: '动画类型',
|
||||
optional: ['向上弹出','圆环弹出'],
|
||||
methods: 'animationChange'
|
||||
},
|
||||
{
|
||||
title: '遮罩显示',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'maskChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换按钮位置
|
||||
positionChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.left = 40
|
||||
this.right = 'auto'
|
||||
this.bottom = 100
|
||||
break
|
||||
case 1:
|
||||
this.left = 'auto'
|
||||
this.right = 40
|
||||
this.bottom = 100
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换悬浮按钮信息
|
||||
customFabChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.backgroundColor = '#01BEFF'
|
||||
this.fontColor = '#FFFFFF'
|
||||
this.icon = 'open'
|
||||
break
|
||||
case 1:
|
||||
this.backgroundColor = 'tn-cool-bg-color-1'
|
||||
this.fontColor = '#FFFFFF'
|
||||
this.icon = 'up'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换尺寸信息
|
||||
sizeChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.width = 88
|
||||
this.height = 88
|
||||
this.iconSize = 64
|
||||
break
|
||||
case 1:
|
||||
this.width = 64
|
||||
this.height = 64
|
||||
this.iconSize = 48
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换遮罩信息
|
||||
maskChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.showMask = true
|
||||
break
|
||||
case 1:
|
||||
this.showMask = false
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换动画
|
||||
animationChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.animationType = 'up'
|
||||
break
|
||||
case 1:
|
||||
this.animationType = 'around'
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 点击悬浮按钮的内容
|
||||
clickFabItem(e) {
|
||||
this.$t.messageUtils.toast(`点击了第 ${e.index} 个选项`)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -58,7 +58,7 @@
|
||||
<tn-checkbox v-model="model.agreement" @change="agreementCheckChange"></tn-checkbox>
|
||||
<view class="agreement-text">勾选同意当前协议</view>
|
||||
</view>
|
||||
<tn-button width="100%" @click="submit">提交</tn-button>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" width="100%" @click="submit">提交</tn-button>
|
||||
</dynamic-demo-template>
|
||||
|
||||
<!-- 性别选项 -->
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</view>
|
||||
</tn-image-upload>
|
||||
<view class="tn-flex tn-margin-top-xs tn-flex-row-center">
|
||||
<tn-button fontColor="tn-color-white" @tap="upload">上传</tn-button>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @tap="upload">上传</tn-button>
|
||||
<tn-button fontColor="tn-color-white" backgroundColor="tn-bg-red" margin="0rpx 0rpx 0rpx 20rpx" @tap="clear">清空列表</tn-button>
|
||||
</view>
|
||||
</dynamic-demo-template>
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
|
||||
<view class="components-index-list">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>IndexList索引列表</tn-nav-bar>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<tn-index-list :scrollTop="scrollTop" :indexList="indexList" :customBarHeight="vuex_custom_bar_height" :stickyTop="vuex_custom_bar_height">
|
||||
<view v-for="(item, index) in list" :key="index">
|
||||
<tn-index-anchor :index="item.letter"></tn-index-anchor>
|
||||
<view v-for="(data_item,data_index) in item.data" :key="data_index" class="index-list-item tn-border-solid-bottom">
|
||||
<image class="index-list-item__image" src="/static/favicon.ico"></image>
|
||||
<view class="index-list-item__name">{{ data_item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-index-list>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import indexList from '../../mock/index.list.js'
|
||||
const letterArr = indexList.list.map(val => {
|
||||
return val.letter
|
||||
})
|
||||
export default {
|
||||
name: 'componentsIndexListAvatar',
|
||||
data() {
|
||||
return {
|
||||
// 滚动的距离
|
||||
scrollTop: 0,
|
||||
// 索引列表
|
||||
indexList: letterArr,
|
||||
list: indexList.list
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.index-list-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
overflow: hidden;
|
||||
color: $tn-font-color;
|
||||
font-size: 28rpx;
|
||||
|
||||
&__image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin: 8rpx 8rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
|
||||
<view class="components-index-list">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>IndexList索引列表</tn-nav-bar>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<tn-index-list :scrollTop="scrollTop" :indexList="indexList" :customBarHeight="vuex_custom_bar_height" :stickyTop="vuex_custom_bar_height">
|
||||
<view v-for="(item, index) in list" :key="index">
|
||||
<tn-index-anchor :index="item.letter"></tn-index-anchor>
|
||||
<view v-for="(data_item,data_index) in item.data" :key="data_index" class="index-list-item tn-border-solid-bottom">
|
||||
{{ data_item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</tn-index-list>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import indexList from '../../mock/index.list.js'
|
||||
const letterArr = indexList.list.map(val => {
|
||||
return val.letter
|
||||
})
|
||||
export default {
|
||||
name: 'componentsIndexListBase',
|
||||
data() {
|
||||
return {
|
||||
// 滚动的距离
|
||||
scrollTop: 0,
|
||||
// 索引列表
|
||||
indexList: letterArr,
|
||||
list: indexList.list
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.index-list-item {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: 20rpx 24rpx;
|
||||
overflow: hidden;
|
||||
color: $tn-font-color;
|
||||
font-size: 28rpx;
|
||||
line-height: 48rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
@@ -7,15 +7,9 @@
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<tn-index-list :scrollTop="scrollTop" :indexList="indexList" :customBarHeight="vuex_custom_bar_height" :stickyTop="vuex_custom_bar_height">
|
||||
<view v-for="(item, index) in list" :key="index">
|
||||
<tn-index-anchor :index="item.letter"></tn-index-anchor>
|
||||
<view v-for="(data_item,data_index) in item.data" :key="data_index" class="index-list-item tn-border-solid-bottom">
|
||||
{{ data_item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</tn-index-list>
|
||||
<multiple-options-demo
|
||||
:list="optionsList"
|
||||
></multiple-options-demo>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -24,68 +18,23 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import indexList from '../mock/index.list.js'
|
||||
const letterArr = indexList.list.map(val => {
|
||||
return val.letter
|
||||
})
|
||||
import multipleOptionsDemo from '@/libs/components/multiple-options-demo'
|
||||
|
||||
export default {
|
||||
name: 'componentsIndexList',
|
||||
components: { multipleOptionsDemo },
|
||||
data() {
|
||||
return {
|
||||
// 滚动的距离
|
||||
scrollTop: 0,
|
||||
scrollTopArr: [0, 0],
|
||||
selectIndexScrollTop: [0 ,0],
|
||||
// 索引列表
|
||||
indexList: letterArr,
|
||||
list: indexList.list
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop
|
||||
},
|
||||
methods: {
|
||||
onScroll(e, index) {
|
||||
// this.scrollTop = e.detail.scrollTop
|
||||
this.$set(this.scrollTopArr, index - 1, e.detail.scrollTop)
|
||||
},
|
||||
|
||||
// 侧边栏索引选中事件
|
||||
indexListSelect(e, index) {
|
||||
this.$set(this.selectIndexScrollTop, index - 1, e.scrollTop)
|
||||
// 选项列表数据
|
||||
optionsList: [
|
||||
{ title: '普通列表', desc: '传入列表数据即可使用', url: '/componentsPage/index-list/base/index-list' },
|
||||
{ title: '带头像列表', desc: '通过自定义列表来实现', url: '/componentsPage/index-list/avatar/index-list' }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.index-list-item {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: 20rpx 24rpx;
|
||||
overflow: hidden;
|
||||
color: $tn-font-color;
|
||||
font-size: 28rpx;
|
||||
line-height: 48rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.index-list-image-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
overflow: hidden;
|
||||
color: $tn-font-color;
|
||||
font-size: 28rpx;
|
||||
|
||||
&__image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin: 8rpx 8rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
+312
-253
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-list">
|
||||
<view class="components-list tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>列表</tn-nav-bar>
|
||||
@@ -8,37 +8,197 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<tn-list-view
|
||||
:backgroundColor="viewBackgroundColor"
|
||||
:fontColor="viewFontColor"
|
||||
:fontSize="viewFontSize"
|
||||
:title="viewTitle"
|
||||
:unlined="viewUnlined"
|
||||
:card="viewCard"
|
||||
:marginTop="viewMarginTop"
|
||||
>
|
||||
<block v-if="viewCustomTitle">
|
||||
<view slot="title" class="list-title-container">
|
||||
<tn-button class="list-title-button">设置</tn-button>
|
||||
<demo-title title="基础">
|
||||
<view>
|
||||
<tn-list-view
|
||||
unlined="bottom"
|
||||
:customTitle="true"
|
||||
>
|
||||
<template slot="title">
|
||||
<view class="custom-title">
|
||||
<tn-button shape="" backgroundColor="tn-main-gradient-indigo" @click="openOptions">设置</tn-button>
|
||||
</view>
|
||||
</template>
|
||||
<tn-list-cell :arrow="cellArrow" :arrowRight="cellArrowRight" :unlined="cellUnlined" :lineLeft="cellLineLeft" :lineRight="cellLineRight">菜单一</tn-list-cell>
|
||||
<tn-list-cell :arrow="cellArrow" :arrowRight="cellArrowRight" :unlined="cellUnlined" :lineLeft="cellLineLeft" :lineRight="cellLineRight">菜单二</tn-list-cell>
|
||||
<tn-list-cell :arrow="cellArrow" :arrowRight="cellArrowRight" :unlined="cellUnlined" :lineLeft="cellLineLeft" :lineRight="cellLineRight">菜单三</tn-list-cell>
|
||||
</tn-list-view>
|
||||
</view>
|
||||
<view class="tn-margin-top">
|
||||
<tn-list-view
|
||||
:card="true"
|
||||
title="卡片式列表"
|
||||
backgroundColor="#EFEFEF"
|
||||
>
|
||||
<tn-list-cell :arrow="cellArrow" :arrowRight="cellArrowRight" :unlined="cellUnlined" :lineLeft="cellLineLeft" :lineRight="cellLineRight">菜单一</tn-list-cell>
|
||||
<tn-list-cell :arrow="cellArrow" :arrowRight="cellArrowRight" :unlined="cellUnlined" :lineLeft="cellLineLeft" :lineRight="cellLineRight">菜单二</tn-list-cell>
|
||||
<tn-list-cell :arrow="cellArrow" :arrowRight="cellArrowRight" :unlined="cellUnlined" :lineLeft="cellLineLeft" :lineRight="cellLineRight">菜单三</tn-list-cell>
|
||||
</tn-list-view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="列表项单独使用">
|
||||
<view>
|
||||
<tn-list-cell>
|
||||
普通列表
|
||||
</tn-list-cell>
|
||||
</view>
|
||||
<view class="tn-margin-top-sm">
|
||||
<tn-list-cell :radius="true">
|
||||
圆角列表
|
||||
</tn-list-cell>
|
||||
</view>
|
||||
<view class="tn-margin-top-sm">
|
||||
<tn-list-cell>
|
||||
<view class="list-icon-text">
|
||||
<view class="list__left">
|
||||
<view class="list__left__icon tn-icon-discover tn-color-gray"></view>
|
||||
<view class="list__left__text">图标 + 文字</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-for="(item, index) in 3" :key="index">
|
||||
<tn-list-cell
|
||||
:backgroundColor="cellBackgroundColor"
|
||||
:fontColor="cellFontColor"
|
||||
:fontSize="cellFontSize"
|
||||
:arrow="cellArrow"
|
||||
:arrowRight="cellArrowRight"
|
||||
:hover="cellHover"
|
||||
:radius="cellRadius"
|
||||
:unlined="cellUnlined"
|
||||
:lineLeft="cellLineLeft"
|
||||
:lineRight="cellLineRight"
|
||||
>选项 {{ index }}</tn-list-cell>
|
||||
</block>
|
||||
</tn-list-cell>
|
||||
</view>
|
||||
<view class="tn-margin-top-sm">
|
||||
<tn-list-cell>
|
||||
<view class="list-image-text">
|
||||
<view class="list__left">
|
||||
<image src="/static/favicon.ico" class="list__left__image"></image>
|
||||
<view class="list__left__text">图片 + 文字</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
</view>
|
||||
<view class="tn-margin-top-sm">
|
||||
<tn-list-cell>
|
||||
<view class="list-icon-text">
|
||||
<view class="list__left">
|
||||
<view class="list__left__icon tn-icon-order tn-color-indigo"></view>
|
||||
<view class="list__left__text">文本</view>
|
||||
</view>
|
||||
<view class="list__right">
|
||||
<view class="tn-text-sm tn-color-gray">定一个小目标吧</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
</view>
|
||||
<view class="tn-margin-top-sm">
|
||||
<tn-list-cell>
|
||||
<view class="list-icon-text">
|
||||
<view class="list__left">
|
||||
<view class="list__left__icon tn-icon-upload tn-color-cyan"></view>
|
||||
<view class="list__left__text">按钮</view>
|
||||
</view>
|
||||
<view class="list__right">
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" shape="round" size="sm">
|
||||
<text class="tn-icon-upload tn-margin-right-xs"></text>上传
|
||||
</tn-button>
|
||||
</view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
</view>
|
||||
<view class="tn-margin-top-sm">
|
||||
<tn-list-cell>
|
||||
<view class="list-icon-text">
|
||||
<view class="list__left">
|
||||
<view class="list__left__icon tn-icon-tag tn-text-clip tn-main-gradient-orangeyellow"></view>
|
||||
<view class="list__left__text">标签</view>
|
||||
</view>
|
||||
<view class="list__right">
|
||||
<tn-tag backgroundColor="tn-main-gradient-indigo" shape="circle" margin="0rpx 5rpx">篮球</tn-tag>
|
||||
<tn-tag backgroundColor="tn-main-gradient-indigo" shape="circle" margin="0rpx 5rpx">足球</tn-tag>
|
||||
<tn-tag backgroundColor="tn-main-gradient-indigo" shape="circle" margin="0rpx 5rpx">小球</tn-tag>
|
||||
</view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
</view>
|
||||
<view class="tn-margin-top-sm">
|
||||
<tn-list-cell>
|
||||
<view class="list-icon-text">
|
||||
<view class="list__left">
|
||||
<view class="list__left__icon tn-icon-emoji-good tn-text-clip tn-main-gradient-orangered"></view>
|
||||
<view class="list__left__text">头像组</view>
|
||||
</view>
|
||||
<view class="list__right">
|
||||
<tn-avatar-group :lists="avatarGroupList" size="sm"></tn-avatar-group>
|
||||
</view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="聊天示例">
|
||||
<tn-list-view title="消息列表" unlined="bottom">
|
||||
<tn-list-cell :unlined="true">
|
||||
<view class="message">
|
||||
<view class="message__left">
|
||||
<tn-avatar src="https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg"></tn-avatar>
|
||||
</view>
|
||||
<view class="message__middle">
|
||||
<view class="message__name">小图鸟</view>
|
||||
<view class="message__content tn-text-ellipsis">欢迎使用图鸟UI,图鸟UI专做UI界面100年</view>
|
||||
</view>
|
||||
<view class="message__right">
|
||||
<view class="message__time">13:14</view>
|
||||
<view class="message__tips">
|
||||
<tn-tag backgroundColor="tn-bg-red" fontColor="tn-color-white" shape="circle" width="auto" size="sm">99</tn-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
<tn-list-cell :unlined="true">
|
||||
<view class="message">
|
||||
<view class="message__left">
|
||||
<tn-avatar src="https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg" :badge="true" badgeText="99" badgeBgColor="tn-bg-red" badgeColor="tn-color-white"></tn-avatar>
|
||||
</view>
|
||||
<view class="message__middle">
|
||||
<view class="message__name">小图鸟</view>
|
||||
<view class="message__content tn-text-ellipsis">欢迎使用图鸟UI,图鸟UI专做UI界面100年</view>
|
||||
</view>
|
||||
<view class="message__right">
|
||||
<view class="message__time">13:14</view>
|
||||
<view class="message__tips">
|
||||
<text class="message__tips__icon tn-icon-sound-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
</tn-list-view>
|
||||
</dynamic-demo-template>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
<tn-modal
|
||||
v-model="showListOptions"
|
||||
:custom="true"
|
||||
padding="0"
|
||||
>
|
||||
<tn-list-view>
|
||||
<tn-list-cell>
|
||||
<view class="list__options">
|
||||
<view class="list__options__title">下划线</view>
|
||||
<view class="list__options__switch"><tn-switch v-model="cellShowBorderLine" leftIcon="close" rightIcon="success" @change="closeOptions"></tn-switch></view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
<tn-list-cell v-if="!cellUnlined">
|
||||
<view class="list__options">
|
||||
<view class="list__options__title">长下划线</view>
|
||||
<view class="list__options__switch"><tn-switch v-model="cellLongBorderLine" leftIcon="close" rightIcon="success" @change="closeOptions"></tn-switch></view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
<tn-list-cell>
|
||||
<view class="list__options">
|
||||
<view class="list__options__title">箭头</view>
|
||||
<view class="list__options__switch"><tn-switch v-model="cellArrow" leftIcon="close" rightIcon="success" @change="closeOptions"></tn-switch></view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
<tn-list-cell v-if="cellArrow">
|
||||
<view class="list__options">
|
||||
<view class="list__options__title">无边距箭头</view>
|
||||
<view class="list__options__switch"><tn-switch v-model="cellNoPaddingArrow" leftIcon="close" rightIcon="success" @change="closeOptions"></tn-switch></view>
|
||||
</view>
|
||||
</tn-list-cell>
|
||||
</tn-list-view>
|
||||
</tn-modal>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -47,260 +207,159 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsList',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
viewBackgroundColor: '',
|
||||
viewFontColor: '',
|
||||
viewFontSize: 0,
|
||||
viewTitle: '',
|
||||
viewCustomTitle: false,
|
||||
viewCard: false,
|
||||
viewMarginTop: '',
|
||||
viewUnlined: 'all',
|
||||
showListOptions: false,
|
||||
cellShowBorderLine: true,
|
||||
cellLongBorderLine: false,
|
||||
cellNoPaddingArrow: false,
|
||||
|
||||
cellBackgroundColor: '',
|
||||
cellFontColor: '',
|
||||
cellFontSize: 0,
|
||||
cellArrow: true,
|
||||
cellArrow: false,
|
||||
cellArrowRight: true,
|
||||
cellRadius: false,
|
||||
cellUnlined: false,
|
||||
cellLineLeft: true,
|
||||
cellLineRight: true,
|
||||
cellHover: false,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-list-view、tn-list-cell组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '容器参数',
|
||||
section: [
|
||||
{
|
||||
title: '自定义颜色',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'viewColorChange'
|
||||
},
|
||||
{
|
||||
title: '自定义大小',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'viewSizeChange'
|
||||
},
|
||||
{
|
||||
title: '标题类型',
|
||||
optional: ['空白','文字标题','自定义标题'],
|
||||
methods: 'viewTitleChange'
|
||||
},
|
||||
{
|
||||
title: '容器类型',
|
||||
optional: ['默认','卡片'],
|
||||
methods: 'viewContainerChange'
|
||||
},
|
||||
{
|
||||
title: '边框类型',
|
||||
optional: ['全部显示','上边框','下边框','不显示'],
|
||||
methods: 'viewBoardChange',
|
||||
current: 3
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '列表参数',
|
||||
section: [
|
||||
{
|
||||
title: '自定义颜色',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'cellColorChange'
|
||||
},
|
||||
{
|
||||
title: '自定义大小',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'cellSizeChange'
|
||||
},
|
||||
{
|
||||
title: '显示类型',
|
||||
optional: ['默认','圆角'],
|
||||
methods: 'cellRadiusChange'
|
||||
},
|
||||
{
|
||||
title: '箭头',
|
||||
optional: ['隐藏','显示'],
|
||||
methods: 'cellArrowChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '箭头边距',
|
||||
optional: ['默认','无边距'],
|
||||
methods: 'cellArrowRightChange'
|
||||
},
|
||||
{
|
||||
title: '显示底边',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'cellUnlinedChange',
|
||||
},
|
||||
{
|
||||
title: '底边边距',
|
||||
optional: ['默认','无边距'],
|
||||
methods: 'cellLineChange',
|
||||
},
|
||||
{
|
||||
title: '点击效果',
|
||||
optional: ['无','有'],
|
||||
methods: 'cellHoverChange',
|
||||
}
|
||||
]
|
||||
}
|
||||
avatarGroupList: [
|
||||
{src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg'},
|
||||
{src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai2.jpg'},
|
||||
{src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg'},
|
||||
{src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai2.jpg'},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换容器颜色
|
||||
viewColorChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.viewBackgroundColor = ''
|
||||
this.viewFontColor = ''
|
||||
} else {
|
||||
this.viewBackgroundColor = '#F8F7F8'
|
||||
this.viewFontColor = 'tn-color-grey'
|
||||
}
|
||||
},
|
||||
// 切换容器大小
|
||||
viewSizeChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.viewFontSize = 0
|
||||
this.viewMarginTop = ''
|
||||
} else {
|
||||
this.viewFontSize = 32
|
||||
this.viewMarginTop = '48rpx'
|
||||
}
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换容器标题
|
||||
viewTitleChange(event) {
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.viewTitle = ''
|
||||
this.viewCustomTitle = false
|
||||
break
|
||||
case 1:
|
||||
this.viewTitle = '请选择对应的选项'
|
||||
this.viewCustomTitle = false
|
||||
break
|
||||
case 2:
|
||||
this.viewTitle = ''
|
||||
this.viewCustomTitle = true
|
||||
break
|
||||
}
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换容器类型
|
||||
viewContainerChange(event) {
|
||||
this.viewCard = event.index === 0 ? false : true
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换容器边框类型
|
||||
viewBoardChange(event) {
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.viewUnlined = ''
|
||||
break
|
||||
case 1:
|
||||
this.viewUnlined = 'bottom'
|
||||
break
|
||||
case 2:
|
||||
this.viewUnlined = 'top'
|
||||
break
|
||||
case 3:
|
||||
this.viewUnlined = 'all'
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 切换列表颜色
|
||||
cellColorChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.cellBackgroundColor = ''
|
||||
this.cellFontColor = ''
|
||||
} else {
|
||||
this.cellBackgroundColor = '#D6F4FA'
|
||||
this.cellFontColor = 'tn-color-grey'
|
||||
}
|
||||
},
|
||||
// 切换列表大小
|
||||
cellSizeChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.cellFontSize = 0
|
||||
} else {
|
||||
this.cellFontSize = 36
|
||||
}
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换列表圆角
|
||||
cellRadiusChange(event) {
|
||||
this.cellRadius = event.index === 0 ? false : true
|
||||
},
|
||||
// 切换列表箭头显示
|
||||
cellArrowChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.cellArrow = false
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(4, false)
|
||||
} else {
|
||||
this.cellArrow = true
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(4, true)
|
||||
}
|
||||
},
|
||||
// 切换列表箭头贴边
|
||||
cellArrowRightChange(event) {
|
||||
this.cellArrowRight = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换列表底边显示
|
||||
cellUnlinedChange(event) {
|
||||
if (event.index === 0) {
|
||||
watch: {
|
||||
cellShowBorderLine(val) {
|
||||
if (val) {
|
||||
this.cellUnlined = false
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(6, true)
|
||||
} else {
|
||||
this.cellUnlined = true
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(6, false)
|
||||
}
|
||||
},
|
||||
// 切换列表底边的边距
|
||||
cellLineChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.cellLineLeft = true
|
||||
this.cellLineRight = true
|
||||
} else if (event.index === 1) {
|
||||
cellLongBorderLine(val) {
|
||||
if (val) {
|
||||
this.cellLineLeft = false
|
||||
this.cellLineRight = false
|
||||
} else {
|
||||
this.cellLineLeft = true
|
||||
this.cellLineRight = true
|
||||
}
|
||||
},
|
||||
// 切换列表点击效果
|
||||
cellHoverChange(event) {
|
||||
this.cellHover = event.index === 0 ? false : true
|
||||
},
|
||||
|
||||
cellNoPaddingArrow(val) {
|
||||
if (val) {
|
||||
this.cellArrowRight = false
|
||||
} else {
|
||||
this.cellArrowRight = true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 弹出设置弹框
|
||||
openOptions() {
|
||||
this.showListOptions = true
|
||||
},
|
||||
// 关闭设置弹框
|
||||
closeOptions() {
|
||||
this.showListOptions = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.list-title-container {
|
||||
.components-list {
|
||||
background-color: $tn-bg-gray-color;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.custom-title {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
padding: 10rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
|
||||
.list__options {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.list {
|
||||
&__left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
|
||||
&__icon, &__image {
|
||||
margin-right: 18rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list-title-button {
|
||||
width: 160rpx !important;
|
||||
height: 46rpx !important;
|
||||
color: #FFFFFF;
|
||||
margin: 10rpx !important;
|
||||
&__right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
.list-icon-text, .list-image-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.list-image-text {
|
||||
.list {
|
||||
&__left {
|
||||
&__image {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
&__left {
|
||||
width: 10%;
|
||||
}
|
||||
&__middle {
|
||||
width: 80%;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 40rpx;
|
||||
}
|
||||
&__right {
|
||||
width: 10%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
&__content {
|
||||
font-size: 26rpx;
|
||||
color: #838383;
|
||||
}
|
||||
&__tips {
|
||||
&__icon {
|
||||
font-size: 36rpx;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-loading">
|
||||
<view class="components-loading tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>Loading加载动画</tn-nav-bar>
|
||||
@@ -8,14 +8,57 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-loading
|
||||
:show="show"
|
||||
:mode="mode"
|
||||
:color="color"
|
||||
:size="size"
|
||||
></tn-loading>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="样式">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show"></tn-loading>
|
||||
</view>
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show" mode="flower"></tn-loading>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="大小">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show"></tn-loading>
|
||||
</view>
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show" :size="50"></tn-loading>
|
||||
</view>
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show" :size="80"></tn-loading>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-margin-top">
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show" mode="flower"></tn-loading>
|
||||
</view>
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show" mode="flower" :size="50"></tn-loading>
|
||||
</view>
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show" mode="flower" :size="80"></tn-loading>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="颜色">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show"></tn-loading>
|
||||
</view>
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show" color="#01BEFF"></tn-loading>
|
||||
</view>
|
||||
<view class="tn-margin-right">
|
||||
<tn-loading show="show" color="#E83A30"></tn-loading>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -24,79 +67,17 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsLoading',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
show: true,
|
||||
mode: 'circle',
|
||||
color: '',
|
||||
size: 34,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-loading组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '显示',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'showChange'
|
||||
},
|
||||
{
|
||||
title: '模式',
|
||||
optional: ['圆圈','花朵'],
|
||||
methods: 'modeChange'
|
||||
},
|
||||
{
|
||||
title: '颜色',
|
||||
optional: ['默认','#31E749','#31C9E8'],
|
||||
methods: 'colorChange'
|
||||
},
|
||||
{
|
||||
title: '尺寸',
|
||||
optional: ['28','34','54'],
|
||||
methods: 'sizeChange',
|
||||
current: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换是否显示
|
||||
showChange(event) {
|
||||
this.show = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换模式
|
||||
modeChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.mode = 'circle'
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(2, true)
|
||||
break
|
||||
case 1:
|
||||
this.mode = 'flower'
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(2, false)
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换颜色
|
||||
colorChange(event) {
|
||||
this.color = event.index === 0 ? '' : event.name
|
||||
},
|
||||
// 切换尺寸
|
||||
sizeChange(event) {
|
||||
this.size = Number(event.name)
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-button fontColor="tn-color-white" @click="showModal">弹出模态框</tn-button>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showModal">弹出模态框</tn-button>
|
||||
</dynamic-demo-template>
|
||||
|
||||
</view>
|
||||
@@ -41,7 +41,7 @@
|
||||
<tn-form-item label="验证码" :borderBottom="false">
|
||||
<tn-input placeholder="请输入验证码"></tn-input>
|
||||
<view slot="right" class="tn-flex tn-flex-col-center tn-flex-row-center">
|
||||
<tn-button :fontSize="20" padding="10rpx" height="46rpx" fontColor="tn-color-white">获取验证码</tn-button>
|
||||
<tn-button :fontSize="20" padding="10rpx" height="46rpx" backgroundColor="#01BEFF" fontColor="tn-color-white">获取验证码</tn-button>
|
||||
</view>
|
||||
</tn-form-item>
|
||||
</tn-form>
|
||||
@@ -77,7 +77,7 @@
|
||||
},
|
||||
{
|
||||
text: '确定',
|
||||
backgroundColor: 'tn-bg-red',
|
||||
backgroundColor: 'tn-bg-indigo',
|
||||
fontColor: '#FFFFFF'
|
||||
}
|
||||
],
|
||||
|
||||
@@ -3,34 +3,58 @@
|
||||
<view class="components-nav_bar">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>navBar导航栏</tn-nav-bar>
|
||||
<tn-nav-bar
|
||||
v-if="mode === 'normal'"
|
||||
fixed
|
||||
:height="height"
|
||||
:backgroundColor="backgroundColor"
|
||||
:fontColor="fontColor"
|
||||
:alpha="alpha"
|
||||
:bottomShadow="bottomShadow"
|
||||
>navBar导航栏</tn-nav-bar>
|
||||
|
||||
<tn-nav-bar
|
||||
v-if="mode === 'customBack'"
|
||||
fixed
|
||||
:height="height"
|
||||
:customBack="true"
|
||||
:backgroundColor="backgroundColor"
|
||||
:fontColor="fontColor"
|
||||
:alpha="alpha"
|
||||
:bottomShadow="bottomShadow"
|
||||
>
|
||||
<view slot="back" class='tn-custom-nav-bar__back'>
|
||||
<view><text class='tn-icon-left'></text></view>
|
||||
<view><text class='tn-icon-home-capsule-fill'></text></view>
|
||||
</view>
|
||||
<view class="custom-nav-content">
|
||||
<view class="search-content">
|
||||
<tn-input class="search-input" v-model="searchValue" placeholder="请输入要搜索的内容" :border="true" :height="50" :showLeftIcon="true" leftIcon="search"></tn-input>
|
||||
</view>
|
||||
</view>
|
||||
</tn-nav-bar>
|
||||
|
||||
<tn-nav-bar
|
||||
v-if="mode === 'customNav'"
|
||||
fixed
|
||||
:height="height"
|
||||
:isBack="false"
|
||||
:backgroundColor="backgroundColor"
|
||||
:fontColor="fontColor"
|
||||
:alpha="alpha"
|
||||
:bottomShadow="bottomShadow"
|
||||
>
|
||||
<view class="custom-nav-content">
|
||||
<view class="search-content">
|
||||
<tn-input class="search-input" v-model="searchValue" placeholder="请输入要搜索的内容" :border="true" :height="50" :showLeftIcon="true" leftIcon="search"></tn-input>
|
||||
</view>
|
||||
</view>
|
||||
</tn-nav-bar>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<!-- 普通导航栏 -->
|
||||
<tn-nav-bar v-if="mode === 'normal'" :fixed="false" :height="height" :backgroundColor="backgroundColor" :alpha="alpha">图鸟科技</tn-nav-bar>
|
||||
<!-- 自定义内容导航栏,隐藏返回按钮 -->
|
||||
<tn-nav-bar v-if="mode === 'customNav'" :fixed="false" :isBack="false" :height="height" :backgroundColor="backgroundColor" :alpha="alpha">
|
||||
<view class="custom-nav-content">
|
||||
<view class="search-content">
|
||||
<tn-input class="search-input" v-model="searchValue" placeholder="请输入要搜索的内容" :border="true" :height="50" :showLeftIcon="true" leftIcon="search"></tn-input>
|
||||
</view>
|
||||
</view>
|
||||
</tn-nav-bar>
|
||||
<!-- 自定义放回按钮 -->
|
||||
<tn-nav-bar v-if="mode === 'customBack'" :fixed="false" :customBack="true" :height="height" :backgroundColor="backgroundColor" :alpha="alpha">
|
||||
<view slot="back" class='tn-custom-nav-bar__back'>
|
||||
<view><text class='tn-icon-left'></text></view>
|
||||
<view><text class='tn-icon-home-capsule-fill'></text></view>
|
||||
</view>
|
||||
<view class="custom-nav-content">
|
||||
<view class="search-content">
|
||||
<tn-input class="search-input" v-model="searchValue" placeholder="请输入要搜索的内容" :border="true" :height="50" :showLeftIcon="true" leftIcon="search"></tn-input>
|
||||
</view>
|
||||
</view>
|
||||
</tn-nav-bar>
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click" :noDemo="true">
|
||||
</dynamic-demo-template>
|
||||
|
||||
</view>
|
||||
@@ -48,9 +72,11 @@
|
||||
return {
|
||||
searchValue: '',
|
||||
mode: 'normal',
|
||||
height: 46,
|
||||
height: 0,
|
||||
backgroundColor: '#FFFFFF',
|
||||
fontColor: '',
|
||||
alpha: false,
|
||||
bottomShadow: true,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-toast组件'],
|
||||
sectionList: [
|
||||
@@ -59,9 +85,8 @@
|
||||
section: [
|
||||
{
|
||||
title: '高度',
|
||||
optional: ['默认','46','80'],
|
||||
methods: 'heightChange',
|
||||
current: 1
|
||||
optional: ['默认','38','80'],
|
||||
methods: 'heightChange'
|
||||
},
|
||||
{
|
||||
title: '样式',
|
||||
@@ -70,8 +95,13 @@
|
||||
},
|
||||
{
|
||||
title: '背景颜色',
|
||||
optional: ['默认','#01BEFF','透明'],
|
||||
optional: ['默认','#01BEFF','tn-bg-grey','tn-main-gradient-indigo','透明'],
|
||||
methods: 'backgroundColorChange'
|
||||
},
|
||||
{
|
||||
title: '底部阴影',
|
||||
optional: ['默认','隐藏'],
|
||||
methods: 'bottomShadowChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -105,17 +135,27 @@
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.backgroundColor = '#FFFFFF'
|
||||
this.fontColor = ''
|
||||
this.alpha = false
|
||||
break
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
this.fontColor = '#FFFFFF'
|
||||
this.backgroundColor = event.name
|
||||
this.alpha = false
|
||||
break
|
||||
case 2:
|
||||
case 4:
|
||||
this.backgroundColor = ''
|
||||
this.fontColor = ''
|
||||
this.alpha = true
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换底部阴影
|
||||
bottomShadowChange(event) {
|
||||
this.bottomShadow = event.index === 0 ? true : false
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-notice-bar">
|
||||
<view class="components-notice-bar tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>noticeBar通知栏</tn-nav-bar>
|
||||
@@ -8,36 +8,57 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<tn-notice-bar
|
||||
:show="show"
|
||||
:list="list"
|
||||
:mode="mode"
|
||||
:backgroundColor="backgroundColor"
|
||||
:fontColor="fontColor"
|
||||
:fontSize="fontSize"
|
||||
:playStatus="playStatus"
|
||||
:leftIcon="leftIcon"
|
||||
:leftIconName="leftIconName"
|
||||
:leftIconSize="leftIconSize"
|
||||
:rightIcon="rightIcon"
|
||||
:rightIconName="rightIconName"
|
||||
:rightIconSize="rightIconSize"
|
||||
:closeBtn="closeBtn"
|
||||
:radius="radius"
|
||||
:padding="padding"
|
||||
:autoplay="autoplay"
|
||||
:duration="duration"
|
||||
:speed="speed"
|
||||
:circular="circular"
|
||||
:autoHidden="autoHidden"
|
||||
@click="onClick"
|
||||
@close="close"
|
||||
@clickLeft="onLeftClick"
|
||||
@clickRight="onRightClick"
|
||||
@end="end"
|
||||
></tn-notice-bar>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="水平连续滚动">
|
||||
<tn-notice-bar :list="list"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="水平不连续滚动">
|
||||
<tn-notice-bar :list="list" :circular="false"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="垂直滚动">
|
||||
<tn-notice-bar :list="list" mode="vertical"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="手动滚动">
|
||||
<tn-notice-bar :list="list" mode="vertical" :autoplay="false"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="停止滚动">
|
||||
<tn-notice-bar :list="list" mode="vertical" playStatus="paused"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="慢速滚动">
|
||||
<tn-notice-bar :list="list" :speed="100"></tn-notice-bar>
|
||||
<view class="tn-margin-top">
|
||||
<tn-notice-bar :list="list" mode="vertical" :duration="5000"></tn-notice-bar>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="显示关闭按钮">
|
||||
<tn-notice-bar :show="closeNoticeShow" :list="list" :closeBtn="true" @close="closeNoticeShow = false"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="隐藏左右两侧图标">
|
||||
<tn-notice-bar :show="closeNoticeShow" :list="list" :rightIcon="false" :leftIcon="false" @close="closeNoticeShow = false"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义左右两侧图标">
|
||||
<tn-notice-bar :show="closeNoticeShow" :list="list" :rightIcon="true" :leftIcon="true" rightIconName="set" leftIconName="all" @close="closeNoticeShow = false"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义大小">
|
||||
<tn-notice-bar :show="closeNoticeShow" :list="list" :rightIcon="true" :fontSize="34" :leftIconSize="40" :rightIconSize="40" @close="closeNoticeShow = false"></tn-notice-bar>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义颜色">
|
||||
<tn-notice-bar :show="closeNoticeShow" :list="list" :rightIcon="true" backgroundColor="#EFEFEF" @close="closeNoticeShow = false"></tn-notice-bar>
|
||||
<view class="tn-margin-top">
|
||||
<tn-notice-bar :show="closeNoticeShow" :list="list" :rightIcon="true" backgroundColor="tn-main-gradient-indigo" @close="closeNoticeShow = false"></tn-notice-bar>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -46,10 +67,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsNoticeBar',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
@@ -58,231 +79,11 @@
|
||||
'TuniaoUIV2.0.0即将发布',
|
||||
'今天想提前下班,领导不允许:"你提前走人就算你是旷工了啊!"'
|
||||
],
|
||||
|
||||
show: true,
|
||||
mode: 'horizontal',
|
||||
backgroundColor: '',
|
||||
fontColor: '',
|
||||
fontSize: 0,
|
||||
playStatus: 'play',
|
||||
leftIcon: true,
|
||||
leftIconName: 'sound',
|
||||
leftIconSize: 34,
|
||||
rightIcon: false,
|
||||
rightIconName: 'right',
|
||||
rightIconSize: 26,
|
||||
closeBtn: false,
|
||||
radius: 0,
|
||||
padding: '18rpx 24rpx',
|
||||
autoplay: true,
|
||||
duration: 2000,
|
||||
speed: 160,
|
||||
circular: true,
|
||||
autoHidden: true,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-notice-bar组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '滚动模式',
|
||||
optional: ['水平连续','水平不连续','垂直'],
|
||||
methods: 'modeChange'
|
||||
},
|
||||
{
|
||||
title: '显示状态',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'showChange'
|
||||
},
|
||||
{
|
||||
title: '播放状态',
|
||||
optional: ['播放','暂停'],
|
||||
methods: 'playStatusChange'
|
||||
},
|
||||
{
|
||||
title: '速度控制',
|
||||
optional: ['减速','加速'],
|
||||
methods: 'speedChange'
|
||||
},
|
||||
{
|
||||
title: '图标显示',
|
||||
optional: ['默认','显示右边图标','显示关闭按钮','全部不显示'],
|
||||
methods: 'iconChange'
|
||||
},
|
||||
{
|
||||
title: '自定义图标',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'iconNameChange'
|
||||
},
|
||||
{
|
||||
title: '自定义颜色',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'colorChange'
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'styleChange'
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
closeNoticeShow: true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换滚动模式
|
||||
modeChange(event) {
|
||||
this.speed = 160
|
||||
this.duration = 2000
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.mode = 'horizontal'
|
||||
this.circular = true
|
||||
break
|
||||
case 1:
|
||||
this.mode = 'horizontal'
|
||||
this.circular = false
|
||||
break
|
||||
case 2:
|
||||
this.mode = 'vertical'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换显示状态
|
||||
showChange(event) {
|
||||
this.show = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换播放状态
|
||||
playStatusChange(event) {
|
||||
this.playStatus = event.index === 0 ? 'play' : 'paused'
|
||||
},
|
||||
// 切换滚动速度
|
||||
speedChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
if (this.mode === 'horizontal' && this.circular) {
|
||||
const speed = this.speed - 10
|
||||
this.speed = speed > 0 ? speed : 0
|
||||
} else {
|
||||
const duration = this.duration + 100
|
||||
if (duration > 3000) {
|
||||
this.$t.messageUtils.toast('达到速度最小值')
|
||||
this.duration = 3000
|
||||
} else {
|
||||
this.duration = duration
|
||||
}
|
||||
}
|
||||
break
|
||||
case 1:
|
||||
if (this.mode === 'horizontal' && this.circular) {
|
||||
const speed = this.speed + 10
|
||||
if (speed > 300) {
|
||||
this.$t.messageUtils.toast('达到速度最大值')
|
||||
this.speed = 300
|
||||
} else {
|
||||
this.speed = speed
|
||||
}
|
||||
} else {
|
||||
const duration = this.duration - 100
|
||||
this.duration = this.duration > 0 ? duration : 0
|
||||
}
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换图标显示
|
||||
iconChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.leftIcon = true
|
||||
this.rightIcon = false
|
||||
this.closeBtn = false
|
||||
break
|
||||
case 1:
|
||||
this.rightIcon = true
|
||||
break
|
||||
case 2:
|
||||
this.closeBtn = true
|
||||
break
|
||||
case 3:
|
||||
this.leftIcon = false
|
||||
this.rightIcon = false
|
||||
this.closeBtn = false
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换自定义图标
|
||||
iconNameChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.leftIconName = 'sound'
|
||||
this.rightIconName = 'right'
|
||||
break
|
||||
case 1:
|
||||
this.leftIconName = 'tag'
|
||||
this.rightIconName = 'trophy'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换自定义颜色
|
||||
colorChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.backgroundColor = ''
|
||||
this.fontColor = ''
|
||||
break
|
||||
case 1:
|
||||
this.backgroundColor = 'tn-bg-red'
|
||||
this.fontColor = '#FFFFFF'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换自定义样式
|
||||
styleChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.fontSize = 0
|
||||
this.radius = 0
|
||||
this.leftIconSize = 34
|
||||
this.rightIconSize = 26
|
||||
break
|
||||
case 1:
|
||||
this.fontSize = 40
|
||||
this.radius = 10
|
||||
this.leftIconSize = 50
|
||||
this.rightIconSize = 30
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 点击消息
|
||||
onClick(index) {
|
||||
this.$t.messageUtils.toast('点击了消息')
|
||||
},
|
||||
// 点击关闭按钮
|
||||
close() {
|
||||
this.$t.messageUtils.toast('点击关闭按钮')
|
||||
},
|
||||
// 点击左边图标
|
||||
onLeftClick() {
|
||||
this.$t.messageUtils.toast('点击左边图标')
|
||||
},
|
||||
// 点击右边图标
|
||||
onRightClick() {
|
||||
this.$t.messageUtils.toast('点击右边图标')
|
||||
},
|
||||
// 一个周期滚动结束
|
||||
end() {
|
||||
console.log('滚动结束');
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-number_box">
|
||||
<view class="components-number_box tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>numberBox步进输入</tn-nav-bar>
|
||||
@@ -8,22 +8,42 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-number-box
|
||||
v-model="value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
:step="step"
|
||||
:disabled="disabled"
|
||||
:disabledInput="disabledInput"
|
||||
:inputWidth="inputWidth"
|
||||
:inputHeight="inputHeight"
|
||||
:positiveInteger="positiveInteger"
|
||||
:backgroundColor="backgroundColor"
|
||||
:fontColor="fontColor"
|
||||
:fontSize="fontSize"
|
||||
></tn-number-box>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="基本使用">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-number-box v-model="value1"></tn-number-box>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-number-box v-model="value1" :disabled="true"></tn-number-box>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="设置步进值">
|
||||
<tn-number-box v-model="value2" :step="2"></tn-number-box>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="设置最小最大值">
|
||||
<tn-number-box v-model="value3" :min="50" :max="1000"></tn-number-box>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="设置允许输入小数">
|
||||
<tn-number-box v-model="value4" :positiveInteger="false" :step="0.5"></tn-number-box>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="禁止输入">
|
||||
<tn-number-box v-model="value5" :disabledInput="true"></tn-number-box>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义尺寸">
|
||||
<tn-number-box v-model="value6" :inputWidth="140" :inputHeight="60" :fontSize="40"></tn-number-box>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义颜色">
|
||||
<tn-number-box v-model="value7" backgroundColor="#AAAAAA" fontColor="#838383"></tn-number-box>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -32,140 +52,29 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsNumberBox',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
value: 0,
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 1,
|
||||
disabled: false,
|
||||
disabledInput: false,
|
||||
inputWidth: 88,
|
||||
inputHeight: 50,
|
||||
positiveInteger: true,
|
||||
backgroundColor: '#E6E6E6',
|
||||
fontColor: '',
|
||||
fontSize: 0,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-number-box组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '初始值',
|
||||
optional: ['0','1','2.5','3','4','5'],
|
||||
methods: 'valueChange'
|
||||
},
|
||||
{
|
||||
title: '最小最大值',
|
||||
optional: ['0-100','50-1000'],
|
||||
methods: 'minMaxChange'
|
||||
},
|
||||
{
|
||||
title: '步进值',
|
||||
optional: ['1','5','0.5'],
|
||||
methods: 'stepChange'
|
||||
},
|
||||
{
|
||||
title: '只允许输入正整数',
|
||||
optional: ['是','否'],
|
||||
methods: 'positiveIntegerChange'
|
||||
},
|
||||
{
|
||||
title: '禁用状态',
|
||||
optional: ['是','否'],
|
||||
methods: 'disabledChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '禁用输入状态',
|
||||
optional: ['是','否'],
|
||||
methods: 'disabledInputChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '自定义尺寸',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customSizeChange'
|
||||
},
|
||||
{
|
||||
title: '自定义颜色',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customColorChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
value1: 0,
|
||||
value2: 0,
|
||||
value3: 0,
|
||||
value4: 0,
|
||||
value5: 0,
|
||||
value6: 0,
|
||||
value7: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换初始值
|
||||
valueChange(event) {
|
||||
this.value = Number(event.name)
|
||||
},
|
||||
// 切换最小最大值
|
||||
minMaxChange(event) {
|
||||
const value = event.name.split('-')
|
||||
this.min = Number(value[0])
|
||||
this.max = Number(value[1])
|
||||
},
|
||||
// 切换步进值
|
||||
stepChange(event) {
|
||||
this.step = Number(event.name)
|
||||
},
|
||||
// 切换允许正整数状态
|
||||
positiveIntegerChange(event) {
|
||||
this.positiveInteger = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换禁用状态
|
||||
disabledChange(event) {
|
||||
this.disabled = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换禁用输入状态
|
||||
disabledInputChange(event) {
|
||||
this.disabledInput = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换自定义尺寸
|
||||
customSizeChange(event) {
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.inputWidth = 88
|
||||
this.inputHeight = 50
|
||||
this.fontSize = 0
|
||||
break
|
||||
case 1:
|
||||
this.inputWidth = 120
|
||||
this.inputHeight = 60
|
||||
this.fontSize = 40
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换自定义颜色
|
||||
customColorChange(event) {
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.backgroundColor = '#E6E6E6'
|
||||
this.fontColor = ''
|
||||
break
|
||||
case 1:
|
||||
this.backgroundColor = '#AAAAAA'
|
||||
this.fontColor = 'tn-color-grey'
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.components-number_box {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<view class="tn-flex tn-flex-row-center"><tn-button fontColor="tn-color-white" @click="showPicker">弹出Picker</tn-button></view>
|
||||
<view class="tn-flex tn-flex-row-center"><tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @tap="showPicker">弹出Picker</tn-button></view>
|
||||
<view class="picker-result tn-border-dashed">
|
||||
{{ result }}
|
||||
</view>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-button fontColor="tn-color-white" :disabled="show" @click="showPopup">弹出弹框</tn-button>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" :disabled="show" @click="showPopup">弹出弹框</tn-button>
|
||||
</dynamic-demo-template>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -1,38 +1,68 @@
|
||||
<template>
|
||||
|
||||
<view class="components-progress">
|
||||
<view class="components-progress tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>Progress进度条</tn-nav-bar>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<block v-if="customPercent">
|
||||
<tn-line-progress v-if="mode === 'line'" :percent="percent" :height="height" :activeColor="activeColor"
|
||||
:striped="striped" :stripedAnimation="stripedAnimation" :showPercent="showPercent">
|
||||
<block v-if="customPercent">
|
||||
<view class="tn-color-white">加载中</view>
|
||||
</block>
|
||||
|
||||
<demo-title title="基本进度条">
|
||||
<tn-line-progress :percent="30"></tn-line-progress>
|
||||
<view class="tn-margin-top">
|
||||
<tn-line-progress :percent="50"></tn-line-progress>
|
||||
</view>
|
||||
<view class="tn-margin-top">
|
||||
<tn-line-progress :percent="80"></tn-line-progress>
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap tn-margin-top">
|
||||
<view>
|
||||
<tn-circle-progress :percent="30"></tn-circle-progress>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-circle-progress :percent="50"></tn-circle-progress>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-circle-progress :percent="80"></tn-circle-progress>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="修改进度条颜色">
|
||||
<tn-line-progress :percent="50" activeColor="#2DE88D"></tn-line-progress>
|
||||
<view class="tn-margin-top">
|
||||
<tn-line-progress :percent="50" activeColor="#31E749" inactiveColor="#FAD8D6"></tn-line-progress>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="显示条纹">
|
||||
<tn-line-progress :percent="50" :striped="true"></tn-line-progress>
|
||||
<view class="tn-margin-top">
|
||||
<tn-line-progress :percent="50" :striped="true" :stripedAnimation="false"></tn-line-progress>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="显示进度信息">
|
||||
<tn-line-progress :percent="50" :showPercent="true"></tn-line-progress>
|
||||
<view class="tn-margin-top">
|
||||
<tn-line-progress :percent="50">
|
||||
<view class="tn-color-white">加载中</view>
|
||||
</tn-line-progress>
|
||||
<view class="tn-flex tn-flex-row-center">
|
||||
<tn-circle-progress v-if="mode === 'circle'" :percent="percent" :showPercent="showPercent">
|
||||
<block v-if="customPercent">
|
||||
<view class="tn-color-red">加载中</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap tn-margin-top">
|
||||
<view>
|
||||
<tn-circle-progress :percent="50" :showPercent="true"></tn-circle-progress>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-circle-progress :percent="50">
|
||||
<view class="tn-color-red">加载中</view>
|
||||
</tn-circle-progress>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<tn-line-progress v-if="mode === 'line'" :percent="percent" :height="height" :activeColor="activeColor"
|
||||
:striped="striped" :stripedAnimation="stripedAnimation" :showPercent="showPercent"></tn-line-progress>
|
||||
<view class="tn-flex tn-flex-row-center">
|
||||
<tn-circle-progress v-if="mode === 'circle'" :percent="percent" :showPercent="showPercent">
|
||||
</tn-circle-progress>
|
||||
</view>
|
||||
</block>
|
||||
</dynamic-demo-template>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -41,163 +71,26 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
|
||||
export default {
|
||||
name: 'componentsStriped',
|
||||
components: {
|
||||
dynamicDemoTemplate
|
||||
},
|
||||
name: 'componentsProgress',
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
mode: 'line',
|
||||
percent: 50,
|
||||
height: 28,
|
||||
activeColor: '#01BEFF',
|
||||
showPercent: false,
|
||||
striped: false,
|
||||
stripedAnimation: true,
|
||||
customPercent: false,
|
||||
|
||||
tips: ['无需依赖额外的样式文件', '使用tn-line-progress、tn-circle-progress组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '模式',
|
||||
optional: ['线条','圆环'],
|
||||
methods: 'modeChange'
|
||||
},
|
||||
{
|
||||
title: '进度',
|
||||
optional: ['减少10%','增加10%'],
|
||||
methods: 'percentChange'
|
||||
},
|
||||
{
|
||||
title: '高度',
|
||||
optional: ['18','28','38'],
|
||||
methods: 'heightChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '激活时颜色',
|
||||
optional: ['#01BEFF','#2DE88D'],
|
||||
methods: 'activeColorChange'
|
||||
},
|
||||
{
|
||||
title: '显示条纹',
|
||||
optional: ['是','否'],
|
||||
methods: 'stripedChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '动态条纹',
|
||||
optional: ['是','否'],
|
||||
methods: 'stripedAnimationChange',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
title: '显示进度信息',
|
||||
optional: ['是','否'],
|
||||
methods: 'showPercentChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '自定义进度信息',
|
||||
optional: ['是','否'],
|
||||
methods: 'customPercentChange',
|
||||
current: 1
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换模式
|
||||
modeChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.mode = 'line'
|
||||
if (this.striped) {
|
||||
this.$refs.demoTemplate.updateSectionBtnsState([2,3,4,5], true)
|
||||
} else {
|
||||
this.$refs.demoTemplate.updateSectionBtnsState([2,3,4], true)
|
||||
}
|
||||
break
|
||||
case 1:
|
||||
this.mode = 'circle'
|
||||
this.$refs.demoTemplate.updateSectionBtnsState([2,3,4,5], false)
|
||||
break
|
||||
}
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换进度
|
||||
percentChange(event) {
|
||||
let percent = 0
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
percent = this.percent - 10
|
||||
this.percent = percent > 0 ? percent : 0
|
||||
break
|
||||
case 1:
|
||||
percent = this.percent + 10
|
||||
this.percent = percent > 100 ? 100 : percent
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换高度
|
||||
heightChange(event) {
|
||||
this.height = Number(event.name)
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换激活时颜色
|
||||
activeColorChange(event) {
|
||||
this.activeColor = event.name
|
||||
},
|
||||
// 切换进度信息显示
|
||||
showPercentChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.showPercent = true
|
||||
this.customPercent = false
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(7, false)
|
||||
} else {
|
||||
this.showPercent = false
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(7, true)
|
||||
}
|
||||
},
|
||||
// 切换条纹
|
||||
stripedChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.striped = true
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(5, true)
|
||||
} else {
|
||||
this.striped = false
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(5, false)
|
||||
}
|
||||
},
|
||||
// 切换条纹动画
|
||||
stripedAnimationChange(event) {
|
||||
this.stripedAnimation = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换自定义进度信息
|
||||
customPercentChange(event) {
|
||||
this.customPercent = event.index === 0 ? true : false
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.components-progress {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
tn-line-progress, .tn-line-progress {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
+55
-148
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-rate">
|
||||
<view class="components-rate tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>rate评分</tn-nav-bar>
|
||||
@@ -8,21 +8,43 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-rate
|
||||
v-model="value"
|
||||
:count="count"
|
||||
:disabled="disabled"
|
||||
:allowHalf="allowHalf"
|
||||
:size="size"
|
||||
:activeIcon="activeIcon"
|
||||
:inactiveIcon="inactiveIcon"
|
||||
:activeColor="activeColor"
|
||||
:inactiveColor="inactiveColor"
|
||||
:colors="colors"
|
||||
:icons="icons"
|
||||
></tn-rate>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="基本使用">
|
||||
<tn-rate v-model="value1"></tn-rate>
|
||||
<view class="tn-margin-top">
|
||||
<tn-rate v-model="value2" :count="8"></tn-rate>
|
||||
</view>
|
||||
<view class="tn-margin-top">
|
||||
<tn-rate v-model="value2" :count="8" :disabled="true"></tn-rate>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="设置尺寸">
|
||||
<tn-rate v-model="value3" :size="24"></tn-rate>
|
||||
<view class="tn-margin-top">
|
||||
<tn-rate v-model="value4"></tn-rate>
|
||||
</view>
|
||||
<view class="tn-margin-top">
|
||||
<tn-rate v-model="value5" :size="68"></tn-rate>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="可以选择半星">
|
||||
<tn-rate v-model="value6" :size="80" :allowHalf="true"></tn-rate>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义颜色">
|
||||
<tn-rate v-model="value7" inactiveColor="#E83A30" activeColor="#31E749"></tn-rate>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义图标">
|
||||
<tn-rate v-model="value8" inactiveIcon="emoji-sad" activeIcon="emoji-good-fill"></tn-rate>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="根据选择数量显示不同信息">
|
||||
<tn-rate v-model="value9" :colors="colors" :icons="icons"></tn-rate>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -31,147 +53,32 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsRate',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
value: 0,
|
||||
count: 5,
|
||||
disabled: false,
|
||||
allowHalf: false,
|
||||
size: 32,
|
||||
activeIcon: 'star-fill',
|
||||
inactiveIcon: 'star',
|
||||
activeColor: '#01BEFF',
|
||||
inactiveColor: '#AAAAAA',
|
||||
colors: [],
|
||||
icons: [],
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-rate组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '初始值',
|
||||
optional: ['0','1','2.5','3','4','5'],
|
||||
methods: 'valueChange'
|
||||
},
|
||||
{
|
||||
title: '半星状态',
|
||||
optional: ['是','否'],
|
||||
methods: 'allowHalfChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '禁用状态',
|
||||
optional: ['是','否'],
|
||||
methods: 'disabledChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '尺寸',
|
||||
optional: ['24','32','68'],
|
||||
methods: 'sizeChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '图标数量',
|
||||
optional: ['3','4','5','6'],
|
||||
methods: 'countChange',
|
||||
current: 2
|
||||
},
|
||||
{
|
||||
title: '图标',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'iconChange'
|
||||
},
|
||||
{
|
||||
title: '颜色',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'colorChange'
|
||||
},
|
||||
{
|
||||
title: '根据选择数显示图标信息',
|
||||
optional: ['是','否'],
|
||||
methods: 'showDiffChange',
|
||||
current: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
value1: 0,
|
||||
value2: 0,
|
||||
value3: 0,
|
||||
value4: 0,
|
||||
value5: 0,
|
||||
value6: 0,
|
||||
value7: 0,
|
||||
value8: 0,
|
||||
value9: 0,
|
||||
colors: ['#01BEFF','#3D7EFF','#31C9E8'],
|
||||
icons: ['star-fill','praise-fill','flower-fill']
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换初始值
|
||||
valueChange(event) {
|
||||
this.value = Number(event.name)
|
||||
},
|
||||
// 切换半星状态
|
||||
allowHalfChange(event) {
|
||||
this.allowHalf = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换禁用状态
|
||||
disabledChange(event) {
|
||||
this.disabled = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换尺寸
|
||||
sizeChange(event) {
|
||||
this.size = Number(event.name)
|
||||
},
|
||||
// 切换图标数量
|
||||
countChange(event) {
|
||||
this.count = Number(event.name)
|
||||
},
|
||||
// 切换图标
|
||||
iconChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.activeIcon = 'star-fill'
|
||||
this.inactiveIcon = 'star'
|
||||
break
|
||||
case 1:
|
||||
this.activeIcon = 'emoji-good-fill'
|
||||
this.inactiveIcon = 'emoji-good'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换颜色
|
||||
colorChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.activeColor = '#01BEFF'
|
||||
this.inactiveColor = '#AAAAAA'
|
||||
break
|
||||
case 1:
|
||||
this.activeColor = '#31E749'
|
||||
this.inactiveColor = '#E7D5FA'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换不同状态显示不同的图标信息
|
||||
showDiffChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.colors = ['#01BEFF','#3D7EFF','#31C9E8']
|
||||
this.icons = ['star-fill','praise-fill','flower-fill']
|
||||
break
|
||||
case 1:
|
||||
this.colors = []
|
||||
this.icons = []
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.components-rate {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-read-more">
|
||||
<view class="components-read-more tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>ReadMore查看更多</tn-nav-bar>
|
||||
@@ -8,22 +8,31 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" :fullWindowsScroll="fullWindowsScroll" @click="click">
|
||||
<tn-read-more
|
||||
:showHeight="showHeight"
|
||||
:closeBtn="closeBtn"
|
||||
:openText="openText"
|
||||
:closeText="closeText"
|
||||
:openIcon="openIcon"
|
||||
:closeIcon="closeIcon"
|
||||
:fontColor="fontColor"
|
||||
:fontSize="fontSize"
|
||||
:shadowStyle="shadowStyle"
|
||||
@open="open"
|
||||
@closed="closed">
|
||||
<demo-title title="基本使用">
|
||||
<tn-read-more>
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</tn-read-more>
|
||||
</dynamic-demo-template>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="允许展开后收起">
|
||||
<tn-read-more :closeBtn="true">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</tn-read-more>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="修改显示内容的高度">
|
||||
<tn-read-more :closeBtn="true" :showHeight="200">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</tn-read-more>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义展开收起文本和图标">
|
||||
<tn-read-more :closeBtn="true" openText="付费查看剩余内容" openIcon="lucky-money" closeText="下次再看" closeIcon="close">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</tn-read-more>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -32,10 +41,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsReadMore',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
content: `噫吁嚱,危乎高哉!
|
||||
@@ -62,114 +71,10 @@
|
||||
朝避猛虎,夕避长蛇,磨牙吮血,杀人如麻。
|
||||
锦城虽云乐,不如早还家。
|
||||
蜀道之难,难于上青天,侧身西望长咨嗟!`,
|
||||
showHeight: 400,
|
||||
closeBtn: false,
|
||||
openText: '展开阅读全文',
|
||||
closeText: '收起',
|
||||
openIcon: 'down',
|
||||
closeIcon: 'up',
|
||||
fontColor: '',
|
||||
fontSize: 0,
|
||||
shadowStyle: {
|
||||
backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)",
|
||||
paddingTop: "300rpx",
|
||||
marginTop: "-300rpx"
|
||||
},
|
||||
|
||||
fullWindowsScroll: false,
|
||||
tips: ['无需依赖额外的样式文件','使用tn-read-more组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '默认高度',
|
||||
optional: ['200','400', '600'],
|
||||
methods: 'showHeightChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '显示收起按钮',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'closeBtnChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
setTimeout(() => {
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
}, 100)
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换默认高度
|
||||
showHeightChange(event) {
|
||||
this.showHeight = Number(event.name)
|
||||
},
|
||||
// 切换收起按钮模式
|
||||
closeBtnChange(event) {
|
||||
this.closeBtn = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换自定义样式
|
||||
customChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.openText = '展开阅读全文'
|
||||
this.closeText = '收起'
|
||||
this.openIcon = 'down'
|
||||
this.closeIcon = 'up'
|
||||
this.fontColor = ''
|
||||
this.fontSize = 0
|
||||
this.shadowStyle = {
|
||||
backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)",
|
||||
paddingTop: "300rpx",
|
||||
marginTop: "-300rpx"
|
||||
}
|
||||
break
|
||||
case 1:
|
||||
this.openText = '付费解锁剩余内容'
|
||||
this.closeText = '折起来'
|
||||
this.openIcon = 'money'
|
||||
this.closeIcon = 'close-circle'
|
||||
this.fontSize = 30
|
||||
this.shadowStyle = {
|
||||
backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #AAA 100%)",
|
||||
paddingTop: "300rpx",
|
||||
marginTop: "-300rpx"
|
||||
}
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 展开
|
||||
open() {
|
||||
// setTimeout(() => {
|
||||
// this.$refs.demoTemplate.updateSectionScrollView()
|
||||
// }, 350)
|
||||
this.fullWindowsScroll = true
|
||||
},
|
||||
// 收起
|
||||
closed() {
|
||||
setTimeout(() => {
|
||||
this.fullWindowsScroll = false
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
}, 350)
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-toast">
|
||||
<view class="components-scroll-list tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>ScrollList横向滚动</tn-nav-bar>
|
||||
@@ -8,14 +8,8 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<tn-scroll-list
|
||||
:indicator="indicator"
|
||||
:indicatorWidth="indicatorWidth"
|
||||
:indicatorBarWidth="indicatorBarWidth"
|
||||
:indicatorColor="indicatorColor"
|
||||
:indicatorActiveColor="indicatorActiveColor"
|
||||
>
|
||||
<demo-title title="基本使用">
|
||||
<tn-scroll-list>
|
||||
<view class="tn-flex tn-margin-sm">
|
||||
<block v-for="(item, index) in 14" :key="index">
|
||||
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius">
|
||||
@@ -31,7 +25,47 @@
|
||||
</block>
|
||||
</view>
|
||||
</tn-scroll-list>
|
||||
</dynamic-demo-template>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="隐藏指示器">
|
||||
<tn-scroll-list :indicator="false">
|
||||
<view class="tn-flex tn-margin-sm">
|
||||
<block v-for="(item, index) in 14" :key="index">
|
||||
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius">
|
||||
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
|
||||
<view class="icon3__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur" :class="[$t.colorUtils.getRandomCoolBgClass(index)]">
|
||||
<view class="tn-icon-gloves-fill"></view>
|
||||
</view>
|
||||
<view class="tn-color-black tn-text-lg tn-text-center">
|
||||
<text class="tn-text-ellipsis">傻北</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</tn-scroll-list>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义指示器样式">
|
||||
<tn-scroll-list :indicatorWidth="100" :indicatorBarWidth="30" indicatorColor="#D6F4FA" indicatorActiveColor="#27A1BA">
|
||||
<view class="tn-flex tn-margin-sm">
|
||||
<block v-for="(item, index) in 14" :key="index">
|
||||
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius">
|
||||
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
|
||||
<view class="icon3__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur" :class="[$t.colorUtils.getRandomCoolBgClass(index)]">
|
||||
<view class="tn-icon-gloves-fill"></view>
|
||||
</view>
|
||||
<view class="tn-color-black tn-text-lg tn-text-center">
|
||||
<text class="tn-text-ellipsis">傻北</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</tn-scroll-list>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -40,72 +74,25 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsScrollList',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
indicator: true,
|
||||
indicatorWidth: 50,
|
||||
indicatorBarWidth: 20,
|
||||
indicatorColor: '#E6E6E6',
|
||||
indicatorActiveColor: '#01BEFF',
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-scroll-list组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '指示条',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'indicatorChange'
|
||||
},
|
||||
{
|
||||
title: '指示条样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换指示条状态
|
||||
indicatorChange(event) {
|
||||
this.indicator = event.index === 0 ? true : false
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换自定义指示条
|
||||
customChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.indicatorWidth = 50
|
||||
this.indicatorBarWidth = 20
|
||||
this.indicatorColor = '#E6E6E6'
|
||||
this.indicatorActiveColor = '#01BEFF'
|
||||
break
|
||||
case 1:
|
||||
this.indicatorWidth = 100
|
||||
this.indicatorBarWidth = 30
|
||||
this.indicatorColor = '#D6F4FA'
|
||||
this.indicatorActiveColor = '#27A1BA'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.components-scroll-list {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.icon3 {
|
||||
&__item {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<view class="tn-flex tn-flex-row-center"><tn-button fontColor="tn-color-white" @click="showSelect">弹出Select</tn-button></view>
|
||||
<view class="tn-flex tn-flex-row-center"><tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showSelect">弹出Select</tn-button></view>
|
||||
<view class="select-result tn-border-dashed">
|
||||
{{ result }}
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-slider">
|
||||
<view class="components-slider tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>slider滑动条</tn-nav-bar>
|
||||
@@ -8,43 +8,39 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<tn-slider
|
||||
v-if="useSlot"
|
||||
v-model="value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
:step="step"
|
||||
:disabled="disabled"
|
||||
:blockWidth="blockWidth"
|
||||
:blockColor="blockColor"
|
||||
:lineHeight="lineHeight"
|
||||
:activeColor="activeColor"
|
||||
:inactiveColor="inactiveColor"
|
||||
>
|
||||
<demo-title title="基本使用">
|
||||
<tn-slider v-model="value1"></tn-slider>
|
||||
<view class="tn-margin-top">
|
||||
<tn-slider v-model="value1" :disabled="true"></tn-slider>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="设置最小最大值">
|
||||
<tn-slider v-model="value2" :min="20" :max="80"></tn-slider>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="设置步进值">
|
||||
<tn-slider v-model="value3" :step="10"></tn-slider>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义滑块滑轨信息">
|
||||
<tn-slider v-model="value5" :blockWidth="40" :lineHeight="10"></tn-slider>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义颜色信息">
|
||||
<tn-slider v-model="value6" blockColor="#838383" inactiveColor="#FAD8D6" activeColor="#31E749"></tn-slider>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义滑块">
|
||||
<tn-slider v-model="value7">
|
||||
<view class="tn-slider__custom-block">
|
||||
{{ value }}
|
||||
{{ value7 }}
|
||||
</view>
|
||||
</tn-slider>
|
||||
<tn-slider
|
||||
v-else
|
||||
v-model="value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
:step="step"
|
||||
:disabled="disabled"
|
||||
:blockWidth="blockWidth"
|
||||
:blockColor="blockColor"
|
||||
:lineHeight="lineHeight"
|
||||
:activeColor="activeColor"
|
||||
:inactiveColor="inactiveColor"
|
||||
></tn-slider>
|
||||
|
||||
<view class="slider-value">
|
||||
<view class="slider-value__text">当前选值为:{{ value }}</view>
|
||||
</view>
|
||||
</dynamic-demo-template>
|
||||
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -52,137 +48,31 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsSlider',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
value: 0,
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 1,
|
||||
disabled: false,
|
||||
blockWidth: 30,
|
||||
blockColor: '#FFFFFF',
|
||||
lineHeight: 8,
|
||||
activeColor: '#01BEFF',
|
||||
inactiveColor: '#E6E6E6',
|
||||
useSlot: false,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-slider组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '最小最大值',
|
||||
optional: ['0-100','20-80'],
|
||||
methods: 'minMaxChange'
|
||||
},
|
||||
{
|
||||
title: '步进值',
|
||||
optional: ['1','10','30'],
|
||||
methods: 'stepChange'
|
||||
},
|
||||
{
|
||||
title: '禁用状态',
|
||||
optional: ['是','否'],
|
||||
methods: 'disabledChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '自定义尺寸',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customSizeChange'
|
||||
},
|
||||
{
|
||||
title: '自定义颜色',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customColorChange'
|
||||
},
|
||||
{
|
||||
title: '自定义滑块',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customSliderBlockChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
value1: 0,
|
||||
value2: 0,
|
||||
value3: 0,
|
||||
value4: 0,
|
||||
value5: 0,
|
||||
value6: 0,
|
||||
value7: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换最大最小值
|
||||
minMaxChange(event) {
|
||||
const value = event.name.split('-')
|
||||
this.min = Number(value[0])
|
||||
this.max = Number(value[1])
|
||||
},
|
||||
// 切换步进值
|
||||
stepChange(event) {
|
||||
this.step = Number(event.name)
|
||||
},
|
||||
// 切换禁用状态
|
||||
disabledChange(event) {
|
||||
this.disabled = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换尺寸
|
||||
customSizeChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.blockWidth = 30
|
||||
this.lineHeight = 8
|
||||
break
|
||||
case 1:
|
||||
this.blockWidth = 50
|
||||
this.lineHeight = 12
|
||||
break
|
||||
}
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换颜色
|
||||
customColorChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.activeColor = '#01BEFF'
|
||||
this.inactiveColor = '#E6E6E6'
|
||||
break
|
||||
case 1:
|
||||
this.activeColor = '#2DE88D'
|
||||
this.inactiveColor = '#AAAAAA'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换滑块
|
||||
customSliderBlockChange(event) {
|
||||
this.useSlot = event.index === 0 ? false : true
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.slider-value {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 30rpx;
|
||||
|
||||
&__text {
|
||||
width: 260rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
background-color: $tn-font-holder-color;
|
||||
}
|
||||
.components-slider {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.tn-slider__custom-block {
|
||||
@@ -190,7 +80,7 @@
|
||||
width: auto;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
padding: 0 5rpx;
|
||||
padding: 0 10rpx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
|
||||
+64
-101
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-steps">
|
||||
<view class="components-steps tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>Steps步骤条</tn-nav-bar>
|
||||
@@ -8,9 +8,46 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<tn-steps :list="list" :current="current" :mode="mode" :direction="direction" :showTitle="showTitle" :activeColor="activeColor" :inActiveColor="inActiveColor"></tn-steps>
|
||||
</dynamic-demo-template>
|
||||
<view class="operate_btn">
|
||||
<view>
|
||||
<tn-button backgroundColor="tn-bg-indigo" fontColor="tn-color-white" @click="prevStep">上一步</tn-button>
|
||||
</view>
|
||||
<view>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="nextStep">下一步</tn-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tn-padding-top-lg"></view>
|
||||
|
||||
<demo-title title="点模式">
|
||||
<tn-steps :list="list" :current="current" @click="stepItemClick"></tn-steps>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="数值模式">
|
||||
<tn-steps :list="list" :current="current" mode="number" @click="stepItemClick"></tn-steps>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="图标模式">
|
||||
<tn-steps :list="list" :current="current" mode="icon" @click="stepItemClick"></tn-steps>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="点图标模式">
|
||||
<tn-steps :list="list" :current="current" mode="dotIcon" @click="stepItemClick"></tn-steps>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="隐藏标题">
|
||||
<tn-steps :list="list" :current="current" mode="icon" :showTitle="false" @click="stepItemClick"></tn-steps>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义颜色">
|
||||
<tn-steps :list="list" :current="current" mode="icon" activeColor="#24F083" inActiveColor="#E6E6E6" @click="stepItemClick"></tn-steps>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="垂直显示">
|
||||
<tn-steps :list="list" :current="current" direction="column" @click="stepItemClick"></tn-steps>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -19,10 +56,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsSteps',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
@@ -31,112 +68,38 @@
|
||||
{name: '第三步', icon: 'safe', selectIcon: 'safe-fill'},
|
||||
{name: '第四步', icon: 'vip', selectIcon: 'vip-fill'}
|
||||
],
|
||||
current: 0,
|
||||
mode: 'dot',
|
||||
direction: 'row',
|
||||
showTitle: true,
|
||||
activeColor: '#01BEFF',
|
||||
inActiveColor: '#AAAAAA',
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-steps组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '步骤',
|
||||
optional: ['上一步','下一步'],
|
||||
methods: 'currentChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '模式',
|
||||
optional: ['点模式','数值模式','图标模式','点图标模式'],
|
||||
methods: 'modeChange'
|
||||
},
|
||||
{
|
||||
title: '方向',
|
||||
optional: ['横向','竖直'],
|
||||
methods: 'directionChange'
|
||||
},
|
||||
{
|
||||
title: '显示标题',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'showTitleChange'
|
||||
},
|
||||
{
|
||||
title: '自定义颜色',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'colorChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
current: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换步骤
|
||||
currentChange(event) {
|
||||
prevStep() {
|
||||
let current = this.current
|
||||
if (event.index === 0) {
|
||||
current--
|
||||
this.current = current < 0 ? 0 : current
|
||||
} else {
|
||||
current++
|
||||
this.current = current > this.list.length ? this.list.length : current
|
||||
}
|
||||
current--
|
||||
this.current = current < 0 ? 0 : current
|
||||
},
|
||||
// 切换模式
|
||||
modeChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.mode = 'dot'
|
||||
break
|
||||
case 1:
|
||||
this.mode = 'number'
|
||||
break
|
||||
case 2:
|
||||
this.mode = 'icon'
|
||||
break
|
||||
case 3:
|
||||
this.mode = 'dotIcon'
|
||||
break
|
||||
}
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
nextStep() {
|
||||
let current = this.current
|
||||
current++
|
||||
this.current = current > this.list.length ? this.list.length : current
|
||||
},
|
||||
// 切换方向
|
||||
directionChange(event) {
|
||||
this.direction = event.index === 0 ? 'row' : 'column'
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换标题情况
|
||||
showTitleChange(event) {
|
||||
this.showTitle = event.index === 0 ? true : false
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
},
|
||||
// 切换颜色样式
|
||||
colorChange(event) {
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.activeColor = '#01BEFF'
|
||||
this.inActiveColor = '#AAAAAA'
|
||||
break
|
||||
case 1:
|
||||
this.activeColor = '#24F083'
|
||||
this.inActiveColor = '#E6E6E6'
|
||||
break
|
||||
}
|
||||
stepItemClick(e) {
|
||||
this.current = e.index
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.operate_btn {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
padding: 0 30rpx;
|
||||
margin: 30rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
z-index: 1000;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-sticky" style="height: 200vh;">
|
||||
<view class="components-sticky tn-safe-area-inset-bottom" style="height: 200vh;">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>sticky吸顶</tn-nav-bar>
|
||||
@@ -8,11 +8,24 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" :fullWindowsScroll="true" @click="click">
|
||||
<tn-sticky :offsetTop="offsetTop" :enabled="enabled" :customNavHeight="vuex_custom_bar_height" @fixed="fixed" @unfixed="unfixed">
|
||||
<view class="sticky-content">图鸟科技</view>
|
||||
<demo-title title="吸顶">
|
||||
<tn-sticky :offsetTop="0" :customNavHeight="vuex_custom_bar_height">
|
||||
<view class="sticky-content tn-bg-orangered tn-color-white">普通吸顶</view>
|
||||
</tn-sticky>
|
||||
</dynamic-demo-template>
|
||||
<view style="margin-top: 200rpx;">
|
||||
<tn-sticky :offsetTop="100" :customNavHeight="vuex_custom_bar_height">
|
||||
<view class="sticky-content tn-bg-indigo tn-color-white">有距离吸顶</view>
|
||||
</tn-sticky>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="取消吸顶">
|
||||
<tn-sticky :offsetTop="0" :enabled="false" :customNavHeight="vuex_custom_bar_height">
|
||||
<view class="sticky-content tn-bg-red tn-color-white">不允许吸顶</view>
|
||||
</tn-sticky>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -21,69 +34,34 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsSticky',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
offsetTop: 0,
|
||||
enabled: true,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-sticky组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '吸顶距离',
|
||||
optional: ['0','20','100'],
|
||||
methods: 'offsetTopChange'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
optional: ['允许吸顶', '不吸顶'],
|
||||
methods: 'enabledChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换吸顶距离
|
||||
offsetTopChange(event) {
|
||||
this.offsetTop = Number(event.name)
|
||||
},
|
||||
// 切换吸顶状态
|
||||
enabledChange(event) {
|
||||
this.enabled = event.index === 0 ? true: false
|
||||
},
|
||||
|
||||
// 监听是否吸顶
|
||||
fixed() {
|
||||
this.$t.messageUtils.toast('触发吸顶')
|
||||
},
|
||||
unfixed() {
|
||||
this.$t.messageUtils.toast('取消吸顶')
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.components-sticky {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.sticky-content {
|
||||
height: 80rpx;
|
||||
padding: 0 80rpx;
|
||||
margin: 0 10rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background-color: $tn-main-color;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,126 +1,134 @@
|
||||
<template>
|
||||
|
||||
<view class="components-index-list">
|
||||
<view class="components-swipe-action tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>swipeAction滑动菜单</tn-nav-bar>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item :options="options1">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
基本使用
|
||||
|
||||
<demo-title title="基本使用">
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item :options="options1">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
基本使用
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
|
||||
<view class="tn-padding-bottom"></view>
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item :options="options2">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
多菜单
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="多菜单">
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item :options="options2">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
多菜单
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
|
||||
<view class="tn-padding-bottom"></view>
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item :options="options3">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
带图标菜单
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="带图标菜单">
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item :options="options3">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
带图标菜单
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
|
||||
<view class="tn-padding-bottom"></view>
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item :options="options4">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
单图标菜单
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="单图标菜单">
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item :options="options4">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
单图标菜单
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
|
||||
<view class="tn-padding-bottom"></view>
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item v-for="(item,index) in 2" :key="index" :name="index" :options="options2">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
关联打开滑动菜单
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="关联打开滑动菜单">
|
||||
<tn-swipe-action>
|
||||
<tn-swipe-action-item v-for="(item,index) in 2" :key="index" :name="index" :options="options2">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到,同时只能打开一个菜单
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
关联打开滑动菜单
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到,同时只能打开一个菜单
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
|
||||
<view class="tn-padding-bottom"></view>
|
||||
<tn-swipe-action :autoClose="false">
|
||||
<tn-swipe-action-item v-for="(item,index) in 2" :key="index" :name="index" :options="options2">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
非关联打开滑动菜单
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="非关联打开滑动菜单">
|
||||
<tn-swipe-action :autoClose="false">
|
||||
<tn-swipe-action-item v-for="(item,index) in 2" :key="index" :name="index" :options="options2">
|
||||
<view class="swipe-action__item tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-left">
|
||||
<view class="swipe-action__item__image">
|
||||
<image src="https://tnuiimage.tnkjapp.com/shop/card.jpg" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到,允许同时打开多个菜单
|
||||
<view class="swipe-action__item__info tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-right">
|
||||
<view class="swipe-action__item__info__title">
|
||||
非关联打开滑动菜单
|
||||
</view>
|
||||
<view class="swipe-action__item__info__desc">
|
||||
向左滑动即可看到,允许同时打开多个菜单
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
|
||||
</tn-swipe-action-item>
|
||||
</tn-swipe-action>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -128,8 +136,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsSwipeAction',
|
||||
components: { demoTitle },
|
||||
data() {
|
||||
return {
|
||||
// 滑动菜单
|
||||
@@ -192,7 +202,6 @@
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-swiper">
|
||||
<view class="components-swiper tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>Swiper轮播图</tn-nav-bar>
|
||||
@@ -8,214 +8,63 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<tn-swiper
|
||||
:list="list"
|
||||
:height="height"
|
||||
:backgroundColor="backgroundColor"
|
||||
:title="title"
|
||||
:titleStyle="titleStyle"
|
||||
:radius="radius"
|
||||
:mode="mode"
|
||||
:indicatorPosition="indicatorPosition"
|
||||
:effect3d="effect3d"
|
||||
:effect3dPreviousSpacing="effect3dPreviousSpacing"
|
||||
:interval="interval"
|
||||
:duration="duration"
|
||||
:circular="circular"
|
||||
></tn-swiper>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="圆角方形">
|
||||
<tn-swiper :list="list"></tn-swiper>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="方形">
|
||||
<tn-swiper :list="list" mode="rect"></tn-swiper>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="点">
|
||||
<tn-swiper :list="list" mode="dot"></tn-swiper>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="数值">
|
||||
<tn-swiper :list="list" mode="number"></tn-swiper>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="隐藏指示器">
|
||||
<tn-swiper :list="list" mode=""></tn-swiper>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="轮播标题">
|
||||
<tn-swiper :list="list" :title="true" mode=""></tn-swiper>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="指示器设置在右上角">
|
||||
<tn-swiper :list="list" indicatorPosition="topRight"></tn-swiper>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="3D切换效果">
|
||||
<tn-swiper :list="list" :effect3d="true"></tn-swiper>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- Toast -->
|
||||
<tn-toast
|
||||
ref="toast"
|
||||
@closed="closedToast"
|
||||
></tn-toast>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsSwiper',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{image: 'https://tnuiimage.tnkjapp.com/swiper/spring.jpg', title: '春天'},
|
||||
{image: 'https://tnuiimage.tnkjapp.com/swiper/summer.jpg', title: '夏天'},
|
||||
{image: 'https://tnuiimage.tnkjapp.com/swiper/autumn.jpg', title: '秋天'}
|
||||
],
|
||||
height: 250,
|
||||
backgroundColor: '',
|
||||
title: false,
|
||||
titleStyle: {},
|
||||
radius: 8,
|
||||
mode: 'round',
|
||||
indicatorPosition: 'bottomCenter',
|
||||
effect3d: false,
|
||||
effect3dPreviousSpacing: 50,
|
||||
interval: 3000,
|
||||
duration: 500,
|
||||
circular: true,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-swiper组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '指示器模式',
|
||||
optional: ['方形','圆角方形','点','数值','隐藏'],
|
||||
methods: 'modeChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '指示器位置',
|
||||
optional: ['左上','中上','右上','左下','中下','右下'],
|
||||
methods: 'indicatorPositionChange',
|
||||
current: 4
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'titleChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'styleChange'
|
||||
},
|
||||
{
|
||||
title: '3d切换效果',
|
||||
optional: ['开启','关闭'],
|
||||
methods: 'effect3dChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '切换时间',
|
||||
optional: ['默认','5000'],
|
||||
methods: 'intervalChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
{image: 'https://tnuiimage.tnkjapp.com/swiper/autumn.jpg', title: '秋天'},
|
||||
{image: 'https://tnuiimage.tnkjapp.com/swiper/winter.jpg', title: '冬天'},
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换指示器模式
|
||||
modeChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.mode = 'rect'
|
||||
break
|
||||
case 1:
|
||||
this.mode = 'round'
|
||||
break
|
||||
case 2:
|
||||
this.mode = 'dot'
|
||||
break
|
||||
case 3:
|
||||
this.mode = 'number'
|
||||
break
|
||||
case 4:
|
||||
this.mode = ''
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换指示器位置
|
||||
indicatorPositionChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.indicatorPosition = 'topLeft'
|
||||
break
|
||||
case 1:
|
||||
this.indicatorPosition = 'topCenter'
|
||||
break
|
||||
case 2:
|
||||
this.indicatorPosition = 'topRight'
|
||||
break
|
||||
case 3:
|
||||
this.indicatorPosition = 'bottomLeft'
|
||||
break
|
||||
case 4:
|
||||
this.indicatorPosition = 'bottomCenter'
|
||||
break
|
||||
case 5:
|
||||
this.indicatorPosition = 'bottomRight'
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换标题
|
||||
titleChange(event) {
|
||||
this.title = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换自定义样式
|
||||
styleChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.height = 250
|
||||
this.backgroundColor = ''
|
||||
this.titleStyle = {}
|
||||
this.radius = 8
|
||||
this.effect3dPreviousSpacing = 50
|
||||
break
|
||||
case 1:
|
||||
this.height = 300
|
||||
this.backgroundColor = '#E6E6E6'
|
||||
this.titleStyle = {
|
||||
color: '#FFFFFF'
|
||||
}
|
||||
this.radius = 12
|
||||
this.effect3dPreviousSpacing = 100
|
||||
break
|
||||
}
|
||||
},
|
||||
// 切换3d效果
|
||||
effect3dChange(event) {
|
||||
this.effect3d = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换切换时间
|
||||
intervalChange(event) {
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.interval = 3000
|
||||
this.duration = 500
|
||||
break
|
||||
case 1:
|
||||
this.interval = 5000
|
||||
this.duration = 800
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 打开Toast
|
||||
openToast() {
|
||||
this.$refs.toast.show({
|
||||
title: this.title,
|
||||
content: this.content,
|
||||
icon: this.icon,
|
||||
image: this.image,
|
||||
duration: this.duration
|
||||
})
|
||||
},
|
||||
// 关闭Toast
|
||||
closedToast() {
|
||||
this.$t.messageUtils.toast('Toast关闭')
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-switch">
|
||||
<view class="components-switch tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>Switch开光</tn-nav-bar>
|
||||
@@ -8,18 +8,57 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-switch
|
||||
v-model="value"
|
||||
:shape="shape"
|
||||
:size="size"
|
||||
:activeColor="color"
|
||||
:disabled="disabled"
|
||||
:loading="loading"
|
||||
:leftIcon="leftIcon"
|
||||
:rightIcon="rightIcon"
|
||||
></tn-switch>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="普通切换按钮">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-switch v-model="value1"></tn-switch>
|
||||
</view>
|
||||
<view class="tn-margin">
|
||||
<tn-switch v-model="value2" shape="square"></tn-switch>
|
||||
</view>
|
||||
<view class="tn-margin">
|
||||
<tn-switch v-model="value2" shape="square" :disabled="true"></tn-switch>
|
||||
</view>
|
||||
<view class="tn-margin">
|
||||
<tn-switch v-model="value2" shape="square" :loading="value2"></tn-switch>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="按钮颜色">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-switch v-model="value3" activeColor="#A4E82F"></tn-switch>
|
||||
</view>
|
||||
<view class="tn-margin">
|
||||
<tn-switch v-model="value4" activeColor="#FFA4A4"></tn-switch>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="按钮尺寸">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-switch v-model="value5" :size="30"></tn-switch>
|
||||
</view>
|
||||
<view class="tn-margin">
|
||||
<tn-switch v-model="value6"></tn-switch>
|
||||
</view>
|
||||
<view class="tn-margin">
|
||||
<tn-switch v-model="value7" :size="60"></tn-switch>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="按钮内嵌图标">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-switch v-model="value8" leftIcon="sex-female" rightIcon="sex-male"></tn-switch>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -28,104 +67,30 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsSwitch',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
value: false,
|
||||
shape: 'circle',
|
||||
color: '',
|
||||
size: 50,
|
||||
disabled: false,
|
||||
loading: false,
|
||||
leftIcon: '',
|
||||
rightIcon: '',
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-switch组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '形状',
|
||||
optional: ['圆角','方角'],
|
||||
methods: 'shapeChange'
|
||||
},
|
||||
{
|
||||
title: '禁用',
|
||||
optional: ['是','否'],
|
||||
methods: 'disabledChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '颜色',
|
||||
optional: ['默认','#A4E82F','#FFA4A4'],
|
||||
methods: 'colorChange'
|
||||
},
|
||||
{
|
||||
title: '尺寸',
|
||||
optional: ['40','50','80'],
|
||||
methods: 'sizeChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '加载中',
|
||||
optional: ['是','否'],
|
||||
methods: 'loadingChange',
|
||||
current: 1
|
||||
},
|
||||
{
|
||||
title: '显示图标',
|
||||
optional: ['是','否'],
|
||||
methods: 'iconChange',
|
||||
current: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
value1: false,
|
||||
value2: false,
|
||||
value3: false,
|
||||
value4: false,
|
||||
value5: false,
|
||||
value6: false,
|
||||
value7: false,
|
||||
value8: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换形状
|
||||
shapeChange(event) {
|
||||
this.shape = event.index === 0 ? 'circle' : 'square'
|
||||
},
|
||||
// 切换禁用状态
|
||||
disabledChange(event) {
|
||||
this.disabled = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换颜色
|
||||
colorChange(event) {
|
||||
this.color = event.index === 0 ? '' : event.name
|
||||
},
|
||||
// 切换尺寸
|
||||
sizeChange(event) {
|
||||
this.size = Number(event.name)
|
||||
},
|
||||
// 切换加载状态
|
||||
loadingChange(event) {
|
||||
this.loading = event.index === 0 ? true : false
|
||||
},
|
||||
// 切换图标状态
|
||||
iconChange(event) {
|
||||
if (event.index === 0) {
|
||||
this.leftIcon = 'sex-female'
|
||||
this.rightIcon = 'sex-male'
|
||||
} else if (event.index === 1) {
|
||||
this.leftIcon = ''
|
||||
this.rightIcon = ''
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.components-switch {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
+49
-206
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-tabs">
|
||||
<view class="components-tabs tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>tabs标签</tn-nav-bar>
|
||||
@@ -8,26 +8,34 @@
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
|
||||
<tn-tabs
|
||||
v-if="show"
|
||||
:list="list"
|
||||
:current="current"
|
||||
:isScroll="isScroll"
|
||||
:height="height"
|
||||
:itemWidth="itemWidth"
|
||||
:activeColor="activeColor"
|
||||
:inactiveColor="inactiveColor"
|
||||
:activeItemStyle="activeItemStyle"
|
||||
:showBar="showBar"
|
||||
:barWidth="barWidth"
|
||||
:barHeight="barHeight"
|
||||
:barStyle="barStyle"
|
||||
:gutter="gutter"
|
||||
:badgeOffset="badgeOffset"
|
||||
@change="tabChange"
|
||||
></tn-tabs>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="默认" :contentPadding="false">
|
||||
<tn-tabs :list="scrollList" :current="current" @change="tabChange"></tn-tabs>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="隐藏底部滑块" :contentPadding="false">
|
||||
<tn-tabs :list="scrollList" :current="current" :showBar="false" @change="tabChange"></tn-tabs>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="修改背景颜色" :contentPadding="false">
|
||||
<tn-tabs :list="scrollList" :current="current" backgroundColor="#FFFFFF" @change="tabChange"></tn-tabs>
|
||||
<view class="tn-margin-top">
|
||||
<tn-tabs :list="scrollList" :current="current" backgroundColor="tn-main-gradient-indigo" activeColor="#FFFFFF" @change="tabChange"></tn-tabs>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义标签宽高" :contentPadding="false">
|
||||
<tn-tabs :list="scrollList" :current="current" :height="120" :itemWidth="200" :barWidth="140" @change="tabChange"></tn-tabs>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义标签、滑块" :contentPadding="false">
|
||||
<tn-tabs :list="scrollList" :current="current" backgroundColor="#FFFFFF" :activeItemStyle="activeItemStyle" :barStyle="barStyle" @change="tabChange"></tn-tabs>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="固定选项标签" :contentPadding="false">
|
||||
<tn-tabs :list="fixedList" :current="current" :isScroll="false" :badgeOffset="[20, 50]" @change="tabChange"></tn-tabs>
|
||||
</demo-title>
|
||||
|
||||
<view class="tn-padding-bottom-lg"></view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -36,14 +44,20 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
|
||||
import demoTitle from '@/libs/components/demo-title.vue'
|
||||
export default {
|
||||
name: 'componentsTabs',
|
||||
components: {dynamicDemoTemplate},
|
||||
components: {demoTitle},
|
||||
data() {
|
||||
return {
|
||||
show: true,
|
||||
data: [
|
||||
current: 0,
|
||||
activeItemStyle: {
|
||||
borderTop: '1rpx solid #E6E6E6'
|
||||
},
|
||||
barStyle: {
|
||||
boxShadow: `12rpx 12rpx 16rpx #01BEFF`
|
||||
},
|
||||
scrollList: [
|
||||
{name: '关注', count: 10},
|
||||
{name: '推荐'},
|
||||
{name: '热榜', count: '99+'},
|
||||
@@ -54,198 +68,27 @@
|
||||
{name: '电影'},
|
||||
{name: '游戏'}
|
||||
],
|
||||
list: [],
|
||||
current: 0,
|
||||
isScroll: true,
|
||||
height: 80,
|
||||
itemWidth: 'auto',
|
||||
activeColor: '#01BEFF',
|
||||
inactiveColor: '#080808',
|
||||
activeItemStyle: {},
|
||||
showBar: true,
|
||||
barWidth: 40,
|
||||
barHeight: 6,
|
||||
barStyle: {},
|
||||
gutter: 30,
|
||||
badgeOffset: [20, 22],
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-tabs组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '模式选择',
|
||||
optional: ['滑动','非滑动'],
|
||||
methods: 'modeChange'
|
||||
},
|
||||
{
|
||||
title: '标签数量',
|
||||
optional: ['2','3','4','5'],
|
||||
methods: 'countChange',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
title: '显示底部滑块',
|
||||
optional: ['显示','隐藏'],
|
||||
methods: 'showBarChange'
|
||||
},
|
||||
{
|
||||
title: '自定义宽高',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customWidthHeightChange'
|
||||
},
|
||||
{
|
||||
title: '自定义颜色',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customColorChange'
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customStyleChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
fixedList: [
|
||||
{name: '关注', count: 10},
|
||||
{name: '推荐'},
|
||||
{name: '热榜', count: '99+'},
|
||||
{name: '搞笑'}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.list = this.data
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换模式
|
||||
modeChange(event) {
|
||||
this.show = false
|
||||
this.current = 0
|
||||
this.isScroll = event.index === 0 ? true : false
|
||||
|
||||
if (event.index === 0) {
|
||||
this.list = this.data
|
||||
this.badgeOffset = [20, 22]
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(1, false)
|
||||
} else if (event.index === 1) {
|
||||
this.$refs.demoTemplate.updateSectionBtnsState(1, true)
|
||||
this.$refs.demoTemplate.updateSectionBtnsValue(0, 1, 0)
|
||||
this.countChange({index: 0, name: 2})
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
})
|
||||
},
|
||||
// 切换标签数量
|
||||
countChange(event) {
|
||||
this.show = false
|
||||
this.list = this.data.slice(0, Number(event.name))
|
||||
switch (event.index) {
|
||||
case 0:
|
||||
this.badgeOffset = [20, 120]
|
||||
break
|
||||
case 1:
|
||||
this.badgeOffset = [20, 70]
|
||||
break
|
||||
case 2:
|
||||
this.badgeOffset = [20, 50]
|
||||
break
|
||||
case 3:
|
||||
this.badgeOffset = [20, 22]
|
||||
break
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
})
|
||||
},
|
||||
// 切换底部滑块显示
|
||||
showBarChange(event) {
|
||||
this.show = false
|
||||
this.showBar = event.index === 0 ? true : false
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
})
|
||||
},
|
||||
// 切换自定义宽高
|
||||
customWidthHeightChange(event) {
|
||||
this.show = false
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.height = 80
|
||||
this.itemWidth = 'auto'
|
||||
this.barWidth = 40
|
||||
this.barHeight = 6
|
||||
this.gutter = 30
|
||||
break
|
||||
case 1:
|
||||
this.height = 100
|
||||
this.itemWidth = '40%'
|
||||
this.barWidth = 130
|
||||
this.barHeight = 4
|
||||
this.gutter = 10
|
||||
break
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
this.$refs.demoTemplate.updateSectionScrollView()
|
||||
})
|
||||
},
|
||||
// 切换颜色
|
||||
customColorChange(event) {
|
||||
this.show = false
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.activeColor = '#01BEFF'
|
||||
this.inactiveColor = '#080808'
|
||||
break
|
||||
case 1:
|
||||
this.activeColor = '#31E749'
|
||||
this.inactiveColor = '#AAAAAA'
|
||||
break
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
})
|
||||
},
|
||||
// 切换自定义样式
|
||||
customStyleChange(event) {
|
||||
this.show = false
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.activeItemStyle = {}
|
||||
this.barStyle = {}
|
||||
break
|
||||
case 1:
|
||||
this.activeItemStyle = {
|
||||
borderTop: '1rpx solid #E6E6E6'
|
||||
}
|
||||
this.barStyle = {
|
||||
boxShadow: `6rpx 6rpx 8rpx ${this.activeColor}`
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// tab选项卡切换
|
||||
tabChange(index) {
|
||||
this.current = index
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.components-tabs {
|
||||
background-color: $tn-bg-gray-color;
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-button fontColor="tn-color-white" @click="showTips">弹出Tips</tn-button>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showTips">弹出Tips</tn-button>
|
||||
</dynamic-demo-template>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
|
||||
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
|
||||
<tn-button fontColor="tn-color-white" @click="showToast">弹出Toast</tn-button>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showToast">弹出Toast</tn-button>
|
||||
</dynamic-demo-template>
|
||||
|
||||
</view>
|
||||
@@ -102,7 +102,7 @@
|
||||
break
|
||||
case 2:
|
||||
this.icon = ''
|
||||
this.image = '/static/logo1.png'
|
||||
this.image = '/static/favicon.ico'
|
||||
break
|
||||
}
|
||||
this.openToast()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<tn-form-item label="验证码">
|
||||
<tn-input></tn-input>
|
||||
<view slot="right">
|
||||
<tn-button fontColor="tn-color-white" @click="getCode">{{ tips }}</tn-button>
|
||||
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" size="sm" @click="getCode">{{ tips }}</tn-button>
|
||||
</view>
|
||||
</tn-form-item>
|
||||
</tn-form>
|
||||
|
||||
Reference in New Issue
Block a user