This commit is contained in:
7small7
2023-07-08 20:44:19 +08:00
parent f5718ab30b
commit f710c14879
283 changed files with 68347 additions and 0 deletions
Vendored
BIN
View File
Binary file not shown.
+91
View File
@@ -0,0 +1,91 @@
<script>
import Vue from 'vue'
import store from './store/index.js'
import updateCustomBarInfo from './tuniao-ui/libs/function/updateCustomBarInfo.js'
export default {
onLaunch: function() {
uni.getSystemInfo({
success: function(e) {
// #ifndef H5
// 获取手机系统版本
const system = e.system.toLowerCase()
const platform = e.platform.toLowerCase()
// 判断是否为ios设备
if (platform.indexOf('ios') != -1 && (system.indexOf('ios') != -1 || system.indexOf('macos') != -1)) {
Vue.prototype.SystemPlatform = 'apple'
} else if (platform.indexOf('android') != -1 && (system.indexOf('android') != -1)) {
Vue.prototype.SystemPlatform = 'android'
} else {
Vue.prototype.SystemPlatform = 'devtools'
}
// #endif
}
})
// 获取设备的状态栏信息和自定义顶栏信息
// store.dispatch('updateCustomBarInfo')
updateCustomBarInfo().then((res) => {
store.commit('$tStore', {
name: 'vuex_status_bar_height',
value: res.statusBarHeight
})
store.commit('$tStore', {
name: 'vuex_custom_bar_height',
value: res.customBarHeight
})
})
// #ifdef MP-WEIXIN
//更新检测
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager();
updateManager && updateManager.onCheckForUpdate((res) => {
if (res.hasUpdate) {
updateManager.onUpdateReady(() => {
uni.showModal({
title: '更新提示',
content: '新版本已经准备就绪,是否需要重新启动应用?',
success: (res) => {
if (res.confirm) {
uni.clearStorageSync() // 更新完成后刷新storage的数据
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(() => {
uni.showModal({
title: '已有新版本上线',
content: '小程序自动更新失败,请删除该小程序后重新搜索打开哟~~~',
showCancel: false
})
})
} else {
//没有更新
}
})
} else {
uni.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请更新到最新的微信后再重试。',
showCancel: false
})
}
// #endif
},
onShow: function() {
// console.log('App Show')
},
onHide: function() {
// console.log('App Hide')
}
}
</script>
<style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import './tuniao-ui/index.scss';
@import './tuniao-ui/iconfont.css';
</style>
+145
View File
@@ -0,0 +1,145 @@
<template>
<view class="basic-avatar tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>头像</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基础">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<view class="tn-margin-sm">
<tn-avatar></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar backgroundColor="#FFFFFF"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar icon="link" backgroundColor="#FFFFFF"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar text="TN" backgroundColor="#FFFFFF"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar :shadow="true" :src="src"></tn-avatar>
</view>
</view>
</demo-title>
<demo-title title="大小">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<view class="tn-margin-sm">
<tn-avatar size="sm" :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar size="lg" :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar size="xl" :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar size="160rpx" :src="src"></tn-avatar>
</view>
</view>
</demo-title>
<demo-title title="形状">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<view class="tn-margin-sm">
<tn-avatar shape="circle" :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar shape="square" :src="src"></tn-avatar>
</view>
</view>
</demo-title>
<demo-title title="边框">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<view class="tn-margin-sm">
<tn-avatar :border="true" :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar :border="true" borderColor="#01BEFF" :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar :border="true" borderColor="#01BEFF" :borderSize="4" :src="src"></tn-avatar>
</view>
</view>
</demo-title>
<demo-title title="角标">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<view class="tn-margin-sm">
<tn-avatar :badge="true" badgeText="99+" :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar :badge="true" badgeIcon="vip" :src="src"></tn-avatar>
</view>
<view class="tn-margin-sm">
<tn-avatar :badge="true" badgeIcon="vip" badgeBgColor="transparent" badgeColor="tn-color-orange" :badgeSize="40" :badgePosition="[-8, 18]" :src="src"></tn-avatar>
</view>
</view>
</demo-title>
<demo-title title="头像组">
<view class="tn-margin-sm">
<tn-avatar-group :lists="groupList"></tn-avatar-group>
</view>
<view class="tn-margin-sm">
<tn-avatar-group :lists="groupList" shape="shape"></tn-avatar-group>
</view>
<view class="tn-margin-sm">
<tn-avatar-group :lists="groupList" size="lg"></tn-avatar-group>
</view>
<view class="tn-margin-sm">
<tn-avatar-group :lists="groupList" size="lg" :gap="0.5"></tn-avatar-group>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicAvatar',
components: {demoTitle},
data() {
return {
src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai4.jpg',
groupList: [
{src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg'},
{src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai2.jpg'},
{text: 'TN'},
{icon: 'logo-tuniao'},
{src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg'},
{src: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai2.jpg'},
]
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.basic-avatar {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
</style>
+105
View File
@@ -0,0 +1,105 @@
<template>
<view class="basic-badge tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>微标</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基础">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<tn-badge :dot="true" margin="10rpx 10rpx"><text>0</text></tn-badge>
<tn-badge margin="10rpx 10rpx"><text>0</text></tn-badge>
<tn-badge margin="10rpx 10rpx"><text>99</text></tn-badge>
<tn-badge margin="10rpx 10rpx"><text>99+</text></tn-badge>
</view>
</demo-title>
<demo-title title="大小">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<tn-badge :dot="true" :radius="30" margin="10rpx 10rpx"><text>0</text></tn-badge>
<tn-badge :radius="40" margin="10rpx 10rpx"><text>0</text></tn-badge>
<tn-badge :radius="60" :fontSize="30" margin="10rpx 10rpx"><text>99</text></tn-badge>
<tn-badge :fontSize="30" padding="10rpx 30rpx" margin="10rpx 10rpx"><text>99+</text></tn-badge>
</view>
</demo-title>
<demo-title title="颜色">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<tn-badge backgroundColor="#01BEFF" :dot="true" :radius="30" margin="10rpx 10rpx"><text>0</text></tn-badge>
<tn-badge backgroundColor="rgba(1, 190, 255, 0.8)" fontColor="#FFFFFF" :radius="40" margin="10rpx 10rpx"><text>0</text></tn-badge>
<tn-badge backgroundColor="tn-bg-teal" fontColor="tn-color-white" :radius="40" margin="10rpx 10rpx"><text>0</text></tn-badge>
<tn-badge backgroundColor="tn-cool-bg-color-7" fontColor="tn-color-white" :radius="40" margin="10rpx 10rpx"><text>0</text></tn-badge>
<tn-badge backgroundColor="tn-main-gradient-indigo" :radius="40" margin="10rpx 10rpx"><text>0</text></tn-badge>
</view>
</demo-title>
<demo-title title="微标使用">
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap">
<view class="badge-demo">
<tn-badge backgroundColor="#01BEFF" fontColor="#FFFFFF" :absolute="true" >
<text>99+</text>
</tn-badge>
</view>
<view class="badge-demo">
<tn-badge backgroundColor="#01BEFF" fontColor="#FFFFFF" :absolute="true" :translateCenter="false">
<text>99+</text>
</tn-badge>
</view>
<view class="badge-demo">
<tn-badge backgroundColor="#01BEFF" fontColor="#FFFFFF" :absolute="true" top="-18rpx" right="20rpx">
<text>99+</text>
</tn-badge>
</view>
</view>
<view class="tn-flex tn-flex-col-center tn-flex-row-left tn-flex-wrap tn-margin-top">
<view class="badge-demo">
<tn-badge backgroundColor="#01BEFF" fontColor="#FFFFFF" :dot="true" :radius="30" :absolute="true" ></tn-badge>
</view>
<view class="badge-demo">
<tn-badge backgroundColor="#01BEFF" fontColor="#FFFFFF" :dot="true" :radius="30" :absolute="true" :translateCenter="false"></tn-badge>
</view>
<view class="badge-demo">
<tn-badge backgroundColor="#01BEFF" fontColor="#FFFFFF" :dot="true" :radius="30" :absolute="true" top="-18rpx" right="20rpx"></tn-badge>
</view>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicBadge',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.basic-badge {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
.badge-demo {
position: relative;
width: 160rpx;
height: 160rpx;
background-color: #FFFFFF;
margin: 18rpx 20rpx;
}
</style>
+141
View File
@@ -0,0 +1,141 @@
<template>
<view class="basic-border tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>边框</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="普通边框">
<view class="border-content tn-border-solid">
<view>四周边框</view>
</view>
<view class="border-content tn-border-solid-top">
<view>顶部边框</view>
</view>
<view class="border-content tn-border-solid-right">
<view>右边边框</view>
</view>
<view class="border-content tn-border-solid-bottom">
<view>下面边框</view>
</view>
<view class="border-content tn-border-solid-left">
<view>左边边框</view>
</view>
</demo-title>
<demo-title title="加粗边框">
<view class="border-content tn-border-solids">
<view>四周边框</view>
</view>
<view class="border-content tn-border-solids-top">
<view>顶部边框</view>
</view>
<view class="border-content tn-border-solids-right">
<view>右边边框</view>
</view>
<view class="border-content tn-border-solids-bottom">
<view>下面边框</view>
</view>
<view class="border-content tn-border-solids-left">
<view>左边边框</view>
</view>
</demo-title>
<demo-title title="虚线边框">
<view class="border-content tn-border-dashed">
<view>四周边框</view>
</view>
<view class="border-content tn-border-dashed-top">
<view>顶部边框</view>
</view>
<view class="border-content tn-border-dashed-right">
<view>右边边框</view>
</view>
<view class="border-content tn-border-dashed-bottom">
<view>下面边框</view>
</view>
<view class="border-content tn-border-dashed-left">
<view>左边边框</view>
</view>
</demo-title>
<demo-title title="隐藏某一边框">
<view class="border-content tn-border-solid tn-none-border-top">
<view>隐藏上边框</view>
</view>
<view class="border-content tn-border-solid tn-none-border-right">
<view>隐藏右边框</view>
</view>
<view class="border-content tn-border-solid tn-none-border-bottom">
<view>隐藏下边框</view>
</view>
<view class="border-content tn-border-solid tn-none-border-left">
<view>隐藏左边框</view>
</view>
<view class="border-content tn-border-dashed tn-none-border-top">
<view>隐藏上边框</view>
</view>
<view class="border-content tn-border-dashed tn-none-border-right">
<view>隐藏右边框</view>
</view>
<view class="border-content tn-border-dashed tn-none-border-bottom">
<view>隐藏下边框</view>
</view>
<view class="border-content tn-border-dashed tn-none-border-left">
<view>隐藏左边框</view>
</view>
</demo-title>
<demo-title title="颜色">
<view class="border-content tn-border-solid tn-border-indigo">
</view>
<view class="border-content tn-border-solids tn-border-green">
</view>
<view class="border-content tn-border-dashed tn-border-purplered">
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicBorder',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.basic-border {
min-height: 100vh;
}
.border-content {
display: flex;
align-items: center;
justify-content: center;
height: 80rpx;
background-color: #FFFFFF;
margin: 30rpx 0rpx;
}
</style>
+109
View File
@@ -0,0 +1,109 @@
<template>
<view class="basic-button tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>按钮</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基础">
<tn-button>按钮</tn-button>
</demo-title>
<demo-title title="大小">
<view>
<tn-button size="sm" margin="10rpx 10rpx">按钮</tn-button>
<tn-button margin="10rpx 10rpx">按钮</tn-button>
<tn-button size="lg" margin="10rpx 10rpx">按钮</tn-button>
<tn-button width="150rpx" height="100rpx" :fontSize="40" margin="10rpx 10rpx">按钮</tn-button>
</view>
<view class="tn-margin-top">
<tn-button padding="20rpx 40rpx" margin="10rpx 10rpx">按钮</tn-button>
<tn-button margin="10rpx 10rpx">按钮</tn-button>
<tn-button margin="10rpx 10rpx" :fontBold="true">按钮</tn-button>
</view>
<view class="tn-margin-top">
<tn-button width="100%">按钮</tn-button>
</view>
</demo-title>
<demo-title title="形状">
<tn-button margin="10rpx 10rpx">按钮</tn-button>
<tn-button shape="round" margin="10rpx 10rpx">按钮</tn-button>
<tn-button shape="icon" margin="10rpx 10rpx"><text class="tn-icon-link"></text></tn-button>
<tn-button width="150rpx" height="100rpx" :fontSize="40" shape="icon" margin="10rpx 10rpx"><text class="tn-icon-link"></text></tn-button>
</demo-title>
<demo-title title="颜色">
<view>
<tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" margin="10rpx 10rpx">按钮</tn-button>
<tn-button backgroundColor="rgba(1, 190, 255, 0.8)" fontColor="tn-color-white" margin="10rpx 10rpx">按钮</tn-button>
<tn-button backgroundColor="tn-bg-teal" fontColor="tn-color-white" margin="10rpx 10rpx">按钮</tn-button>
<tn-button backgroundColor="tn-cool-bg-color-7" fontColor="tn-color-white" margin="10rpx 10rpx">按钮</tn-button>
</view>
<view class="tn-margin-top">
<tn-button backgroundColor="tn-main-gradient-indigo" fontColor="rgba(255, 255, 255, 0.8)" margin="10rpx 10rpx">按钮</tn-button>
<tn-button backgroundColor="tn-main-gradient-indigo--reverse" fontColor="rgba(255, 255, 255, 0.8)" margin="10rpx 10rpx">按钮</tn-button>
<tn-button backgroundColor="tn-main-gradient-indigo--light" margin="10rpx 10rpx">按钮</tn-button>
<tn-button backgroundColor="tn-main-gradient-indigo--single" fontColor="rgba(255, 255, 255, 0.8)" margin="10rpx 10rpx">按钮</tn-button>
</view>
</demo-title>
<demo-title title="边框">
<view>
<tn-button :plain="true" margin="10rpx 10rpx">按钮</tn-button>
<tn-button :plain="true" backgroundColor="#01BEFF" margin="10rpx 10rpx">按钮</tn-button>
<tn-button :plain="true" :borderBold="true" backgroundColor="#01BEFF" margin="10rpx 10rpx">按钮</tn-button>
<tn-button :plain="true" backgroundColor="rgba(1, 190, 255, 0.8)" margin="10rpx 10rpx">按钮</tn-button>
<tn-button :plain="true" backgroundColor="tn-bg-teal" margin="10rpx 10rpx">按钮</tn-button>
</view>
</demo-title>
<demo-title title="阴影">
<tn-button :shadow="true" width="100%" height="100rpx" margin="10rpx 0">按钮</tn-button>
<tn-button :shadow="true" width="100%" height="100rpx" backgroundColor="#01BEFF" fontColor="#FFFFFF" margin="10rpx 0">按钮</tn-button>
<tn-button :shadow="true" width="100%" height="100rpx" backgroundColor="tn-bg-teal" fontColor="#FFFFFF" margin="10rpx 0">按钮</tn-button>
<tn-button :shadow="true" width="100%" height="100rpx" backgroundColor="tn-main-gradient-indigo" margin="10rpx 0">按钮</tn-button>
<tn-button :shadow="true" width="100%" height="100rpx" backgroundColor="tn-cool-bg-color-7" margin="10rpx 0">按钮</tn-button>
<tn-button :shadow="true" :plain="true" height="100rpx" width="100%" :border="false" margin="10rpx 0">镂空无边框</tn-button>
</demo-title>
<demo-title title="加载中">
<tn-button :loading="true" width="100%" height="100rpx" margin="10rpx 0">按钮</tn-button>
</demo-title>
<demo-title title="禁止点击">
<tn-button :disabled="true" width="100%" height="100rpx" margin="10rpx 0">按钮</tn-button>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicButton',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.basic-button {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
</style>
+759
View File
@@ -0,0 +1,759 @@
<template>
<view class="basic-background">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>背景</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="tn-flex tn-flex-nowrap background-container">
<view class="background__left-container">
<scroll-view :style="[scrollViewStyle]" scroll-y>
<view class="background__left__picker">
<view class="background__left__picker__item-wrapper" @click="pickerColorClick(0)">
<view
class="background__left__picker__item background__left__picker__item--basic picker-color-item-0"
:class="[{'tn-shadow-blur': currentColorIndex === 0}]" style="background-color: #01BEFF;">
<text class="tn-icon-logo-tuniao"></text>
</view>
</view>
<block v-for="(item, index) in colorList" :key="index">
<view class="background__left__picker__item-wrapper" @click="pickerColorClick(index + 1)">
<view class="background__left__picker__item" :class="[`picker-color-item-${index + 1} tn-bg-${item.color}`, {'tn-shadow-blur': currentColorIndex === index + 1}]"></view>
</view>
</block>
<!-- 选中后的边框 -->
<view class="background__left__picker__item__select-wrapper" :style="[colorSelectItemStyle]">
<view class="circle-wrapper right">
<view class="circle-progress right-circle"
:style="{borderColor: currentColorIndex === 0 ? '#01BEFF' : colorList[currentColorIndex - 1]['value']['dark']}"></view>
</view>
<view class="circle-wrapper left">
<view class="circle-progress left-circle"
:style="{borderColor: currentColorIndex === 0 ? '#01BEFF' : colorList[currentColorIndex - 1]['value']['dark']}"></view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class="background__right-container">
<scroll-view
v-if="!isUpdateColorInfo"
:style="[scrollViewStyle]"
scroll-y
:refresher-enabled="true"
lower-threshold="20"
:refresher-triggered="containerRefreshFlag"
@scroll="containerScroll"
@scrolltolower="containerScrollLower"
@refresherrefresh="containerRefresh"
>
<view class="background__right__show">
<block v-if="currentColorIndex === 0">
<view class="background__right__show--title">图鸟基础配色</view>
<!-- 色盘 start-->
<view class="box" >
<view v-for="(item,index) in 16" :key="index" :class="'colorwheel-box colorwheel-' + (index+1)"></view>
</view>
<!-- 色盘 end-->
<view class="background__right__show__content">
<view class="background__right__show__content__item tn-shadow-blur" style="background-color: #01BEFF;">
<view class="background__right__show__content__item--title">主色蓝</view>
<view class="background__right__show__content__item--value">#01BEFF</view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" style="background-color: #FBBD12;">
<view class="background__right__show__content__item--title">主色橙</view>
<view class="background__right__show__content__item--value">#FBBD12</view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" style="background-color: #00FFC6;">
<view class="background__right__show__content__item--title background__right__show__content__item--title--light">点缀青</view>
<view class="background__right__show__content__item--value">#00FFC6</view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" style="background-color: #FFF00D;">
<view class="background__right__show__content__item--title background__right__show__content__item--title--light">点缀黄</view>
<view class="background__right__show__content__item--value">#FFF00D</view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" style="background-color: #FF71D2;">
<view class="background__right__show__content__item--title">辅助粉</view>
<view class="background__right__show__content__item--value">#FF71D2</view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" style="background-color: #82B2FF;">
<view class="background__right__show__content__item--title">辅助蓝</view>
<view class="background__right__show__content__item--value background__right__show__content__item--value--light">#82B2FF</view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" style="background-color: #080808;">
<view class="background__right__show__content__item--title">文字颜色</view>
<view class="background__right__show__content__item--value background__right__show__content__item--value--light">#080808</view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" style="background-color: #F4F4F4;">
<view class="background__right__show__content__item--title background__right__show__content__item--title--light">背景灰</view>
<view class="background__right__show__content__item--value background__right__show__content__item--value--light">#F4F4F4</view>
</view>
</view>
</block>
<block v-else>
<view class="background__right__show--title">{{ selectColorInfo.name }}-{{ selectColorInfo.color }}</view>
<view class="background__right__show__content">
<block v-for="(value, key, index) in selectColorInfo.value" :key="index">
<view class="background__right__show__content__item tn-shadow-blur" :class="[key === 'normal' ? `tn-bg-${selectColorInfo.color}` : `tn-bg-${selectColorInfo.color}--${key}`]">
<view class="background__right__show__content__item--title" :class="[['disabled','light'].includes(key) ? 'background__right__show__content__item--title--light' : '']">{{ key }}</view>
<view class="background__right__show__content__item--value"
:class="[['disabled','light'].includes(key) ? 'background__right__show__content__item--value--light' : '',{'tn-color-white': selectColorInfo.color === 'gray' && key === 'normal'}]"
>
{{ value }}</view>
</view>
</block>
</view>
<block v-if="!['brown','grey','gray'].includes(selectColorInfo.color)">
<view class="background__right__show--title background__right__show--title--gradient" :class="[`tn-cool-bg-color-${currentColorIndex % 16 + 1}`]">渐变色</view>
<view class="background__right__show__content">
<view class="background__right__show__content__item tn-shadow-blur" :class="[`tn-main-gradient-${selectColorInfo.color}`]">
<view class="background__right__show__content__item--title"></view>
<view class="background__right__show__content__item--value"></view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" :class="[`tn-main-gradient-${selectColorInfo.color}--reverse`]">
<view class="background__right__show__content__item--title"></view>
<view class="background__right__show__content__item--value"></view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" :class="[`tn-main-gradient-${selectColorInfo.color}--light`]">
<view class="background__right__show__content__item--title"></view>
<view class="background__right__show__content__item--value"></view>
</view>
<view class="background__right__show__content__item tn-shadow-blur" :class="[`tn-main-gradient-${selectColorInfo.color}--light--reverse`]">
<view class="background__right__show__content__item--title"></view>
<view class="background__right__show__content__item--value"></view>
</view>
</view>
</block>
</block>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'basicBackground',
data() {
return {
colorList: [{
name: '红色',
color: 'red',
value: {
normal: '#E83A30',
dark: '#BA2E26',
disabled: '#F39C97',
light: '#FAD8D6'
}
},
{
name: '紫红色',
color: 'purplered',
value: {
normal: '#E72F8C',
dark: '#B9266F',
disabled: '#F397C5',
light: '#FAD5E8'
}
},
{
name: '紫色',
color: 'purple',
value: {
normal: '#892FE8',
dark: '#6E26BA',
disabled: '#C497F3',
light: '#E7D5FA'
}
},
{
name: '蓝紫色',
color: 'bluepurple',
value: {
normal: '#5F4FD9',
dark: '#4C3FAE',
disabled: '#AFA7EC',
light: '#DFDCF7'
}
},
{
name: '海蓝色',
color: 'aquablue',
value: {
normal: '#3646FF',
dark: '#2B38CC',
disabled: '#9AA2FF',
light: '#D7DAFF'
}
},
{
name: '蓝色',
color: 'blue',
value: {
normal: '#3D7EFF',
dark: '#3165CC',
disabled: '#9EBEFF',
light: '#D8E5FF'
}
},
{
name: '靛蓝色',
color: 'indigo',
value: {
normal: '#31C9E8',
dark: '#27A1BA',
disabled: '#98E4F3',
light: '#D6F4FA'
}
},
{
name: '青色',
color: 'cyan',
value: {
normal: '#2DE8BD',
dark: '#24BA97',
disabled: '#96F3DE',
light: '#D5FAF2'
}
},
{
name: '青绿色',
color: 'teal',
value: {
normal: '#24F083',
dark: '#1DC069',
disabled: '#91F7C1',
light: '#D3FCE6'
}
},
{
name: '绿色',
color: 'green',
value: {
normal: '#31E749',
dark: '#27B93A',
disabled: '#98F3A4',
light: '#D6FADB'
}
},
{
name: '黄绿色',
color: 'yellowgreen',
value: {
normal: '#A4E82F',
dark: '#82BA26',
disabled: '#D1F397',
light: '#EDFAD5'
}
},
{
name: '酸橙色',
color: 'lime',
value: {
normal: '#D5EB00',
dark: '#AABC00',
disabled: '#E9F57F',
light: '#F7FBCC'
}
},
{
name: '黄色',
color: 'yellow',
value: {
normal: '#FFF420',
dark: '#CCC21A',
disabled: '#FFF88F',
light: '#FFFDD2'
}
},
{
name: '橘黄色',
color: 'orangeyellow',
value: {
normal: '#FFCA28',
dark: '#CCA220',
disabled: '#FFE493',
light: '#FFF4D4'
}
},
{
name: '橙色',
color: 'orange',
value: {
normal: '#FFA726',
dark: '#CC851E',
disabled: '#FFD392',
light: '#FFEDD4'
}
},
{
name: '橘红色',
color: 'orangered',
value: {
normal: '#FF7043',
dark: '#CC5A36',
disabled: '#FFB7A1',
light: '#FFE2D9'
}
},
{
name: '棕色',
color: 'brown',
value: {
normal: '#914F2C',
dark: '#743F23',
disabled: '#C8A795',
light: '#E9DCD5'
}
},
{
name: '玄灰色',
color: 'grey',
value: {
normal: '#78909C',
dark: '#5F7E8B',
disabled: '#C6D1D8',
light: '#E4E9EC'
}
},
{
name: '灰色',
color: 'gray',
value: {
normal: '#AAAAAA',
dark: '#838383',
disabled: '#E6E6E6',
light: '#F8F7F8'
}
}
],
// scrollView的样式
scrollViewStyle: {
height: 0
},
// picker列表颜色列表信息
pickerColorInfos: [],
// picker列表颜色选中框样式
colorSelectItemStyle: {
top: 0,
left: 0
},
// 当前选中的颜色序号
currentColorIndex: 0,
// 内容容器滚动容器滚动的位置
containerScrollTop: 0,
// 标记是否正在更新数据
isUpdateColorInfo: false,
// 内容区域刷新标志
containerRefreshFlag: false,
// 当前选中颜色的色值信息
selectColorInfo: {}
}
},
onLoad() {
},
onReady() {
// 等待加载组件完成
setTimeout(() => {
this.initScrollViewHeight()
}, 10)
},
methods: {
// 计算scrollView的高度
initScrollViewHeight() {
// 获取当前屏幕的安全高度
uni.getSystemInfo({
success: (systemInfo) => {
this.scrollViewStyle.height = (systemInfo.safeArea.height - this.vuex_custom_bar_height + systemInfo.statusBarHeight) + 'px'
this.getPickerColorItemInfo()
}
})
},
// 内容容器滚动事件
containerScroll(e) {
// console.log(e);
// this.containerScrollTop = e.detail.scrollTop
},
// 内容scroll-view下拉刷新事件
containerRefresh(e) {
// console.log(e);
if (this.containerRefreshFlag) return
this.containerRefreshFlag = true
setTimeout(() => {
this.containerRefreshFlag = false
}, 10)
if (this.currentColorIndex - 1 < 0 || this.isUpdateColorInfo) return
this.pickerColorClick(this.currentColorIndex - 1)
},
// 内容scroll-view滚动到底部触发事件
containerScrollLower(e) {
// console.log(e);
if (e.detail.direction === 'bottom') {
// console.log(e.detail.direction);
// 触发底部
// if (this.currentColorIndex + 1 > this.colorList.length || this.isUpdateColorInfo) return
// console.log('update');
// this.pickerColorClick(this.currentColorIndex + 1)
}
},
// 获取色值列表的位置信息
getPickerColorItemInfo() {
// 获取picker容器的信息
this._tGetRect('.background__left__picker').then((pickerInfo) => {
let view = uni.createSelectorQuery().in(this)
for (let i = 0; i <= this.colorList.length; i++) {
view.select('.picker-color-item-' + i).boundingClientRect()
}
view.exec(res => {
// 如果没有获取到,则重新获取
if (!res.length) {
setTimeout(() => {
this.getPickerColorItemInfo()
return
}, 10)
}
// 将每个选择颜色值的宽高,位置信息存入列表中
res.map((item, index) => {
this.pickerColorInfos.push({
x: (item.top - pickerInfo.top) + (item.height / 2),
y: (item.left - pickerInfo.left) + (item.width / 2)
})
// 初始化选中的圆环
this.updatePickerColorSelectItem()
this.updateSelectColorInfo()
})
})
})
},
// 色值选择
pickerColorClick(index) {
if (index === this.currentColorIndex) {
return
}
this.currentColorIndex = index
this.updatePickerColorSelectItem()
this.updateSelectColorInfo()
},
// 设置选中圆环信息
updatePickerColorSelectItem() {
const colorInfos = this.pickerColorInfos[this.currentColorIndex]
this.colorSelectItemStyle.top = colorInfos.x - uni.upx2px(40) + 'px'
this.colorSelectItemStyle.left = colorInfos.y - uni.upx2px(40) + 'px'
},
// 设置选中颜色的信息
updateSelectColorInfo() {
if (this.currentColorIndex === 0) {
return
}
this.isUpdateColorInfo = true
this.$tn.message.loading('加载中...')
// this.containerScrollTop = Math.random()
setTimeout(() => {
// this.containerScrollTop = 0
this.selectColorInfo = this.colorList[this.currentColorIndex - 1]
this.$tn.message.closeLoading()
this.isUpdateColorInfo = false
}, 10)
// setTimeout(() => {
// }, 1000)
}
}
}
</script>
<style lang="scss" scoped>
/* 色盘 start*/
.box{
position: relative;
margin: auto;
display: block;
width: 550rpx;
height: 600rpx;
background: none;
}
.colorwheel-box{
position: absolute;
width: 80%;
height: 50%;
left: 10%;
bottom: 20%;
border-radius: 100% 10rpx;
opacity: 0.4;
}
.colorwheel-1{
background: #2DE8BD;
transform: rotate(-78.75deg);
}
.colorwheel-2{
background: #24F083;
transform: rotate(-90deg);
}
.colorwheel-3{
background: #31E749;
transform: rotate(-101.25deg);
}
.colorwheel-4{
background: #A4E82F;
transform: rotate(-112.5deg);
}
.colorwheel-5{
background: #D5EB00;
transform: rotate(-123.75deg);
}
.colorwheel-6{
background: #FFF420;
transform: rotate(-135deg);
}
.colorwheel-7{
background: #FFCA28;
transform: rotate(-146.25deg);
}
.colorwheel-8{
background: #FFA726;
transform: rotate(-157.5deg);
}
.colorwheel-9{
background: #FF7043;
transform: rotate(-168.75deg);
}
.colorwheel-10{
background: #E83A30;
transform: rotate(0deg);
}
.colorwheel-11{
background: #E72F8C;
transform: rotate(-11.25deg);
}
.colorwheel-12{
background: #892FE8;
transform: rotate(-22.5deg);
}
.colorwheel-13{
background: #5F4FD9;
transform: rotate(-33.75deg);
}
.colorwheel-14{
background: #3646FF;
transform: rotate(-45deg);
}
.colorwheel-15{
background: #3D7EFF;
transform: rotate(-56.25deg);
}
.colorwheel-16{
background: #31C9E8;
transform: rotate(-67.5deg);
}
/* 色盘 end*/
/* 背景颜色容器 start */
.background-container {
.background {
/* 左边容器 start */
&__left-container {
width: 16%;
height: 100%;
box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.07);
}
&__left {
&__picker {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 20rpx;
position: relative;
&__item-wrapper {
width: 100%;
}
&__item {
width: 50rpx;
height: 50rpx;
margin: 18rpx auto;
border-radius: 50%;
border: none;
&--basic {
text-align: center;
color: #FFFFFF;
line-height: 50rpx;
}
&__select-wrapper {
width: 80rpx;
height: 80rpx;
position: absolute;
.circle-wrapper {
width: 40rpx;
height: 80rpx;
position: absolute;
top: 0;
overflow: hidden;
&.right {
right: 0;
}
&.left {
left: 0;
}
.circle-progress {
display: inline-block;
width: 80rpx;
height: 80rpx;
border: 6rpx solid transparent;
border-radius: 50%;
position: absolute;
top: 0;
// transform: rotate(225deg);
transform: rotate(45deg);
&.right-circle {
right: 0;
border-bottom-color: transparent !important;
border-left-color: transparent !important;
// transition: transform 0.3s cubic-bezier(0,.13,0,1.43);
}
&.left-circle {
left: 0;
border-top-color: transparent !important;
border-right-color: transparent !important;
// transition: transform 0.3s cubic-bezier(0,.13,0,1.43);
}
// &--active {
// transform: rotate(45deg);
// }
}
}
}
}
}
}
/* 左边容器 end */
/* 右边容器 start */
&__right-container {
width: 84%;
height: 100%;
}
&__right {
&__show {
padding: 30rpx;
overflow: hidden;
transform-origin: 0 50%;
// opacity: 0;
// transition: opacity 0.2s ease;
// transform: scaleX(0) rotate(-90deg);
// transform: rotateY(-90deg);
// transform: scaleX(0);
// transition: all 0.2s linear;
&--visible {
// transform: scaleX(1) rotate(0deg);
// transform: rotateY(0deg);
// transform: scaleX(1);
opacity: 1;
}
&--title {
font-size: 46rpx;
text-transform: capitalize;
&--gradient {
-webkit-background-clip: text;
color: transparent;
}
}
&__content {
margin-top: 40rpx;
&__item {
width: 100%;
height: 160rpx;
border-radius: 10rpx;
margin-bottom: 40rpx;
display: flex;
justify-content: flex-start;
align-items: center;
align-content: center;
flex-wrap: wrap;
padding-left: 40rpx;
&--title {
width: 100%;
font-size: 1.4em;
line-height: 1.4em;
color: #FFFFFF;
text-transform: capitalize;
&--light {
color: #080808 !important;
}
}
&--value {
width: 100%;
font-size: 0.8em;
color: #AAAAAA;
&--light {
color: #818181 !important;
}
}
}
}
}
}
/* 右边容器 end */
}
}
/* 背景颜色容器 end */
@-webkit-keyframes circleProgressLoad_right {
0% {
transform: rotate(225deg);
}
100% {
transform: rotate(45deg);
}
}
@-webkit-keyframes circleProgressLoad_left {
0% {
transform: rotate(225deg);
}
100% {
transform: rotate(45deg);
}
}
</style>
+456
View File
@@ -0,0 +1,456 @@
<template>
<view class="basic-flex tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Flex布局</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="固定尺寸 & 元素">
<view class="tn-flex tn-flex-wrap">
<view class="tn-flex-basic-xs tn-padding tn-margin-top-sm tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">xs(20%)</view>
<view class="tn-flex-basic-md"></view>
<view class="tn-flex-basic-sm tn-padding tn-margin-top-sm tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">sm(40%)</view>
<view class="tn-flex-basic-md"></view>
<view class="tn-flex-basic-md tn-padding tn-margin-top-sm tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">md(50%)</view>
<view class="tn-flex-basic-lg tn-padding tn-margin-top-sm tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">lg(60%)</view>
<view class="tn-flex-basic-xl tn-padding tn-margin-top-sm tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">xl(80%)</view>
<view class="tn-flex-basic-full tn-padding tn-margin-top-sm tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">full(100%)</view>
</view>
</demo-title>
<demo-title title="应用示例1">
<view class="tn-flex tn-flex-wrap">
<view class="tn-flex-basic-md">
<view class="tn-padding-lg tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-basic-md">
<view class="tn-padding-lg tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-basic-xs">
<view class="tn-padding-lg tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-basic-xs">
<view class="tn-padding-lg tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-basic-xs">
<view class="tn-padding-lg tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-basic-xs">
<view class="tn-padding-lg tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-basic-xs">
<view class="tn-padding-lg tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="比例布局 & 元素">
<view class="tn-flex">
<view class="tn-flex-1 tn-padding tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">1</view>
<view class="tn-flex-1 tn-padding tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">1</view>
</view>
<view class="tn-flex">
<view class="tn-flex-1 tn-padding tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">1</view>
<view class="tn-flex-2 tn-padding tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">2</view>
</view>
<view class="tn-flex">
<view class="tn-flex-1 tn-padding tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">1</view>
<view class="tn-flex-2 tn-padding tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">2</view>
<view class="tn-flex-3 tn-padding tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">3</view>
</view>
</demo-title>
<demo-title title="应用示例1">
<view class="tn-flex">
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-2">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例2">
<view class="tn-flex">
<view class="tn-flex-2 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-2">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例3">
<view class="tn-flex">
<view class="tn-flex-3 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-2">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例4">
<view class="tn-flex">
<view class="tn-flex-2 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-2 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-3">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例5">
<view class="tn-flex">
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-2">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例6">
<view class="tn-flex">
<view class="tn-flex-2">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
</view>
</demo-title>
<demo-title title="应用示例7">
<view class="tn-flex">
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例8">
<view class="tn-flex">
<view class="tn-flex-3">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-2">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例9">
<view class="tn-flex">
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
</view>
</demo-title>
<demo-title title="应用示例10">
<view class="tn-flex">
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-2">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-3 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
</view>
</demo-title>
<demo-title title="应用示例11">
<view class="tn-flex">
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例12">
<view class="tn-flex">
<view class="tn-flex-1 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-3">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例13">
<view class="tn-flex">
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
<view class="tn-flex-3 tn-padding-sm tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例14">
<view class="tn-flex">
<view class="tn-flex-1">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-left-xs tn-margin-right-xs tn-margin-top-sm tn-margin-bottom-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
</view>
</view>
</demo-title>
<demo-title title="水平对齐 & justify">
<view class="tn-flex tn-flex-row-left">
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">start</view>
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">start</view>
</view>
<view class="tn-flex tn-flex-row-right tn-margin-top-sm">
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">end</view>
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">end</view>
</view>
<view class="tn-flex tn-flex-row-center tn-margin-top-sm">
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">center</view>
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">center</view>
</view>
<view class="tn-flex tn-flex-row-around tn-margin-top-sm">
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">around</view>
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">around</view>
</view>
<view class="tn-flex tn-flex-row-between tn-margin-top-sm">
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">between</view>
<view class="justify-content-item tn-padding tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">between</view>
</view>
</demo-title>
<demo-title title="应用示例1">
<view class="tn-flex tn-flex-row-center tn-margin-top-sm">
<view class="justify-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="justify-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="justify-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
</view>
</demo-title>
<demo-title title="应用示例2">
<view class="tn-flex tn-flex-row-center tn-margin-top-sm">
<view class="justify-content-item">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
<view class="justify-content-item">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
<view class="justify-content-item">
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例3">
<view class="tn-flex tn-flex-row-around tn-margin-top-sm">
<view class="justify-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="justify-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="justify-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-shadow-blur"></view>
</view>
</demo-title>
<demo-title title="应用示例4">
<view class="tn-flex tn-flex-row-around tn-margin-top-sm">
<view class="justify-content-item">
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
<view class="justify-content-item">
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
<view class="justify-content-item">
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
</view>
</demo-title>
<demo-title title="应用示例5">
<view class="tn-flex tn-flex-row-between tn-margin-top-sm">
<view class="justify-content-item tn-padding-xl tn-text-center tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="justify-content-item tn-padding-xl tn-text-center tn-radius bg-flex-shadow tn-shadow-blur"></view>
<view class="justify-content-item tn-padding-xl tn-text-center tn-radius bg-flex-shadow tn-shadow-blur"></view>
</view>
</demo-title>
<demo-title title="应用示例6">
<view class="tn-flex tn-flex-row-between tn-margin-top-sm">
<view class="justify-content-item">
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
<view class="justify-content-item">
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
<view class="justify-content-item">
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur">
</view>
<view class="tn-padding-xl tn-radius bg-flex-shadow tn-shadow-blur" style="margin-top: 20rpx;">
</view>
</view>
</view>
</demo-title>
<demo-title title="垂直对齐 & align">
<view class="tn-flex tn-flex-col-top">
<view class="align-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">left</view>
<view class="align-content-item tn-padding-sm tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">top</view>
</view>
<view class="tn-flex tn-flex-col-center tn-margin-top-sm">
<view class="align-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">left</view>
<view class="align-content-item tn-padding-sm tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">center</view>
</view>
<view class="tn-flex tn-flex-col-bottom tn-margin-top-sm">
<view class="align-content-item tn-padding-xl tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">left</view>
<view class="align-content-item tn-padding-sm tn-text-center tn-margin-xs tn-radius bg-flex-shadow tn-cool-bg-color-2 tn-shadow-blur">bottom</view>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'BasicFlexLayout',
components: {demoTitle},
data() {
return {
}
},
onLoad() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
/* 内容容器 start */
.bg-flex-shadow{
background-color: #00C3FF;
z-index: 9999;
}
/* 内容容器 end */
</style>
+169
View File
@@ -0,0 +1,169 @@
<template>
<view class="basic-grid">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Grid布局</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-grid v-if="showGrid" :align="align" :hoverClass="hoverClass" :col="col">
<block v-for="(item, index) in icons" :key="index">
<!-- #ifndef MP-WEIXIN -->
<tn-grid-item>
<view class="" style="margin: 60rpx 20rpx;font-size: 70rpx;color: #01BEFF;">
<text class="" :class="['tn-icon-' + item]"></text>
</view>
</tn-grid-item>
<!-- #endif-->
<!-- #ifdef MP-WEIXIN -->
<tn-grid-item :style="{width: gridItemWidth}">
<view class="icon__item--icon tn-cool-color-icon" :class="[$tn.color.getRandomCoolBgClass(index)]">
<view class="tn-margin-top-sm" :class="['tn-icon-' + item]"></view>
</view>
</tn-grid-item>
<!-- #endif-->
</block>
</tn-grid>
</dynamic-demo-template>
</view>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'BasicGridLayout',
components: {dynamicDemoTemplate},
data() {
return {
showGrid: true,
align: 'left',
hoverClass: 'tn-hover',
col: 3,
icons: [
'zodiac-shu',
'zodiac-niu',
'zodiac-hu',
'zodiac-tu',
'zodiac-long',
'zodiac-she',
'zodiac-ma',
'zodiac-yang',
'zodiac-hou',
'zodiac-ji',
'zodiac-gou',
'zodiac-zhu',
'logo-tuniao',
],
tips: ['无需依赖额外的样式文件','使用tn-grid、tn-grid-item组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '对齐方式',
optional: ['左对齐','居中','右对齐'],
methods: 'alignChange'
},
{
title: '点击效果',
optional: ['开启','关闭'],
methods: 'hoverChange'
},
{
title: '列数',
optional: ['3','4'],
methods: 'colChange'
}
]
}
]
}
},
computed: {
// 兼容小程序
// #ifdef MP-WEIXIN
gridItemWidth() {
return 100 / this.col + '%'
},
// #endif
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 对齐方式控制
alignChange(event) {
switch(event.index) {
case 0:
this.align = 'left'
break
case 1:
this.align = 'center'
break
case 2:
this.align = 'right'
break
}
},
// 点击效果控制
hoverChange(event) {
this.hoverClass = event.index === 0 ? 'tn-hover' : 'none'
},
// 列数修改
colChange(event) {
this.col = event.index === 0 ? 3 : 4
this.$refs.demoTemplate.updateSectionScrollView()
},
},
}
</script>
<style lang="scss" scoped>
.icon {
&__item {
width: 30%;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 30rpx;
margin: 20rpx 10rpx;
margin-top: 0;
transform: scale(1);
transition: transform 0.3s linear;
transform-origin: center center;
&--icon {
width: 100rpx;
height: 100rpx;
font-size: 60rpx;
border-radius: 50%;
margin: 30rpx;
position: relative;
z-index: 1;
&::after {
content: " ";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
left: 0;
bottom: 0;
border-radius: inherit;
opacity: 1;
transform: scale(1, 1);
background-size: 100% 100%;
background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg6.png);
}
}
}
}
</style>
+231
View File
@@ -0,0 +1,231 @@
<template>
<view class="basic-icon">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>图标</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="search-fixed">
<view class="search-content">
<input class="search-content__input" placeholder-class="search-content__input-placeholder tn-color-blue"
placeholder="搜索 中文名/英文名" @input="saerchInput" />
</view>
</view>
<view class="" :style="{marginTop: vuex_custom_bar_height + 'px'}">
<block v-for="(item, index) in resultIconList" :key="index">
<!-- 分类标题-->
<view class="tn-text-center tn-text-xl tn-text-bold tn-margin-lg">
<text class="tn-icon-font"></text>
<text class="tn-padding-left-sm tn-padding-right-sm">{{ item.title }}</text>
<text class="tn-icon-font"></text>
</view>
<view class="icon__container tn-flex tn-flex-wrap tn-flex-row-left tn-flex-col-center tn-margin">
<view v-for="(icons_item, icons_index) in item.icons" :key="icons_index"
class="icon__item tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center icon-shadow"
:class="[{'icon__item--active': icons_index === currentIconIndex}]"
@click="clickIcon(icons_index, icons_item.name, icons_item.icon)">
<view class="icon__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur">
<view :class="[`tn-icon-${icons_item.icon}`]"></view>
</view>
<view class="icon__item--title tn-text-ellipsis tn-text-df tn-color-grey">{{ icons_item.icon }}</view>
<!-- <view class="icon__item--title tn-text-ellipsis tn-text-xs tn-color-grey">{{ icons_item.name }}</view> -->
</view>
</view>
</block>
</view>
<view class="tn-text-center tn-margin-bottom-xl">
<view>
icon目前700+支持
<text class="tn-color-orange tn-text-lg tn-padding-xs">中文英文</text>
搜索
</view>
<button class=" tn-button--clear-style" open-type="feedback">
<view class="tn-margin tn-text-center">
<text>里面缺少你想要的吗UI期待你的需求</text>
<text class="tn-color-blue">留言</text>
</view>
</button>
</view>
<view class="tn-padding-bottom"></view>
</view>
</view>
</template>
<script>
import iconData from './iconfont.js'
export default {
name: 'basicIcon',
data() {
return {
// 图标列表
iconList: iconData.data,
// 用户输入的内容
searchValue: '',
// 当前点击的图标序号
currentIconIndex: -1,
}
},
computed: {
resultIconList() {
//filter会改变原数组,故使用深拷贝
var newArr = JSON.parse(JSON.stringify(iconData.data))
if (!this.searchValue) return iconData.data
return newArr.filter((item1) => {
item1.icons = item1.icons.filter((item2) => {
if (item2.name.includes(this.searchValue) || item2.icon.includes(this.searchValue)) {
return item2
}
})
if (item1.icons.length > 0) {
return item1
}
})
}
},
methods: {
// input输入的内容
saerchInput(e) {
//重新设置为-1,避免选中之前选中的图标
this.currentIconIndex=-1;
this.searchValue = e.target.value;
this.resultIconList
},
// 点击图标
clickIcon(index, name ,icon) {
this.currentIconIndex = index
// this.$tn.message.toast(name, false, null, 'none', 5000)
//这里点击后直接复制图标名称。
uni.setClipboardData({
data: icon,
showToast: false,
success: () => {
console.log('success'); //复制成功
this.$tn.message.toast('已复制:' + icon, false, null, 'none', 5000)
}
});
// const save = function (e) {
// e.clipboardData.setData('text/plain', name)
// e.preventDefault() // 阻止默认行为
// }
// const once = {
// once: true
// }
// document.addEventListener('copy', save, once) // 添加一个copy事件,当触发时执行一次,执行完删除
// document.execCommand('copy') // 执行copy方法
},
}
}
</script>
<style lang="scss" scoped>
.search-fixed {
position: fixed;
width: 100%;
transition: all 0.25s ease-out;
z-index: 1;
}
/* 搜索框 start */
.search-content {
padding-top: 16rpx;
margin: 40rpx 40rpx;
&__input {
caret-color: $tn-main-color;
width: 100%;
height: 70rpx;
line-height: 60rpx;
border-radius: 100rpx;
text-align: center;
margin: 0 auto;
background-color: #FFFFFF;
color: #080808;
box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.05);
}
&__input-placeholder {
font-size: 24rpx;
}
}
/* 搜索框 end */
/* 图标容器 start */
.icon-shadow {
box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.06);
}
.icon {
&__container {
margin-bottom: 30rpx;
}
&__item {
width: 30.4%;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 30rpx;
margin: 20rpx 10rpx;
margin-top: 0;
transform: scale(1);
transition: transform 0.2s linear;
transform-origin: center center;
&--active {
transform: scale(0.95);
box-shadow:
inset 10rpx 10rpx 18rpx rgba(0, 0, 120, 0.04),
inset -8rpx -8rpx 20rpx rgba(0, 0, 120, 0.03);
}
&--icon {
width: 80rpx;
height: 80rpx;
font-size: 60rpx;
border-radius: 50%;
margin-bottom: 18rpx;
position: relative;
z-index: 1;
&::after {
content: " ";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
left: 0;
bottom: 0;
border-radius: inherit;
opacity: 1;
transform: scale(1, 1);
background-size: 100% 100%;
background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg.png);
}
}
&--title {
width: 100%;
text-align: center;
}
}
}
/* 图标容器 end */
</style>
File diff suppressed because one or more lines are too long
+79
View File
@@ -0,0 +1,79 @@
<template>
<view class="basic-shadow tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>阴影</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="普通阴影">
<view class="shadow-content tn-shadow"></view>
<view class="shadow-content tn-shadow-warp"></view>
</demo-title>
<demo-title title="有色阴影">
<view class="shadow-content tn-bg-teal tn-shadow-teal"></view>
<view class="shadow-content tn-bg-indigo tn-shadow-indigo"></view>
</demo-title>
<demo-title title="背景图片阴影">
<view class="shadow-content shadow-content__image tn-shadow-blur"></view>
</demo-title>
<demo-title title="文字阴影">
<view class="shadow-content__text tn-color-indigo tn-text-shadow-indigo">
图鸟UI专注UI开发
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicShadow',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.basic-shadow {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
.shadow-content {
height: 80rpx;
background-color: #FFFFFF;
margin: 30rpx 0;
&__image {
z-index: 1;
background-image: url(https://vkceyugu.cdn.bspapp.com/VKCEYUGU-7207d16b-b9c3-4105-8d0d-e9e0c7785f66/605563a1-a210-42f3-99e4-8de3c655c59e.jpg);
background-size: cover;
background-position: top;
background-repeat: no-repeat;
}
&__text {
font-size: 60rpx;
text-align: center;
}
}
</style>
+141
View File
@@ -0,0 +1,141 @@
<template>
<view class="basic-tag tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>标签</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基础">
<tn-tag>标签</tn-tag>
</demo-title>
<demo-title title="大小">
<view>
<tn-tag size="sm" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag margin="10rpx 10rpx">标签</tn-tag>
<tn-tag size="lg" margin="10rpx 10rpx">标签</tn-tag>
</view>
<view class="tn-margin-top">
<tn-tag width="200rpx" height="100rpx" :fontSize="40" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag padding="40rpx 80rpx" margin="10rpx 10rpx">标签</tn-tag>
</view>
</demo-title>
<demo-title title="形状">
<view>
<tn-tag margin="10rpx 10rpx">标签</tn-tag>
<tn-tag shape="radius" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag shape="circle" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag shape="circleLeft" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag shape="circleRight" margin="10rpx 10rpx">标签</tn-tag>
</view>
</demo-title>
<demo-title title="颜色">
<view>
<tn-tag backgroundColor="#01BEFF" fontColor="#FFFFFF" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag backgroundColor="rgba(1, 190, 255, 0.8)" fontColor="tn-color-white" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag backgroundColor="tn-bg-teal" fontColor="tn-color-white" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag backgroundColor="tn-cool-bg-color-7" fontColor="tn-color-white" margin="10rpx 10rpx">标签</tn-tag>
</view>
<view>
<tn-tag backgroundColor="tn-main-gradient-indigo" fontColor="rgba(255, 255, 255, 0.8)" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag backgroundColor="tn-main-gradient-indigo--reverse" fontColor="rgba(255, 255, 255, 0.8)" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag backgroundColor="tn-main-gradient-indigo--light" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag backgroundColor="tn-main-gradient-indigo--single" fontColor="rgba(255, 255, 255, 0.8)" margin="10rpx 10rpx">标签</tn-tag>
</view>
</demo-title>
<demo-title title="镂空">
<view>
<tn-tag :plain="true" backgroundColor="#01BEFF" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag :plain="true" backgroundColor="rgba(1, 190, 255, 0.8)" margin="10rpx 10rpx">标签</tn-tag>
<tn-tag :plain="true" backgroundColor="tn-bg-teal" margin="10rpx 10rpx">标签</tn-tag>
</view>
</demo-title>
<demo-title title="标签使用">
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
<view class="origin-demo">
<view class="origin-demo__tag">
<tn-tag backgroundColor="#01BEFF" fontColor="#FFFFFF" width="auto" height="30rpx" shape="circle">99+</tn-tag>
</view>
</view>
<!-- #ifdef H5 -->
<view class="capsule">
<tn-tag class="capsule-tag" width="50%" height="100%" padding="0" shape="circleLeft" backgroundColor="#01BEFF" fontColor="#FFFFFF" :plain="false">
<text class="tn-icon-add"></text>
</tn-tag>
<tn-tag class="capsule-tag" width="50%" height="100%" padding="0" shape="circleRight" backgroundColor="#01BEFF" fontColor="#080808" :plain="true">
2
</tn-tag>
</view>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="capsule">
<tn-tag class="capsule-tag" width="100%" height="100%" padding="0" shape="circleLeft" backgroundColor="#01BEFF" fontColor="#FFFFFF" :plain="false">
<text class="tn-icon-add"></text>
</tn-tag>
<tn-tag class="capsule-tag" width="100%" height="100%" padding="0" shape="circleRight" backgroundColor="#01BEFF" fontColor="#080808" :plain="true">
2
</tn-tag>
</view>
<!-- #endif -->
<tn-tag :plain="true" backgroundColor="#01BEFF" width="auto" margin="0px 30rpx">
<view class="tn-flex tn-flex-direction-row tn-flex-col-center tn-flex-row-center">
<view>带关闭按钮</view>
<view class="tn-icon-close tn-margin-left-xs"></view>
</view>
</tn-tag>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicTag',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.basic-tag {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
.origin-demo {
width: 180rpx;
height: 180rpx;
background-color: #FFFFFF;
margin: 20rpx;
margin-right: 70rpx;
position: relative;
&__tag {
position: absolute;
top: 0;
right: 0;
transform: translate(50%, -50%);
}
}
</style>
+261
View File
@@ -0,0 +1,261 @@
<template>
<view class="basic-test">
<swiper class="swiper" :circular="true" :current="currentSwiperIndex" previous-margin="260rpx" next-margin="260rpx" @change="swiperChange">
<swiper-item v-for="(item, index) in swiperList" :key="index" class="swiper__item" :class="[swiperItemClass(index)]">
<view class="swiper__item__content" :class="[swiperContentClass(index)]">
<image :src="item" mode="scaleToFill"></image>
</view>
</swiper-item>
</swiper>
<swiper class="phone-swiper" :circular="true"
:current="phoneCurrentSwiperIndex" previous-margin="190rpx" next-margin="190rpx" @change="phoneSwiperChange">
<swiper-item v-for="(item,index) in phoneSwiperList" :key="index" class="phone-swiper__item">
<view class="tnphone-black-min phone-swiper__item__content wow fadeInLeft2" :class="[phoneSwiperContentClass(index)]">
<view class="skin wow fadeInRight2">
<view class="screen wow fadeInUp2">
<view class="peak wow">
<view class="sound"></view>
<view class="lens"></view>
</view>
<view class="demo-image">
<image :src="item.url" mode="aspectFill"></image>
</view>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
</template>
<script>
export default {
name: 'TestPage',
data() {
return {
swiperList: [
'https://tnuiimage.tnkjapp.com/swiper/spring.jpg',
'https://tnuiimage.tnkjapp.com/swiper/summer.jpg',
'https://tnuiimage.tnkjapp.com/swiper/autumn.jpg',
'https://tnuiimage.tnkjapp.com/swiper/winter.jpg',
'https://tnuiimage.tnkjapp.com/swiper/winter.jpg'
],
phoneSwiperList: [{
id: 0,
type: 'image',
name: '总有你想不到的创意',
text: '海量分享',
url: 'https://tnuiimage.tnkjapp.com/swiper/test.jpg',
pngurl: 'https://tnuiimage.tnkjapp.com/swiper/c4d1.png'
}, {
id: 1,
type: 'image',
name: '寻找一起成长的小伙伴',
text: '愉快玩耍',
url: 'https://tnuiimage.tnkjapp.com/swiper/banner-animate.png',
pngurl: 'https://tnuiimage.tnkjapp.com/swiper/c4d4.png'
}, {
id: 2,
type: 'image',
name: '更多彩蛋等你探索',
text: '酷炫多彩',
url: 'https://tnuiimage.tnkjapp.com/swiper/test.jpg',
pngurl: 'https://tnuiimage.tnkjapp.com/swiper/c4d5.png'
}, {
id: 3,
type: 'image',
name: '更多彩蛋等你探索',
text: '酷炫多彩',
url: 'https://tnuiimage.tnkjapp.com/swiper/banner-animate.png',
pngurl: 'https://tnuiimage.tnkjapp.com/swiper/c4d5.png'
}],
currentSwiperIndex: 0,
phoneCurrentSwiperIndex: 0
}
},
computed: {
// 计算当前对应轮播前后的item对应的类
swiperItemClass() {
return (index) => {
if ((this.currentSwiperIndex === 0 && index === this.swiperList.length - 1) || (this.currentSwiperIndex - 1 === index)) {
return 'swiper__item--prev'
}
if ((this.currentSwiperIndex === this.swiperList.length - 1 && index === 0) || (this.currentSwiperIndex + 1 === index)) {
return 'swiper__item--next'
}
if (this.currentSwiperIndex === index) {
return 'swiper__item--current'
}
}
},
// 计算轮播内容对应的类
swiperContentClass() {
return (index) => {
if (this.currentSwiperIndex === index) {
return 'swiper__item__content--current'
}
if ((this.currentSwiperIndex === 0 && index === this.swiperList.length - 1) || (this.currentSwiperIndex - 1 === index)) {
return 'swiper__item__content--prev'
}
if ((this.currentSwiperIndex === this.swiperList.length - 1 && index === 0) || (this.currentSwiperIndex + 1 === index)) {
return 'swiper__item__content--next'
}
}
},
// 计算轮播内容对应的类
phoneSwiperContentClass() {
return (index) => {
if (this.phoneCurrentSwiperIndex === index) {
return 'phone-swiper__item__content--current'
}
if ((this.phoneCurrentSwiperIndex === 0 && index === this.phoneSwiperList.length - 1) || (this.phoneCurrentSwiperIndex - 1 === index)) {
return 'phone-swiper__item__content--prev'
}
if ((this.phoneCurrentSwiperIndex === this.phoneSwiperList.length - 1 && index === 0) || (this.phoneCurrentSwiperIndex + 1 === index)) {
return 'phone-swiper__item__content--next'
}
}
}
},
onReady() {
},
methods: {
// 轮播图切换
swiperChange(e) {
// console.log(e.detail.current);
this.currentSwiperIndex = e.detail.current
},
phoneSwiperChange(e) {
this.phoneCurrentSwiperIndex = e.detail.current
}
}
}
</script>
<style lang="scss" scoped>
.basic-test {
min-height: 100vh;
}
.swiper {
width: 100%;
height: 400rpx;
/deep/ .uni-swiper-slides {
inset: 0 260rpx;
}
&__item {
&--prev {
left: -10rpx;
}
&--next {
left: 10rpx;
}
&--current {
left: 0px;
}
&__content {
width: 100%;
height: 100%;
margin: 0 auto;
border-radius: 30rpx;
overflow: hidden;
transition: transform 0.25s ease;
transform: scale(0.8);
&--prev {
transform: scale(0.8) perspective(200rpx) rotateY(10deg);
}
&--next {
transform: scale(0.8) perspective(200rpx) rotateY(-10deg);
}
&--current {
transform: scale(1);
}
image {
width: 100%;
height: 100%;
}
}
}
}
.phone-swiper {
margin-top: 180rpx;
height: 900rpx;
/deep/ .uni-swiper-slides {
inset: 0 190rpx;
}
&__item {
&__content {
transition: transform 0.25s ease;
transform: scale(0.8);
&--prev {
transform: scale(0.8) perspective(200rpx) rotateY(10deg);
}
&--next {
transform: scale(0.8) perspective(200rpx) rotateY(-10deg);
}
&--current {
transform: scale(1);
}
}
.demo-image {
display: flex;
align-items: center;
justify-content: center;
image {
width: 100%;
height: 730rpx;
}
}
}
}
/* tnphone-black-min 细边框 start */
.tnphone-black-min {width: 380rpx; height: 760rpx; border-radius: 40rpx; background: #C6D1D8; padding: 7rpx; display: table; color: #333;
box-sizing: border-box; box-shadow: 0rpx 0rpx 0rpx 5rpx rgba(80,80,80,.8) inset; cursor: default; position: relative}
.tnphone-black-min .skin {width: 100%; height: 100%; border-radius: 40rpx; background: #222; padding: 10rpx; box-shadow: 0rpx 0rpx 0rpx 7rpx rgba(68,68,68,.3)}
.tnphone-black-min .screen {width: 100%; height: 100%; border-radius: 30rpx; background: #fff; position: relative; overflow: hidden}
.tnphone-black-min .head {width: 100%; height: 90rpx; text-align: center; position: absolute; padding: 45rpx 15rpx 10rpx 15rpx;}
.tnphone-black-min .peak {left: 22%;width: 56%; height: 27rpx; margin: -2rpx auto 0rpx; border-radius: 0 0 20rpx 20rpx; background: #222; position: absolute}
.tnphone-black-min .sound {width: 48rpx; height: 6rpx; border-radius: 15rpx; background: #555; position: absolute; left: 50%; top: 50%; margin-left: -24rpx; margin-top: -10rpx;
box-shadow: 0rpx 4rpx 4rpx 0rpx #444 inset}
.tnphone-black-min .lens {width: 6rpx; height: 6rpx; border-radius: 50%; background: #2c5487; position: absolute; left: 50%; top: 50%; margin-left: 34rpx; margin-top: -10rpx}
.tnphone-black-min .talk {width: 50%; height: 6rpx; border-radius: 15rpx; background: rgba(0,0,0,.3); position: absolute; bottom: 8rpx; left: 50%; margin-left: -25%}
.tnphone-black-min .area-l,.tnphone-black-min .area-r {width: 70rpx; height: 16rpx; position: absolute; top: 6rpx}
.tnphone-black-min .area-l {left: 0; text-align: center; font-size: 12rpx; line-height: 22rpx; text-indent: 10rpx; font-weight: 600; padding-left: 20rpx;}
.tnphone-black-min .area-r {right: 0; text-align: center; font-size: 12rpx; line-height: 22rpx; text-indent: 10rpx; font-weight: 600; padding-right: 20rpx;}
.tnphone-black-min .fa-feed {float: left; font-size: 12rpx!important; transform:rotate(-45deg); margin-top: 4rpx; margin-right: 8rpx}
.tnphone-black-min .fa-battery-full {float: left; font-size: 12rpx!important; margin-top: 6rpx}
.tnphone-black-min .fa-chevron-left {float: left; margin-top: 4rpx}
.tnphone-black-min .fa-cog {float: right; margin-top: 4rpx}
.tnphone-black-min .btn01 {width: 3rpx; height: 28rpx; border-radius: 3rpx 0 0 3rpx; background: #222; position: absolute; top: 105rpx; left: -3rpx}
.tnphone-black-min .btn02 {width: 3rpx; height: 54rpx; border-radius: 3rpx 0 0 3rpx; background: #222; position: absolute; top: 160rpx; left: -3rpx}
.tnphone-black-min .btn03 {width: 3rpx; height: 54rpx; border-radius: 3rpx 0 0 3rpx; background: #222; position: absolute; top: 230rpx; left: -3rpx}
.tnphone-black-min .btn04 {width: 3rpx; height: 86rpx; border-radius: 0 3rpx 3rpx 0; background: #222; position: absolute; top: 180rpx; right: -3rpx}
/* tnphone-black-min 细边框 end */
</style>
+105
View File
@@ -0,0 +1,105 @@
<template>
<view class="basic-utils__color tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Color工具</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="获取内置随机颜色">
<tn-list-view backgroundColor="tn-bg-white">
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view class="bg-color-item" :class="randomBgColorClass">背景颜色</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="getRandomBgColor">获取</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view class="bg-color-item" :class="randomColorClass">文字颜色</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="getRandomColor">获取</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view class="bg-color-item" :class="randomCoolBgColorClass">酷炫背景颜色</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="getRandomCoolColor">获取</tn-button></view>
</view>
</tn-list-cell>
</tn-list-view>
</demo-title>
<demo-title title="hex与rgb互转">
<view class="tn-bg-white">
<tn-form-item>
<view class="tn-margin-left">
<tn-input v-model="hexRGBValue"></tn-input>
</view>
<template slot="right">
<view class="tn-margin-right-sm">
<tn-button size="sm" backgroundColor="#01BEFF" fontColor="#FFFFFF" @click="convertToRGBOrHex">{{ rgbFlag ? '转换为hex' : '转换为rgb' }}</tn-button>
</view>
</template>
</tn-form-item>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicUtilsColor',
components: {demoTitle},
data() {
return {
randomBgColorClass: '',
randomColorClass: '',
randomCoolBgColorClass: '',
hexRGBValue: '#01BEFF',
rgbFlag: false
}
},
methods: {
// 获取随机背景颜色
getRandomBgColor() {
this.randomBgColorClass = this.$tn.color.getRandomColorClass()
},
// 获取随机颜色
getRandomColor() {
this.randomColorClass = this.$tn.color.getRandomColorClass('color')
},
// 获取随机酷炫背景颜色
getRandomCoolColor() {
this.randomCoolBgColorClass = this.$tn.color.getRandomCoolBgClass()
},
// 将hex与rgb互转
convertToRGBOrHex() {
if (this.rgbFlag) {
this.hexRGBValue = this.$tn.color.rgbToHex(this.hexRGBValue)
} else {
this.hexRGBValue = this.$tn.color.hexToRGB(this.hexRGBValue)
}
this.rgbFlag = !this.rgbFlag
}
}
}
</script>
<style lang="scss" scoped>
.basic-utils__color {
background-color: $tn-bg-gray-color;
min-height: 100vh;
.bg-color-item {
height: 100%;
width: auto;
padding: 10rpx 20rpx;
}
}
</style>
+176
View File
@@ -0,0 +1,176 @@
<template>
<view class="basic-utils__message tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Message工具</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="uni内置toast框">
<tn-list-view backgroundColor="tn-bg-white">
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>默认toast框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openToast_1">弹出</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>带图标 toast框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openToast_2">弹出</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>带透明mask toast框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openToast_3">弹出</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>设置时间 toast框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openToast_4">弹出</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>设置回调 toast框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openToast_5">弹出</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>关闭 toast框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="closeToast">关闭</tn-button></view>
</view>
</tn-list-cell>
</tn-list-view>
</demo-title>
<demo-title title="uni内置loading框">
<tn-list-view backgroundColor="tn-bg-white">
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>弹出loading框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openLoading">弹出</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>关闭loading框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="closeLoading">关闭</tn-button></view>
</view>
</tn-list-cell>
</tn-list-view>
</demo-title>
<demo-title title="uni内置modal框">
<tn-list-view backgroundColor="tn-bg-white">
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>默认modal框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openModal_1">弹出</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>隐藏取消按钮 modal框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openModal_2">弹出</tn-button></view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>修改文字 modal框</view>
<view><tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm" @click="openModal_3">弹出</tn-button></view>
</view>
</tn-list-cell>
</tn-list-view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicUtilsMessage',
components: {demoTitle},
data() {
return {
}
},
methods: {
// 弹出toast
openToast_1() {
this.$tn.message.toast('弹出toast')
},
openToast_2() {
this.$tn.message.toast('弹出toast icon', false, null, 'success')
},
openToast_3() {
this.$tn.message.toast('弹出toast mask', true)
},
openToast_4() {
this.$tn.message.toast('弹出toast duration', false, null, 'none', 3000)
},
openToast_5() {
this.$tn.message.toast('弹出toast cb', true, () => {
setTimeout(() => {
this.$tn.message.toast('执行完毕后弹出', true, null, 'success')
}, 500)
})
},
// 关闭Toast
closeToast() {
this.$tn.message.closeToast()
},
// 弹出loading
openLoading() {
this.$tn.message.loading('弹出loading')
setTimeout(() => {
this.closeLoading()
}, 3000)
},
// 关闭loading
closeLoading() {
this.$tn.message.closeLoading()
},
// 弹出modal
openModal_1() {
this.$tn.message.modal("提示", "请进行登录后进行操作", () => {
this.$tn.message.toast('点击了确认按钮')
}, true, () => {
this.$tn.message.toast('点击了取消按钮')
})
},
openModal_2() {
this.$tn.message.modal("提示", "请进行登录后进行操作", () => {
this.$tn.message.toast('点击了确认按钮')
}, false, null)
},
openModal_3() {
this.$tn.message.modal("提示", "请进行登录后进行操作", () => {
this.$tn.message.toast('点击了跳转按钮')
}, true, () => {
this.$tn.message.toast('点击了拒绝按钮')
}, "跳转登录", "拒绝登录")
}
}
}
</script>
<style lang="scss" scoped>
.basic-utils__message {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
</style>
+159
View File
@@ -0,0 +1,159 @@
<template>
<view class="basic-utils__number tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Number工具</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="超过指定长度自动添加'+'号">
<tn-list-view backgroundColor="tn-bg-white">
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>超过2位自动添加'+'</view>
<view>{{ $tn.number.formatNumberString(56) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>超过2位自动添加'+'</view>
<view>{{ $tn.number.formatNumberString(100) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>超过3位自动添加'+'</view>
<view>{{ $tn.number.formatNumberString(899, 3) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>超过3位自动添加'+'</view>
<view>{{ $tn.number.formatNumberString(1000, 3) }}</view>
</view>
</tn-list-cell>
</tn-list-view>
</demo-title>
<demo-title title="往数字前添加'0'">
<tn-list-view backgroundColor="tn-bg-white">
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>只有一位时会往前面添加'0'</view>
<view>{{ $tn.number.formatNumberAddZero(6) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>超过两位时不会往前面添加'0'</view>
<view>{{ $tn.number.formatNumberAddZero(16) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>超过两位时不会往前面添加'0'</view>
<view>{{ $tn.number.formatNumberAddZero(106) }}</view>
</view>
</tn-list-cell>
</tn-list-view>
</demo-title>
<demo-title title="数值转换为带单位金额">
<tn-list-view backgroundColor="tn-bg-white">
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>不带单位</view>
<view>{{ $tn.number.formatNumberAddPriceUnit(100) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>不带单位</view>
<view>{{ $tn.number.formatNumberAddPriceUnit(100.88) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>带K单位</view>
<view>{{ $tn.number.formatNumberAddPriceUnit(1000) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>带K单位</view>
<view>{{ $tn.number.formatNumberAddPriceUnit(1032.89) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>带W单位</view>
<view>{{ $tn.number.formatNumberAddPriceUnit(10000) }}</view>
</view>
</tn-list-cell>
<tn-list-cell>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view>带W单位</view>
<view>{{ $tn.number.formatNumberAddPriceUnit(10875.90) }}</view>
</view>
</tn-list-cell>
</tn-list-view>
</demo-title>
<demo-title title="获取随机值">
<view class="tn-bg-white">
<tn-form-item>
<view class="tn-margin-left"><tn-input v-model="randomValue" :disabled="true"></tn-input></view>
<template slot="right">
<view class="tn-margin-right-sm">
<tn-button size="sm" backgroundColor="#01BEFF" fontColor="#FFFFFF" @click="getRandomValue">获取随机值</tn-button>
</view>
</template>
</tn-form-item>
<tn-form-item>
<view class="tn-margin-left"><tn-input v-model="intRandomValue" :disabled="true"></tn-input></view>
<template slot="right">
<view class="tn-margin-right-sm">
<tn-button size="sm" backgroundColor="#01BEFF" fontColor="#FFFFFF" @click="getIntRandomValue">获取整数随机值</tn-button>
</view>
</template>
</tn-form-item>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicUtilsNumber',
components: {demoTitle},
data() {
return {
randomValue: '',
intRandomValue: '',
}
},
methods: {
// 获取随机值
getRandomValue() {
this.randomValue = this.$tn.number.random(0, 100.99)
},
// 获取整数随机值
getIntRandomValue() {
this.intRandomValue = this.$tn.number.randomInt(0, 100)
}
}
}
</script>
<style lang="scss" scoped>
.basic-utils__number {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
</style>
+89
View File
@@ -0,0 +1,89 @@
<template>
<view class="basic-utils__string tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>String工具</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="去除空格">
<view class="tn-bg-white">
<tn-form-item>
<tn-input v-model="trimValue" :trim="false"></tn-input>
<template slot="right">
<view class="tn-margin-right-sm">
<tn-button size="sm" backgroundColor="#01BEFF" fontColor="#FFFFFF" @click="handlerTrim">清除空格</tn-button>
</view>
</template>
</tn-form-item>
</view>
</demo-title>
<demo-title title="大写转指定连接符">
<view class="tn-bg-white">
<tn-form-item>
<tn-input v-model="humpCharValue"></tn-input>
<template slot="right">
<view class="tn-margin-right-sm">
<tn-button size="sm" backgroundColor="#01BEFF" fontColor="#FFFFFF" @click="handlerHumpChar">转换</tn-button>
</view>
</template>
</tn-form-item>
</view>
</demo-title>
<demo-title title="将自定的连接符转为大写">
<view class="tn-bg-white">
<tn-form-item>
<tn-input v-model="charHumpValue"></tn-input>
<template slot="right">
<view class="tn-margin-right-sm">
<tn-button size="sm" backgroundColor="#01BEFF" fontColor="#FFFFFF" @click="handlerCharHump">转换</tn-button>
</view>
</template>
</tn-form-item>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'basicUtilsString',
components: {demoTitle},
data() {
return {
trimValue: ' 前后都有空格啊 ',
humpCharValue: 'TuniaoUI',
charHumpValue: 'Tuniao_u_i'
}
},
methods: {
// 处理去除空格
handlerTrim() {
this.trimValue = this.$tn.string.trim(this.trimValue)
},
// 处理将大写字符串转换为指定的连接符连接的字符串
handlerHumpChar() {
this.humpCharValue = this.$tn.string.humpConvertChar(this.humpCharValue, '_')
},
// 处理将指定的连接字符连接的字符串转换为大写的字符串
handlerCharHump() {
this.charHumpValue = this.$tn.string.charConvertHump(this.charHumpValue, '_')
}
}
}
</script>
<style lang="scss" scoped>
.basic-utils__string {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
</style>
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
baseUrl: 'http://api.youzixy.com'
}
@@ -0,0 +1,139 @@
<template>
<view class="components-action_sheet">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>操作菜单</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="demoTips" :sectionList="sectionList" :full="false" @click="click">
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showActionSheet">弹出ActionSheet</tn-button>
</dynamic-demo-template>
</view>
<!-- actionSheet -->
<tn-action-sheet
v-model="show"
:tips="tips"
:list="list"
:borderRadius="borderRadius"
:cancelBtn="cancelBtn"
:maskCloseable="maskCloseable"
@click="clickActionSheetItem"
@close="closedActionSheet"
>
</tn-action-sheet>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsActionSheet',
components: {dynamicDemoTemplate},
data() {
return {
show: false,
tips: {
text: '请选择正确的答案',
fontSize: 26
},
list: [
{
text: 'A'
},
{
text: 'B',
subText: '这是正确答案'
},
{
text: 'C',
disabled: true
},
{
text: 'D'
}
],
borderRadius: 0,
cancelBtn: true,
maskCloseable: true,
demoTips: ['无需依赖额外的样式文件','使用tn-action-sheet组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '显示取消按钮',
optional: ['是','否'],
methods: 'cancelBtnChange'
},
{
title: '设置圆角',
optional: ['0','23'],
methods: 'borderRadiusChange'
},
{
title: '点击遮罩关闭',
optional: ['是','否'],
methods: 'maskCloseableChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出ActionSheet
showActionSheet() {
this.openActionSheet()
},
// 切换圆角
borderRadiusChange(event) {
this.borderRadius = Number(event.name)
this.openActionSheet()
},
// 切换关闭按钮
cancelBtnChange(event) {
this.cancelBtn = event.index === 0 ? true : false
this.openActionSheet()
},
// 切换点击遮罩关闭
maskCloseableChange(event) {
this.maskCloseable = event.index === 0 ? true : false
this.openActionSheet()
},
// 点击了选项
clickActionSheetItem(index) {
if (index === 1) {
this.$tn.message.toast('选择正确')
}
this.closedActionSheet()
},
// 打开actionSheet
openActionSheet() {
this.show = true
},
// 关闭actionSheet
closedActionSheet() {
this.show = false
}
},
}
</script>
<style lang="scss" scoped>
</style>
+213
View File
@@ -0,0 +1,213 @@
<template>
<view class="components-calendar">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Calendar日历</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 class="tn-flex tn-flex-wrap tn-flex-col-center tn-flex-row-center">
<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>
</view>
</dynamic-demo-template>
</view>
<!-- Calendar -->
<tn-calendar
v-if="show"
v-model="show"
:mode="mode"
:showLunar="showLunar"
:activeBgColor="activeBgColor"
:activeColor="activeColor"
:rangeBgColor="rangeBgColor"
:rangeColor="rangeColor"
:btnColor="btnColor"
:lunarColor="lunarColor"
:startText="startText"
:endText="endText"
:toolTips="toolTips"
:changeYear="changeYear"
:changeMonth="changeMonth"
@change="onChange"
></tn-calendar>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsCalendar',
components: {dynamicDemoTemplate},
data() {
return {
show: false,
mode: 'date',
showLunar: true,
activeBgColor: '#01BEFF',
activeColor: '#FFFFFF',
rangeBgColor: '#E6E6E655',
rangeColor: '#01BEFF',
btnColor: '#01BEFF',
lunarColor: '#AAAAAA',
startText: '开始',
endText: '结束',
toolTips: '请选择日期',
changeYear: true,
changeMonth: true,
result: '',
tips: ['无需依赖额外的样式文件','使用tn-calendar组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '模式',
optional: ['单个日期','日期范围'],
methods: 'modeChange'
},
{
title: '农历显示',
optional: ['显示','隐藏'],
methods: 'showLunarChange'
},
{
title: '自定义颜色',
optional: ['默认','自定义'],
methods: 'colorChange'
},
{
title: '自定义文案',
optional: ['默认','自定义'],
methods: 'textChange'
},
{
title: '年月切换',
optional: ['年月切换','月切换'],
methods: 'yearMonthChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出日历
showCalendar() {
this.openCalendar()
},
// 切换模式
modeChange(event) {
switch (event.index) {
case 0:
this.mode = 'date'
break
case 1:
this.mode = 'range'
}
this.openCalendar()
},
// 切换农历显示
showLunarChange(event) {
this.showLunar = event.index === 0 ? true : false
this.openCalendar()
},
// 切换颜色
colorChange(event) {
switch (event.index) {
case 0:
this.activeBgColor = '#01BEFF'
this.activeColor = '#FFFFFF'
this.rangeBgColor = '#E6E6E655'
this.rangeColor = '#01BEFF'
this.btnColor = '#01BEFF'
this.lunarColor = '#AAAAAA'
break
case 1:
this.activeBgColor = '#E83A30'
this.activeColor = '#FFFFFF'
this.rangeBgColor = '#E6E6E680'
this.rangeColor = '#E72F8C'
this.btnColor = '#E83A30'
this.lunarColor = '#080808'
break
}
this.openCalendar()
},
// 切换文案
textChange(event) {
switch (event.index) {
case 0:
this.startText = '开始'
this.endText = '结束'
this.toolTips = '请选择日期'
break
case 1:
this.startText = '入住'
this.endText = '离店'
this.toolTips = '入住/离店日期'
break
}
this.openCalendar()
},
// 切换年月
yearMonthChange(event) {
switch (event.index) {
case 0:
this.changeYear = true
this.changeMonth = true
break
case 1:
this.changeYear = false
this.changeMonth = true
break
}
this.openCalendar()
},
// 打开日历
openCalendar() {
this.show = true
},
// 日历日期有改变
onChange(event) {
if (this.mode === 'date') {
this.result = event.date
}
if (this.mode === 'range') {
this.result = `${event.startDate}${event.endDate}`
}
this.$refs.demoTemplate.updateSectionScrollView()
}
},
}
</script>
<style lang="scss" scoped>
.calendar-result {
width: 100%;
margin-top: 20rpx;
padding: 10rpx 30rpx;
background-color: $tn-font-holder-color;
text-align: center;
}
</style>
+95
View File
@@ -0,0 +1,95 @@
<template>
<view class="components-check-box tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>按钮</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基础">
<tn-checkbox v-model="value1" name="选项1">选项1</tn-checkbox>
<tn-checkbox v-model="value1" name="选项2" disabled>选项2(不可点击)</tn-checkbox>
</demo-title>
<demo-title title="圆形选框">
<tn-checkbox-group shape="circle">
<tn-checkbox name="选项1">选项1</tn-checkbox>
<tn-checkbox name="选项2">选项2</tn-checkbox>
<tn-checkbox name="选项3">选项3</tn-checkbox>
</tn-checkbox-group>
</demo-title>
<demo-title title="竖直排列">
<tn-checkbox-group width="100%" wrap>
<tn-checkbox name="选项1">选项1</tn-checkbox>
<tn-checkbox name="选项2">选项2</tn-checkbox>
<tn-checkbox name="选项3">选项3</tn-checkbox>
</tn-checkbox-group>
</demo-title>
<demo-title title="禁止点击标签">
<tn-checkbox-group disabledLabel>
<tn-checkbox name="选项1">选项1</tn-checkbox>
<tn-checkbox name="选项2">选项2</tn-checkbox>
<tn-checkbox name="选项3">选项3</tn-checkbox>
</tn-checkbox-group>
</demo-title>
<demo-title title="自定义尺寸">
<view>
<tn-checkbox-group :size="26" :iconSize="18">
<tn-checkbox name="选项1">选项1</tn-checkbox>
<tn-checkbox name="选项2">选项2</tn-checkbox>
<tn-checkbox name="选项3" :size="36" :iconSize="30">选项3</tn-checkbox>
</tn-checkbox-group>
</view>
<view class="tn-margin-top">
<tn-checkbox-group :size="46" :iconSize="40">
<tn-checkbox name="选项1">选项1</tn-checkbox>
<tn-checkbox name="选项2">选项2</tn-checkbox>
<tn-checkbox name="选项3">选项3</tn-checkbox>
</tn-checkbox-group>
</view>
</demo-title>
<demo-title title="自定义颜色">
<tn-checkbox-group activeColor="#31E749">
<tn-checkbox name="选项1">选项1</tn-checkbox>
<tn-checkbox name="选项2">选项2</tn-checkbox>
<tn-checkbox name="选项3" activeColor="#E83A30">选项3</tn-checkbox>
</tn-checkbox-group>
</demo-title>
<demo-title title="自定义图标">
<tn-checkbox-group>
<tn-checkbox name="选项1" iconName="star">选项1</tn-checkbox>
<tn-checkbox name="选项2" iconName="fire">选项2</tn-checkbox>
<tn-checkbox name="选项3" iconName="like">选项3</tn-checkbox>
</tn-checkbox-group>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'ComponentsCheckBox',
components: {demoTitle},
data() {
return {
value1: false,
value2: false
}
}
}
</script>
<style lang="scss" scoped>
</style>
+119
View File
@@ -0,0 +1,119 @@
<template>
<view class="components-collapse tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Collapse折叠面板</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</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>
</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>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsCollapse',
components: {demoTitle},
data() {
return {
list: [
{
title: '关雎',
content: '关关雎鸠,在河之洲。窈窕淑女,君子好逑。参差荇菜,左右流之。窈窕淑女,寤寐求之。求之不得,寤寐思服。悠哉悠哉,辗转反侧。参差荇菜,左右采之。窈窕淑女,琴瑟友之。参差荇菜,左右芼之。窈窕淑女,钟鼓乐之。'
},
{
title: '长歌行',
content: '青青园中葵,朝露待日晞。阳春布德泽,万物生光辉。常恐秋节至,焜黄华叶衰。百川东到海,何时复西归?少壮不努力,老大徒伤悲!'
},
{
title: '秋风辞',
content: '秋风起兮白云飞,草木黄落兮雁南归。兰有秀兮菊有芳,怀佳人兮不能忘。泛楼船兮济汾河,横中流兮扬素波。少壮几时兮奈老何!'
}
],
headStyle: {
backgroundColor: '#EFEFEF'
},
bodyStyle: {
backgroundColor: '#EFEFEF'
},
itemStyle: {
backgroundColor: '#EFEFEF',
borderRadius: '20rpx',
overflow: 'hidden'
}
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-collapse {
background-color: $tn-bg-gray-color;
}
</style>
+78
View File
@@ -0,0 +1,78 @@
<template>
<view class="components-count_down tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>countdown倒计时</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsCountDown',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-count_down {
min-height: 100vh;
}
</style>
@@ -0,0 +1,68 @@
<template>
<view class="components-count_scroll tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>countScroll数字滚动</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsCountTo',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-count_scroll {
min-height: 100vh;
}
</style>
+68
View File
@@ -0,0 +1,68 @@
<template>
<view class="components-count_to tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>countTo数字跳转</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsCountTo',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-count_to {
min-height: 100vh;
}
</style>
+101
View File
@@ -0,0 +1,101 @@
<template>
<view class="components-empty tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>空页面</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="内置图标">
<block v-for="(item, index) in inlineMode" :key="index">
<view class="empty__item">
<tn-empty :mode="item"></tn-empty>
</view>
</block>
</demo-title>
<demo-title title="自定义图标">
<view class="empty__item">
<tn-empty icon="moon-fill" text="夜深人静"></tn-empty>
</view>
</demo-title>
<demo-title title="自定义图片">
<view class="empty__item">
<tn-empty icon="https://tnuiimage.tnkjapp.com/empty/alien/2.png" text="空空如也"></tn-empty>
</view>
<block v-for="(value, key, index) in imgEmpty" :key="index">
<view class="empty__item">
<tn-empty :icon="value" :mode="key"></tn-empty>
</view>
</block>
</demo-title>
<demo-title title="隐藏文字">
<view class="empty__item">
<tn-empty icon="https://tnuiimage.tnkjapp.com/empty/alien/2.png" mode=""></tn-empty>
</view>
<view class="empty__item tn-margin-top">
<tn-empty icon="help" mode=""></tn-empty>
</view>
</demo-title>
<demo-title title="带跳转按钮">
<view class="empty__item">
<tn-empty icon="moon-fill" text="夜深人静">
<tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm">看看小视频</tn-button>
</tn-empty>
</view>
</demo-title>
<demo-title title="自定义样式">
<view class="empty__item">
<tn-empty icon="moon-fill" text="夜深人静" :iconSize="120" :textSize="34" iconColor="#E6E6E6" textColor="#C6D1D8"></tn-empty>
</view>
<view class="empty__item tn-margin-top">
<tn-empty icon="https://tnuiimage.tnkjapp.com/empty/alien/2.png" text="空空如也" :imgWidth="200" :imgHeight="200"></tn-empty>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'ComponentsEmpty',
components: { demoTitle },
data() {
return {
inlineMode: ['cart','page','search','address','network','order','coupon','favor','permission','history','message','list','data','comment'],
imgEmpty: {
cart: '/componentsPage/static/images/empty/cart.jpg',
comment: '/componentsPage/static/images/empty/comment.jpg',
data: '/componentsPage/static/images/empty/data.jpg',
network: '/componentsPage/static/images/empty/network.jpg',
page: '/componentsPage/static/images/empty/page.jpg',
permission: '/componentsPage/static/images/empty/permission.jpg',
search: '/componentsPage/static/images/empty/search.jpg'
}
}
}
}
</script>
<style lang="scss" scoped>
.components-empty {
background-color: $tn-bg-gray-color;
}
.empty {
&__item {
background-color: #FFFFFF;
padding: 20rpx 0;
}
}
</style>
+196
View File
@@ -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.$tn.message.toast(`点击了第 ${e.index} 个选项`)
}
}
}
</script>
<style lang="scss" scoped>
</style>
+523
View File
@@ -0,0 +1,523 @@
<template>
<view class="components-form">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Form表单</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" :fullWindowsScroll="true" @click="click">
<tn-form :model="model" ref="form" :errorType="errorType" :labelPosition="labelPosition" :labelWidth="labelWidth" :labelAlign="labelAlign">
<tn-form-item label="姓名" prop="name" leftIcon="identity" :required="true" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.name" type="text" placeholder="请输入姓名" :border="border"></tn-input>
</tn-form-item>
<tn-form-item label="性别" prop="sex" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.sex" type="select" placeholder="请选择性别" :border="border" :selectOpen="actionSheetShow" @click="actionSheetShow = true"></tn-input>
</tn-form-item>
<tn-form-item label="手机号码" prop="phone" rightIcon="phone" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.phone" type="number" placeholder="请输入手机号码" :border="border"></tn-input>
</tn-form-item>
<tn-form-item label="介绍" prop="desc" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.desc" type="textarea" placeholder="请输入介绍" :border="border" inputAlign="center"></tn-input>
</tn-form-item>
<tn-form-item label="密码" prop="password" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.password" type="password" placeholder="请输入密码" :border="border" :passwordIcon="true"></tn-input>
</tn-form-item>
<tn-form-item label="确认密码" prop="rePassword" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.rePassword" type="password" placeholder="请再次输入密码" :border="border"></tn-input>
</tn-form-item>
<tn-form-item label="水果" prop="fruit" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-checkbox-group v-model="model.fruit" :width="checkboxWidth" :wrap="checkboxWrap" @change="checkboxGroupChange">
<tn-checkbox v-for="(item, index) in checkboxList" :key="index" v-model="item.check" :name="item.name" :disabled="item.disabled">{{ item.name }}</tn-checkbox>
</tn-checkbox-group>
</tn-form-item>
<tn-form-item label="支付方式" prop="payType" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-radio-group v-model="model.payType" :width="radioWidth" :wrap="radioWrap" @change="radioGroupChange">
<tn-radio v-for="(item, index) in radioList" :key="index" :name="item.name" :disabled="item.disabled">{{ item.name }}</tn-radio>
</tn-radio-group>
</tn-form-item>
<tn-form-item label="所在地区" prop="region" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.region" type="select" placeholder="请选择所在地区" :border="border" :selectOpen="pickerShow" @click="pickerShow = true"></tn-input>
</tn-form-item>
<tn-form-item label="商品类型" prop="goodsType" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.goodsType" type="select" placeholder="请选择商品类型" :border="border" :selectOpen="selectShow" @click="selectShow = true"></tn-input>
</tn-form-item>
<tn-form-item label="验证码" prop="code" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-input v-model="model.code" type="text" placeholder="请输入验证码" :border="border"></tn-input>
<tn-button slot="right" size="sm" backgroundColor="tn-bg-green" fontColor="tn-color-white" @click="getCode">{{ codeTips }}</tn-button>
</tn-form-item>
<tn-form-item label="记住密码" prop="remember" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-switch v-model="model.remember" slot="right"></tn-switch>
</tn-form-item>
<tn-form-item label="上传图片" prop="photo" :labelPosition="labelPosition" :labelAlign="labelAlign">
<tn-image-upload :fileList="model.photo" @on-list-change="imageUploadChange"></tn-image-upload>
</tn-form-item>
</tn-form>
<view class="agreement">
<tn-checkbox v-model="model.agreement" @change="agreementCheckChange"></tn-checkbox>
<view class="agreement-text">勾选同意当前协议</view>
</view>
<tn-button backgroundColor="#01BEFF" fontColor="#FFFFFF" width="100%" @click="submit">提交</tn-button>
</dynamic-demo-template>
<!-- 性别选项 -->
<tn-action-sheet
v-model="actionSheetShow"
:list="actionSheetList"
@click="actionSheetClick"
></tn-action-sheet>
<!-- 地区picker -->
<tn-picker
v-model="pickerShow"
mode="region"
@confirm="regionPickerConfirm"
></tn-picker>
<!-- 商品类型select -->
<tn-select
v-model="selectShow"
mode="single"
:list="selectList"
@confirm="goodsTypeSelectConfirm"
></tn-select>
<!-- 验证码倒计时 -->
<tn-verification-code
ref="code"
:seconds="60"
@change="codeChange"
></tn-verification-code>
</view>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsForm',
components: {dynamicDemoTemplate},
data() {
return {
errorType: ['message','border-bottom','toast'],
labelPosition: 'left',
labelAlign: 'right',
border: false,
actionSheetShow: false,
labelWidth: 140,
checkboxWidth: 'auto',
checkboxWrap: false,
radioWidth: 'auto',
radioWrap: false,
pickerShow: false,
selectShow: false,
codeTips: '获取验证码',
checkboxList:[
{
name: '苹果',
disabled: false
},
{
name: '橘子',
disabled: false
},
{
name: '香蕉',
disabled: false
},
{
name: '榴莲',
disabled: true
}
],
radioList:[
{
name: '微信',
disabled: false
},
{
name: '支付宝',
disabled: true
},
{
name: '云闪付',
disabled: false
}
],
actionSheetList:[
{
text: '男'
},
{
text: '女'
},
{
text: '保密'
}
],
selectList: [
{
label: '手机',
value: 1101
},
{
label: '笔记本',
value: 1102
},
{
label: '手表',
value: 1103
}
],
model: {
name: '',
sex: '',
phone: '',
desc: '',
password: '',
rePassword: '',
fruit: ['橘子'],
payType: '微信',
region: '',
goodsType: '',
code: '',
remember: false,
photo: [],
agreement: false
},
rules: {
name: [
{
required: true,
message: '请输入用户名',
trigger: 'blur'
},
{
min: 3,
max: 5,
message: '姓名长度在3到5个字符',
trigger: ['change','blur'],
},
{
// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
validator: (rule, value, callback) => {
return this.$tn.test.chinese(value);
},
message: '姓名必须为中文',
// 触发器可以同时用blur和change,二者之间用英文逗号隔开
trigger: ['change','blur'],
},
{
// 异步验证需要通过调用callback(),并且在里面抛出new Error()
// 抛出的内容为需要提示的信息,和其他方式的message属性的提示一样
asyncValidator: (rule, value, callback) => {
if (value === '图鸟') {
callback(new Error('姓名重复'));
} else {
// 没有错误,也要执行callback()回调
callback();
}
},
trigger: ['blur'],
}
],
sex: [
{
required: true,
message: '请选择性别',
trigger: 'change'
}
],
phone: [
{
required: true,
message: '请输入手机号码',
trigger: 'change'
}
],
desc: [
{
min: 5,
message: '简介不能少于5个字',
trigger: 'change'
},
{
// 正则表达式验证演示
pattern: /^[\u4e00-\u9fa5]+$/gi,
message: '简介只能包含中文',
trigger: 'change'
}
],
password: [
{
required: true,
message: '请输入密码',
trigger: ['change','blur']
},
{
pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+\S{5,12}$/,
message: '需同时含有字母和数字,长度在6-12之间',
trigger: ['change','blur']
}
],
rePassword: [
{
required: true,
message: '请再次输入密码',
trigger: ['change','blur']
},
{
validator: (rule, value, callback) => {
return value === this.model.password;
},
message: '两次输入的密码不相等',
trigger: ['change','blur'],
}
],
fruit: [
{
required: true,
message: '请选择水果',
trigger: 'change',
type: 'array'
}
],
payType: [
{
required: true,
message: '请选择支付方式',
trigger: 'change'
}
],
region: [
{
required: true,
message: '所在地区不能为空',
trigger: 'change'
}
],
goodsType: [
{
required: true,
message: '商品类型不能为空',
trigger: 'change'
}
],
code: [
{
required: true,
message: '验证码不能为空',
trigger: 'change'
}
],
remember: [
{
required: true,
message: '记住密码不能为空',
trigger: 'change'
}
],
photo: [
{
required: true,
message: '请选择图片',
trigger: 'change',
type: 'array'
}
],
},
tips: ['无需依赖额外的样式文件','使用tn-toast组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: 'label显示位置',
optional: ['左边','上边'],
methods: 'labelPositionChange'
},
{
title: 'label对齐方式',
optional: ['左对齐','右对齐','居中'],
methods: 'labelAlignChange',
current: 1
},
{
title: '边框显示',
optional: ['显示','隐藏'],
methods: 'borderChange',
current: 1
},
{
title: '可选项排列方式',
optional: ['默认','宽度的50%','换行'],
methods: 'checkRadioStyleChange'
},
{
title: '错误提示方式',
optional: ['message','toast','下划线','输入框'],
methods: 'errorTypeChange'
}
]
}
]
}
},
onReady() {
this.$refs.form.setRules(this.rules)
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 切换label显示位置
labelPositionChange(event) {
switch (event.index) {
case 0:
this.labelPosition = 'left'
break
case 1:
this.labelPosition = 'top'
break
}
},
// 切换label对其方式
labelAlignChange(event) {
switch (event.index) {
case 0:
this.labelAlign = 'left'
break
case 1:
this.labelAlign = 'right'
break
case 2:
this.labelAlign = 'center'
break
}
},
// 切换边框显示
borderChange(event) {
this.border = event.index === 0 ? true : false
},
// 切换可选项样式
checkRadioStyleChange(event) {
switch (event.index) {
case 0:
this.checkboxWidth = 'auto'
this.checkboxWrap = false
this.radioWidth = 'auto'
this.radioWrap = false
break
case 1:
this.checkboxWidth = '50%'
this.checkboxWrap = false
this.radioWidth = '50%'
this.radioWrap = false
break
case 2:
this.checkboxWidth = 'auto'
this.checkboxWrap = true
this.radioWidth = 'auto'
this.radioWrap = true
break
}
},
// 切换错误提示方式
errorTypeChange(event) {
switch (event.index) {
case 0:
this.errorType = ['message']
break
case 1:
this.errorType = ['toast']
break
case 2:
this.errorType = ['border-bottom']
break
case 3:
this.errorType = ['border']
break
}
},
// 表单提交
submit() {
this.$refs.form.validate(valid => {
if (valid) {
// 验证通过
if (!this.model.agreement) {
this.$tn.message.toast('请勾选协议')
return
}
} else {
// 验证失败
}
})
},
// 点击actionSheet选择性别
actionSheetClick(index) {
uni.hideKeyboard()
this.model.sex = this.actionSheetList[index].text
},
// 点击地区选择器
regionPickerConfirm(event) {
this.model.region = event.province.label + '-' + event.city.label + '-' + event.area.label
},
// 点击商品类型列选择器
goodsTypeSelectConfirm(event) {
this.model.goodsType = `${event[0]['label']}`
},
// 多选项值改变事件
checkboxGroupChange(event) {
this.model.fruit = event
},
// 单选项值改变事件
radioGroupChange(event) {
this.model.payType = event
},
// 获取验证码
getCode() {
if (this.$refs.code.canGetCode) {
this.$tn.message.loading('正在获取验证码')
setTimeout(() => {
this.$tn.message.closeLoading()
this.$tn.message.toast('验证码已经发送')
// 通知组件开始计时
this.$refs.code.start()
}, 2000)
} else {
this.$tn.message.toast(this.$refs.code.secNum + '秒后再重试')
}
},
// 验证码倒计时时间改变
codeChange(text) {
this.codeTips = text
},
// 图片有修改
imageUploadChange(lists) {
this.model.photo = lists
},
// 同意协议状态修改
agreementCheckChange(event) {
this.model.agreement = event.value
}
}
}
</script>
<style lang="scss" scoped>
.agreement {
display: flex;
align-items: center;
margin: 40rpx 0;
&-text {
padding-left: 8rpx;
color: $tn-font-sub-color;
}
}
</style>
+126
View File
@@ -0,0 +1,126 @@
<template>
<view class="components-goods-nav tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>商品导航</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基础" :contentPadding="false">
<tn-goods-nav></tn-goods-nav>
</demo-title>
<demo-title title="显示阴影" :contentPadding="false">
<tn-goods-nav :shadow="true"></tn-goods-nav>
</demo-title>
<demo-title title="选项设置为头像" :contentPadding="false">
<tn-goods-nav :options="avatarOptions"></tn-goods-nav>
</demo-title>
<demo-title title="设置角标" :contentPadding="false">
<tn-goods-nav :options="countOptions"></tn-goods-nav>
</demo-title>
<demo-title title="设置边距按钮" :contentPadding="false">
<tn-goods-nav buttonType="paddingRect"></tn-goods-nav>
</demo-title>
<demo-title title="设置圆角按钮" :contentPadding="false">
<tn-goods-nav buttonType="round"></tn-goods-nav>
</demo-title>
<demo-title title="不设置选项" :contentPadding="false">
<tn-goods-nav :options="[]"></tn-goods-nav>
</demo-title>
<demo-title title="自定义颜色" :contentPadding="false">
<tn-goods-nav :options="customOptions" buttonType="round" :buttonGroups="customButtonGroups"></tn-goods-nav>
</demo-title>
<demo-title title="固定在底部" :contentPadding="false">
<tn-goods-nav :fixed="true" :safeAreaInsetBottom="true" @optionClick="onOptionClick" @buttonClick="onButtonClick"></tn-goods-nav>
</demo-title>
<view style="padding-bottom: 88rpx;"></view>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'ComponentsGoodsNav',
components: { demoTitle },
data() {
return {
avatarOptions: [{
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg'
},{
icon: 'service',
text: '客服'
},{
icon: 'star',
text: '收藏'
}],
countOptions: [{
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
count: 10
},{
icon: 'service',
text: '客服',
count: 100
},{
icon: 'star',
text: '收藏'
}],
customOptions: [{
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
count: 10,
countBackgroundColor: '#E83A30'
},{
icon: 'service',
text: '客服',
count: 100,
countBackgroundColor: 'transparent',
countFontColor: '#E83A30'
},{
icon: 'star',
text: '收藏',
iconColor: '#838383',
fontColor: '#080808'
}],
customButtonGroups: [{
text: '加入购物车',
backgroundColor: 'tn-cool-bg-color-8',
color: '#FFFFFF'
},{
text: '结算',
backgroundColor: 'tn-cool-bg-color-8--reverse',
color: '#FFFFFF'
}]
}
},
methods: {
// 选项点击事件
onOptionClick(e) {
this.$tn.message.toast(`点击了第${e.index}个选项`)
},
// 按钮点击事件
onButtonClick(e) {
this.$tn.message.toast(`点击了第${e.index}个按钮`)
}
}
}
</script>
<style lang="scss" scoped>
.components-goods-nav {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
</style>
@@ -0,0 +1,273 @@
<template>
<view class="components-image_upload">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>图片上传</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" :fullWindowsScroll="fullWindowsScroll" @click="click">
<tn-image-upload
ref="imageUpload"
:action="action"
:formData="formData"
:fileList="fileList"
:disabled="disabled"
:autoUpload="autoUpload"
:maxCount="maxCount"
:showUploadList="showUploadList"
:showProgress="showProgress"
:deleteable="deleteable"
:customBtn="customBtn"
:beforeUpload="beforeUpload"
@on-list-change="listChange"
@on-oversize="oversize"
@on-exceed="exceed"
@on-choose-complete="chooseComplete"
@on-choose-fail="chooseFail"
@on-uploaded="uploaded"
@on-success="uploadSuccess"
@on-change="uploadChange"
@on-progress="uploadProgress"
@on-error="uploadError"
@on-remove="fileRemove"
>
<view v-if="!showUploadList" slot="file" style="width: 100%;">
<view v-for="(item,index) in lists" :key="index" class="tn-image-upload__item">
<image
class="tn-image-upload__item__image"
:src="item.url || item.path"
mode="aspectFill"
></image>
</view>
</view>
<!-- <template v-if="!showUploadList" v-slot:file="data">
<view v-for="(item,index) in data.file" :key="index" class="tn-image-upload__item">
<image
class="tn-image-upload__item__image"
:src="item.url || item.path"
mode="aspectFill"
></image>
</view>
</template> -->
<view v-if="customBtn" slot="addBtn" class="tn-image-upload__custom-btn" hover-class="tn-hover-class" hover-stay-time="150">
<view>选择图片</view>
</view>
</tn-image-upload>
<view class="tn-flex tn-margin-top-xs tn-flex-row-center">
<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>
</view>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
components: {dynamicDemoTemplate},
data() {
return {
action: 'https://www.hualigs.cn/api/upload',
// action: '',
formData: {
apiType: 'this,ali',
token: 'dffc1e06e636cff0fdf7d877b6ae6a2e',
image: null
},
// 预上传列表
// [{
// url: 'http://127.0.0.1:8888/upload/tuniao.jpg'
// }]
fileList: [],
showUploadList: true,
customBtn: false,
autoUpload: true,
showProgress: true,
deleteable: true,
customStyle: false,
maxCount: 9,
disabled: false,
lists: [],
tips: ['无需依赖额外的样式文件','使用tn-image-upload组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '上传方式',
optional: ['自动上传','手动上传'],
methods: 'autoUploadChange'
},
{
title: '进度显示',
optional: ['是','否'],
methods: 'showProgressChange'
},
{
title: '删除按钮显示',
optional: ['是','否'],
methods: 'deleteableChange'
},
{
title: '最大上传数',
optional: ['2','6','9'],
methods: 'maxCountChange',
current: 2
},
{
title: '自定义列表和上传按钮样式',
optional: ['是','否'],
methods: 'customUploadListChange',
current: 1
},
{
title: '是否禁用',
optional: ['是','否'],
methods: 'disabledChange',
current: 1
}
]
}
],
fullWindowsScroll: false
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 切换上传方式
autoUploadChange(event) {
this.autoUpload = event.index === 0 ? true : false
},
// 切换进度显示
showProgressChange(event) {
this.showProgress = event.index === 0 ? true : false
},
// 切换删除按钮显示
deleteableChange(event) {
this.deleteable = event.index === 0 ? true : false
},
// 切换允许上传数
maxCountChange(event) {
this.maxCount = Number(event.name)
},
// 切换自定义列表样式
customUploadListChange(event) {
if (event.index === 0) {
this.customStyle = true
this.showUploadList = false
this.customBtn = true
} else if (event.index === 1) {
this.customStyle = false
this.showUploadList = true
this.customBtn = false
}
this.$refs.demoTemplate.updateSectionScrollView()
},
// 切换禁用
disabledChange(event) {
this.disabled = event.index === 0 ? true : false
this.$refs.demoTemplate.updateSectionScrollView()
},
// 手动上传文件
upload() {
this.$refs.imageUpload.upload()
},
// 手动清空列表
clear() {
this.$refs.imageUpload.clear()
},
// 文件上传前执行
beforeUpload(index, lists) {
console.log('文件上传前执行', lists, index);
console.log(this.formData);
this.formData.image = lists[index].file
return true
},
listChange(lists, index) {
console.log('上传文件列表发生改变', lists, index);
this.lists.splice(0, this.lists.length)
this.$nextTick(() => {
this.lists = this.$tn.deepClone(lists)
if (this.customStyle && lists.length > 4) {
this.fullWindowsScroll = true
} else {
this.$refs.demoTemplate.updateSectionScrollView()
}
})
},
oversize(val, lists, index) {
console.log('上传的文件超过大小', val, lists, index);
},
exceed(val, lists, index) {
console.log('上传的文件超过允许数量', val, lists, index);
},
chooseComplete(lists, index) {
console.log('文件选择成功', lists, index);
},
chooseFail(err) {
console.log('文件选择失败', err);
},
uploaded(lists, index) {
console.log('全部上传文件处理完成', lists, index);
},
uploadSuccess(data, currentIndex, lists, index) {
console.log('文件上传成功', data, currentIndex, lists, index);
},
uploadChange(res, currentIndex, lists, index) {
console.log('文件上传信息有变', res, currentIndex, lists, index);
},
uploadProgress(res, currentIndex, lists, index) {
console.log('文件上传进度', res, currentIndex, lists, index);
},
uploadError(err, currentIndex, lists, index) {
console.log('文件上传失败', err, currentIndex, lists, index);
},
fileRemove(currentIndex, lists, index) {
console.log('文件移除成功', currentIndex, lists, index);
},
},
}
</script>
<style lang="scss" scoped>
.tn-image-upload__item {
width: 100%;
height: 180rpx;
border-radius: 30rpx;
margin-bottom: 20rpx;
&__image {
width: 100%;
height: 180rpx;
border-radius: 30rpx;
}
}
.tn-image-upload__custom-btn {
background-color: $tn-font-holder-color;
width: 100%;
height: 180rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 30rpx;
}
</style>
@@ -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>
+40
View File
@@ -0,0 +1,40 @@
<template>
<view class="components-index-list">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>IndexList索引列表</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<multiple-options-demo
:list="optionsList"
></multiple-options-demo>
</view>
</view>
</template>
<script>
import multipleOptionsDemo from '@/libs/components/multiple-options-demo'
export default {
name: 'componentsIndexList',
components: { multipleOptionsDemo },
data() {
return {
// 选项列表数据
optionsList: [
{ title: '普通列表', desc: '传入列表数据即可使用', url: '/componentsPage/index-list/base/index-list' },
{ title: '带头像列表', desc: '通过自定义列表来实现', url: '/componentsPage/index-list/avatar/index-list' }
]
}
}
}
</script>
<style lang="scss" scoped>
</style>
+231
View File
@@ -0,0 +1,231 @@
<template>
<view class="components-input tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Input输入框</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基本使用" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">文本</view>
<view class="content__data tn-flex-1">
<tn-input v-model="inputValue" type="text" placeholder="请输入文本"></tn-input>
</view>
</view>
</demo-title>
<demo-title title="禁止输入" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">文本</view>
<view class="content__data tn-flex-1">
<tn-input type="text" placeholder="请输入文本" disabled></tn-input>
</view>
</view>
</demo-title>
<demo-title title="对齐方式" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center tn-border-solid-bottom">
<view class="content__title">居中对齐</view>
<view class="content__data tn-flex-1">
<tn-input type="text" placeholder="请输入文本" inputAlign="center"></tn-input>
</view>
</view>
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">右对齐</view>
<view class="content__data tn-flex-1">
<tn-input type="text" placeholder="请输入文本" inputAlign="right"></tn-input>
</view>
</view>
</demo-title>
<demo-title title="边框" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">文本</view>
<view class="content__data tn-flex-1">
<tn-input type="text" placeholder="请输入文本" border></tn-input>
</view>
</view>
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center tn-border-solid-bottom">
<view class="content__title">文本</view>
<view class="content__data tn-flex-1">
<tn-input type="text" placeholder="请输入文本" border borderColor="#01BEFF"></tn-input>
</view>
</view>
</demo-title>
<demo-title title="右边显示图标" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">文本</view>
<view class="content__data tn-flex-1">
<tn-input type="text" placeholder="请输入文本" showRightIcon rightIcon="code"></tn-input>
</view>
</view>
</demo-title>
<demo-title title="文本域" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">文本域</view>
<view class="content__data tn-flex-1">
<tn-input type="textarea" placeholder="请输入文本"></tn-input>
</view>
</view>
</demo-title>
<demo-title title="内置类型" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center tn-border-solid-bottom">
<view class="content__title">整数</view>
<view class="content__data tn-flex-1">
<tn-input type="number" placeholder="请输入整数"></tn-input>
</view>
</view>
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center tn-border-solid-bottom">
<view class="content__title">小数</view>
<view class="content__data tn-flex-1">
<tn-input type="digit" placeholder="请输入小数"></tn-input>
</view>
</view>
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center tn-border-solid-bottom">
<view class="content__title">身份证</view>
<view class="content__data tn-flex-1">
<tn-input type="idcard" placeholder="请输入身份证"></tn-input>
</view>
</view>
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">电话号码</view>
<view class="content__data tn-flex-1">
<tn-input type="tel" placeholder="请输入电话号码"></tn-input>
</view>
</view>
</demo-title>
<demo-title title="密码输入框" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center tn-border-solid-bottom">
<view class="content__title">密码</view>
<view class="content__data tn-flex-1">
<tn-input type="password" placeholder="请输入密码"></tn-input>
</view>
</view>
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">密码</view>
<view class="content__data tn-flex-1">
<tn-input type="password" placeholder="请输入密码" :passwordIcon="false"></tn-input>
</view>
</view>
</demo-title>
<demo-title title="弹出选择" :contentPadding="false">
<view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
<view class="content__title">业务</view>
<view class="content__data tn-flex-1">
<tn-input type="select" placeholder="请选择业务类型" :selectOpen="selectShow" @click="selectShow = true"></tn-input>
</view>
</view>
</demo-title>
<demo-title title="配合formItem使用" :contentPadding="false">
<view class="content tn-padding-left tn-padding-right">
<tn-form-item label="姓名">
<tn-input type="text" placeholder="请输入姓名"></tn-input>
</tn-form-item>
</view>
<view class="content tn-padding-left tn-padding-right">
<tn-form-item label="姓名" labelPosition="top" required>
<tn-input type="text" placeholder="请输入姓名"></tn-input>
</tn-form-item>
</view>
<view class="content tn-padding-left tn-padding-right">
<tn-form-item label="联系电话" :labelWidth="200">
<tn-input type="tel" placeholder="请输入电话号码"></tn-input>
</tn-form-item>
</view>
<view class="content tn-padding-left tn-padding-right">
<tn-form-item label="联系电话" :labelWidth="200" labelAlign="center">
<tn-input type="tel" placeholder="请输入电话号码"></tn-input>
</tn-form-item>
</view>
<view class="content tn-padding-left tn-padding-right">
<tn-form-item label="联系电话" :labelWidth="200" labelAlign="right">
<tn-input type="tel" placeholder="请输入电话号码"></tn-input>
</tn-form-item>
</view>
<view class="content tn-padding-left tn-padding-right">
<tn-form-item label="验证码" :labelWidth="200">
<tn-input type="text" placeholder="请输入验证码"></tn-input>
<tn-button slot="right" backgroundColor="#01BEFF" fontColor="#FFFFFF" size="sm">获取验证码</tn-button>
</tn-form-item>
</view>
<view class="content tn-padding-left tn-padding-right">
<tn-form-item label="身份证" :labelWidth="200" leftIcon="identity">
<tn-input type="idcard" placeholder="请输入身份证号码"></tn-input>
</tn-form-item>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
<!-- 业务类型select -->
<tn-select
v-model="selectShow"
mode="single"
:list="selectList"
@confirm="businessSelectConfirm"
></tn-select>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'ComponentsInput',
components: { demoTitle },
data() {
return {
inputValue: '',
selectShow: false,
selectList: [
{
label: '免费',
value: 1101
},
{
label: '会员',
value: 1102
},
{
label: '全新开发',
value: 1103
}
]
}
},
methods: {
businessSelectConfirm() {
}
}
}
</script>
<style lang="scss" scoped>
.components-input {
background-color: $tn-bg-gray-color;
min-height: 100vh;
.content {
background-color: #FFFFFF;
&__title {
padding: 30rpx;
}
&__data {
margin: 10rpx 0;
margin-right: 30rpx;
}
}
}
</style>
+317
View File
@@ -0,0 +1,317 @@
<template>
<view class="components-keyboard">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>keyboard键盘</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true"
@click="click">
<view v-if="mode === 'number' || mode === 'card'" class="number-value">
<tn-input v-model="inputValue" type="text" :disabled="true" :border="true" placeholder="键盘输入的内容"
@click="showKeyboard"></tn-input>
<tn-button class="clear-btn" backgroundColor="tn-bg-gray" fontColor="white" width="120rpx"
height="70rpx" @click="clearInputValue">清空</tn-button>
</view>
<view v-else class="car-value">
<block v-for="(item, index) in 8" :key="index">
<view class="car-input" :class="{'new-energy': index === 7 && !licensePlateValue[index]}"
@tap="chooseLicensePlateNumber(index)">
<block v-if="index === 7 && !licensePlateValue[index]">
<view class="new-energy-car">
<view class="icon tn-icon-add"></view>
<view class="text">新能源</view>
</view>
</block>
<block v-else>
<block v-if="licensePlateValue[index]===''">
</block>
<block v-else>
{{ licensePlateValue[index]}}
</block>
</block>
</view>
<view class="car-point" v-if="index === 1">
<view class="point"></view>
</view>
</block>
</view>
</dynamic-demo-template>
</view>
<!-- 键盘 -->
<tn-keyboard v-model="value" :mode="mode" :dotEnabled="dotEnabled" :randomEnabled="randomEnabled"
:switchEnMode="switchEnMode" :tooltip="tooltip" :mask="mask" @change="onChange" @cancel="onCancel"
@confirm="onConfirm" @backspace="onBackspace"></tn-keyboard>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsKeyboard',
components: {
dynamicDemoTemplate
},
data() {
return {
value: false,
mode: 'number',
dotEnabled: true,
randomEnabled: false,
switchEnMode: false,
tooltip: true,
mask: true,
// 输入的值
inputValue: '',
// 输入的车牌
licensePlateValue: ['', '', '', '', '', '', '', ''],
// 当前选择输入的车牌号码位置
currentLicensePlateIndex: 0,
tips: ['无需依赖额外的样式文件', '使用tn-keyboard组件'],
sectionList: [{
name: '参数切换',
section: [{
title: '模式',
optional: ['数字', '身份证', '车牌'],
methods: 'modeChange'
},
{
title: '显示点',
optional: ['显示', '隐藏'],
methods: 'dotEnabledChange'
},
{
title: '打乱顺序',
optional: ['是', '否'],
methods: 'randomEnabledChange',
current: 1
},
{
title: '显示顶部工具栏',
optional: ['显示', '隐藏'],
methods: 'tooltipChange'
},
{
title: '遮罩显示',
optional: ['是', '否'],
methods: 'maskChange'
}
]
}]
}
},
watch: {
mode(value) {
switch (value) {
case 'number':
this.$refs.demoTemplate.updateSectionBtnsValue(0, 0, 0)
break
case 'card':
this.$refs.demoTemplate.updateSectionBtnsValue(0, 0, 1)
break
case 'car':
this.$refs.demoTemplate.updateSectionBtnsValue(0, 0, 2)
break
}
},
currentLicensePlateIndex(value) {
if (value === 0) {
this.switchEnMode = false
} else {
this.switchEnMode = true
}
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出键盘
showKeyboard() {
this.value = true
},
// 切换模式
modeChange(event) {
switch (event.index) {
case 0:
this.mode = 'number'
this.dotEnabled = true
this.value = true
this.$refs.demoTemplate.updateSectionBtnsState(1, true)
break
case 1:
this.mode = 'card'
this.value = true
this.$refs.demoTemplate.updateSectionBtnsState(1, false)
break
case 2:
this.mode = 'car'
this.licensePlateValue = ['', '', '', '', '', '', '', '']
this.$refs.demoTemplate.updateSectionBtnsState(1, false)
break
}
},
// 切换点显示
dotEnabledChange(event) {
this.dotEnabled = event.index === 0 ? true : false
this.value = true
},
// 切换乱序显示
randomEnabledChange(event) {
this.randomEnabled = event.index === 0 ? true : false
this.value = true
},
// 切换顶部工具栏显示
tooltipChange(event) {
this.tooltip = event.index === 0 ? true : false
this.value = true
},
// 切换遮罩状态
maskChange(event) {
this.mask = event.index === 0 ? true : false
this.value = true
},
// 键盘输入值改变
onChange(e) {
if (this.mode === 'number' || this.mode === 'card') {
this.inputValue += e
} else if (this.mode === 'car') {
// 判断输入的值是否正确
if (this.currentLicensePlateIndex === 0 && !this.$tn.test.chinese(e)) {
this.$tn.message.toast('车牌归属地选择错误')
return
} else if (this.currentLicensePlateIndex === 1 && !this.$tn.test.letter(e)) {
this.$tn.message.toast('车牌归属地字母选择错误')
return
}
if (this.currentLicensePlateIndex !== 0 && !this.$tn.test.enOrNum(e)) {
this.$tn.message.toast('车牌号码选择错误')
return
}
// this.licensePlateValue[this.currentLicensePlateIndex] = e
this.$set(this.licensePlateValue, this.currentLicensePlateIndex, e)
this.currentLicensePlateIndex++
// 判断车牌是否已经选择完成
if (this.currentLicensePlateIndex === 8) {
this.value = false
}
}
},
// 点击了取消按钮
onCancel() {
this.$tn.message.toast('点击了取消按钮')
},
// 点击了确认按钮
onConfirm() {
this.$tn.message.toast('点击了确认按钮')
this.value = false
},
// 点击了退格按钮
onBackspace() {
if (this.mode === 'number' || this.mode === 'card') {
if (!this.inputValue) {
return
}
this.inputValue = this.inputValue.substring(0, this.inputValue.length - 1)
} else if (this.mode === 'car') {
let licensePlateIndex = this.currentLicensePlateIndex > 7 ? 7 : this.currentLicensePlateIndex
if (this.licensePlateValue[licensePlateIndex] !== '') {
this.$set(this.licensePlateValue, licensePlateIndex, '')
} else {
licensePlateIndex = licensePlateIndex < 1 ? 0 : --licensePlateIndex
this.$set(this.licensePlateValue, licensePlateIndex, '')
}
this.currentLicensePlateIndex = licensePlateIndex
}
},
// 点击车牌对于位置进行选择输入
chooseLicensePlateNumber(index) {
this.currentLicensePlateIndex = index
this.mode = 'car'
this.value = true
},
// 清空内容
clearInputValue() {
this.inputValue = ''
}
},
}
</script>
<style lang="scss" scoped>
.number-value {
display: flex;
align-items: center;
.clear-btn {
margin-left: 10rpx;
}
}
.car-value {
display: flex;
.car-input {
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 74rpx;
width: 64rpx;
border: 1px solid $tn-border-solid-color;
border-radius: 18rpx;
text-align: center;
font-size: 38rpx;
line-height: 1;
margin-left: 10rpx;
background-color: #FFFFFF;
&.new-energy {
background: transparent;
border-style: dashed;
}
}
.car-point {
display: flex;
align-items: center;
justify-content: center;
height: 74rpx;
width: 20rpx;
margin-left: 10rpx;
.point {
width: 20rpx;
height: 20rpx;
background-color: $tn-font-holder-color;
border-radius: 50%;
}
}
.new-energy-car {
display: flex;
flex-direction: column;
font-size: 16rpx;
color: $tn-font-sub-color;
.icon {
margin-bottom: 8rpx;
}
}
}
</style>
+185
View File
@@ -0,0 +1,185 @@
<template>
<view class="components-landscape">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>压屏窗</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 class="tn-flex tn-flex-row-center"><tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @tap="showLandscape">弹出压屏窗</tn-button></view>
</dynamic-demo-template>
</view>
<!-- 压屏窗-->
<tn-landscape
:show="show"
:closeBtn="closeBtn"
:closeColor="closeColor"
:closeSize="closeSize"
:closePosition="closePosition"
:closeTop="closeTop"
:closeRight="closeRight"
:closeBottom="closeBottom"
:closeLeft="closeLeft"
:mask="mask"
:maskCloseable="maskCloseable"
@close="closeLandscape"
>
<image src="https://tnuiimage.tnkjapp.com/landscape/2022-new-year.png" mode="widthFix"></image>
</tn-landscape>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'ComponentsLandscape',
components: {dynamicDemoTemplate},
data() {
return {
show: false,
closeBtn: true,
closeColor: '',
closeSize: 0,
closePosition: 'rightTop',
closeTop: 0,
closeRight: 0,
closeBottom: 0,
closeLeft: 0,
mask: true,
maskCloseable: true,
tips: ['无需依赖额外的样式文件','使用tn-landscape组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '关闭按钮',
optional: ['显示','隐藏'],
methods: 'closeBtnChange'
},
{
title: '关闭按钮位置',
optional: ['左上','右上','底部'],
methods: 'closePositionChange',
current: 1
},
{
title: '自定义关闭按钮',
optional: ['默认','自定义'],
methods: 'customCloseChange'
},
{
title: '遮罩',
optional: ['显示','隐藏'],
methods: 'maskChange'
},
{
title: '点击遮罩关闭',
optional: ['允许','不允许'],
methods: 'maskCloseableChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出压屏窗
showLandscape() {
this.openLandscape()
},
// 切换关闭按钮显示隐藏
closeBtnChange(event) {
switch (event.index) {
case 0:
this.closeBtn = true
this.$refs.demoTemplate.updateSectionBtnsState([1,2], true)
break
case 1:
this.closeBtn = false
this.$refs.demoTemplate.updateSectionBtnsState([1,2], false)
break
}
this.openLandscape()
},
// 切换关闭按钮位置
closePositionChange(event) {
switch (event.index) {
case 0:
this.closePosition = 'leftTop'
break
case 1:
this.closePosition = 'rightTop'
break
case 2:
this.closePosition = 'bottom'
break
}
this.$refs.demoTemplate.updateSectionBtnsValue(0, 2, 0)
this.customCloseChange({index: 0})
this.openLandscape()
},
// 切换自定义关闭按钮样式
customCloseChange(event) {
if (event.index === 0) {
this.closeTop = 0
this.closeRight = 0
this.closeBottom = 0
this.closeLeft = 0
this.closeColor = ''
this.closeSize = 0
} else if (event.index === 1) {
if (this.closePosition === 'leftTop') {
this.closeTop = -40
this.closeLeft = 30
} else if (this.closePosition === 'rightTop') {
this.closeTop = -40
this.closeRight = 30
} else if (this.closePosition === 'bottom') {
this.closeBottom = -60
}
this.closeColor = '#E83A30'
this.closeSize = 60
}
this.openLandscape()
},
// 切换遮罩显示隐藏
maskChange(event) {
this.mask = event.index === 0 ? true : false
this.openLandscape()
},
// 切换遮罩关闭状态
maskCloseableChange(event) {
this.maskCloseable = event.index === 0 ? true : false
this.openLandscape()
},
// 打开压屏窗
openLandscape() {
this.show = true
},
// 关闭压屏窗
closeLandscape() {
this.show = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
+102
View File
@@ -0,0 +1,102 @@
<template>
<view class="components-lazy-load">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>懒加载</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="content">
<block v-for="(item, index) in list" :key="index">
<view class="item">
<tn-lazy-load
:index="index"
:image="item.src"
:threshold="-450"
:height="400"
imgMode="aspectFill"
></tn-lazy-load>
</view>
</block>
</view>
<tn-load-more :status="status" @loadmore="getData"></tn-load-more>
</view>
</view>
</template>
<script>
export default {
name: 'ComponentsLazyLoad',
data() {
return {
status: 'loadmore',
list: [],
data: [
{ src: 'https://tnuiimage.tnkjapp.com/shop/bag1.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/bag2.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/banner1.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/banner2.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/banner3.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/card.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/computer1.jpg' },
{ src: 'error.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/computer2.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/content.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/cup1.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/cup2.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/office.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/phonecase1.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/phonecase2.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/pillow.jpg' },
{ src: 'error.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/pillow2.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/prototype1.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/prototype2.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/watch1.jpg' },
{ src: 'https://tnuiimage.tnkjapp.com/shop/watch2.jpg' },
{ src: 'error.jpg' }
]
}
},
onLoad() {
this.getData()
},
onReachBottom() {
uni.$emit('tOnLazyLoadReachBottom')
this.getData()
},
methods: {
getData() {
let index = 0
this.status = 'loading'
setTimeout(() => {
for (let i = 0; i < 10; i++) {
index = this.$tn.number.randomInt(0, this.data.length - 1)
this.list.push({
src: this.data[index].src
})
}
this.status = 'loadmore'
}, 1500)
}
}
}
</script>
<style lang="scss" scoped>
.content {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
padding: 30rpx;
.item {
flex: 0 0 335rpx;
height: 400rpx;
margin-bottom: 20rpx;
border-radius: 10rpx;
overflow: hidden;
}
}
</style>
+365
View File
@@ -0,0 +1,365 @@
<template>
<view class="components-list tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>列表</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</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>
</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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsList',
components: {demoTitle},
data() {
return {
showListOptions: false,
cellShowBorderLine: true,
cellLongBorderLine: false,
cellNoPaddingArrow: false,
cellArrow: false,
cellArrowRight: true,
cellUnlined: false,
cellLineLeft: true,
cellLineRight: true,
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'},
]
}
},
watch: {
cellShowBorderLine(val) {
if (val) {
this.cellUnlined = false
} else {
this.cellUnlined = true
}
},
cellLongBorderLine(val) {
if (val) {
this.cellLineLeft = false
this.cellLineRight = false
} else {
this.cellLineLeft = true
this.cellLineRight = 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>
.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 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;
}
}
&__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>
+81
View File
@@ -0,0 +1,81 @@
<template>
<view class="components-load-more tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>加载更多</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="默认">
<tn-load-more></tn-load-more>
</demo-title>
<demo-title title="加载中">
<tn-load-more status="loading" :loadingIcon="false"></tn-load-more>
<view class="tn-margin-top">
<tn-load-more class="tn-margin-top" status="loading"></tn-load-more>
</view>
<view class="tn-margin-top">
<tn-load-more class="tn-margin-top" status="loading" loadingIconColor="#01BEFF"></tn-load-more>
</view>
<view class="tn-margin-top">
<tn-load-more class="tn-margin-top" status="loading" loadingIconType="flower"></tn-load-more>
</view>
</demo-title>
<demo-title title="没有更多">
<tn-load-more status="nomore"></tn-load-more>
<view class="tn-margin-top">
<tn-load-more class="tn-margin-top" status="nomore" dot></tn-load-more>
</view>
</demo-title>
<demo-title title="修改提示语">
<tn-load-more status="loadmore" :loadText="loadText"></tn-load-more>
<view class="tn-margin-top">
<tn-load-more class="tn-margin-top" status="loading" :loadText="loadText"></tn-load-more>
</view>
<view class="tn-margin-top">
<tn-load-more class="tn-margin-top" status="nomore" :loadText="loadText"></tn-load-more>
</view>
</demo-title>
<demo-title title="修改颜色">
<tn-load-more status="loadmore" :loadText="loadText" fontColor="#01BEFF"></tn-load-more>
<view class="tn-margin-top">
<tn-load-more class="tn-margin-top" status="loading" :loadText="loadText" fontColor="tn-color-indigo"></tn-load-more>
</view>
<view class="tn-margin-top">
<tn-load-more class="tn-margin-top" status="nomore" :loadText="loadText" fontColor="rgba(255, 129, 129, 0.8)"></tn-load-more>
</view>
</demo-title>
<demo-title title="修改字体尺寸">
<tn-load-more :fontSize="32"></tn-load-more>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'ComponentsLoadMore',
components: { demoTitle },
data() {
return {
loadText: {
loadmore: '下拉加载',
loading: '快速加载中...',
nomore: '已经没有了啊'
}
}
}
}
</script>
<style lang="scss" scoped>
</style>
+86
View File
@@ -0,0 +1,86 @@
<template>
<view class="components-loading tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Loading加载动画</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsLoading',
components: {demoTitle},
data() {
return {
show: true,
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
+585
View File
@@ -0,0 +1,585 @@
module.exports = {
list: [{
"letter": "A",
"data": [{
"name": "阿拉斯加",
"mobile": "13588889999",
"keyword": "阿拉斯加ABA13588889999"
},
{
"name": "阿克苏",
"mobile": "0551-4386721",
"keyword": "阿克苏AKESU0551-4386721"
},
{
"name": "阿拉善",
"mobile": "4008009100",
"keyword": "阿拉善ALASHAN4008009100"
},
{
"name": "阿勒泰",
"mobile": "13588889999",
"keyword": "阿勒泰ALETAI13588889999"
},
{
"name": "阿里",
"mobile": "13588889999",
"keyword": "阿里ALI13588889999"
},
{
"name": "安阳",
"mobile": "13588889999",
"keyword": "13588889999安阳ANYANG"
}
]
},
{
"letter": "B",
"data": [{
"name": "白城",
"mobile": "该主子没有留电话~",
"keyword": "白城BAICHENG"
},
{
"name": "白山",
"mobile": "13588889999",
"keyword": "白山BAISHAN13588889999"
},
{
"name": "白银",
"mobile": "13588889999",
"keyword": "白银BAIYIN13588889999"
},
{
"name": "保定",
"mobile": "13588889999",
"keyword": "保定BAODING13588889999"
}
]
},
{
"letter": "C",
"data": [{
"name": "沧州",
"mobile": "13588889999",
"keyword": "沧州CANGZHOU13588889999"
},
{
"name": "长春",
"mobile": "13588889999",
"keyword": "长春CHANGCHUN13588889999"
}
]
},
{
"letter": "D",
"data": [{
"name": "大理",
"mobile": "13588889999",
"keyword": "大理DALI13588889999"
},
{
"name": "大连",
"mobile": "13588889999",
"keyword": "大连DALIAN13588889999"
}
]
},
{
"letter": "E",
"data": [{
"name": "鄂尔多斯",
"mobile": "13588889999",
"keyword": "鄂尔多斯EERDUOSI13588889999"
},
{
"name": "恩施",
"mobile": "13588889999",
"keyword": "恩施ENSHI13588889999"
},
{
"name": "鄂州",
"mobile": "13588889999",
"keyword": "鄂州EZHOU13588889999"
}
]
},
{
"letter": "F",
"data": [{
"name": "防城港",
"mobile": "该主子没有留电话~",
"keyword": "防城港FANGCHENGGANG"
},
{
"name": "抚顺",
"mobile": "13588889999",
"keyword": "抚顺FUSHUN13588889999"
},
{
"name": "阜新",
"mobile": "13588889999",
"keyword": "阜新FUXIN13588889999"
},
{
"name": "阜阳",
"mobile": "13588889999",
"keyword": "阜阳FUYANG13588889999"
},
{
"name": "抚州",
"mobile": "13588889999",
"keyword": "抚州FUZHOU13588889999"
},
{
"name": "福州",
"mobile": "13588889999",
"keyword": "福州FUZHOU13588889999"
}
]
},
{
"letter": "G",
"data": [{
"name": "甘南",
"mobile": "13588889999",
"keyword": "甘南GANNAN13588889999"
},
{
"name": "赣州",
"mobile": "13588889999",
"keyword": "赣州GANZHOU13588889999"
},
{
"name": "甘孜",
"mobile": "13588889999",
"keyword": "甘孜GANZI13588889999"
}
]
},
{
"letter": "H",
"data": [{
"name": "哈尔滨",
"mobile": "13588889999",
"keyword": "哈尔滨HAERBIN13588889999"
},
{
"name": "海北",
"mobile": "13588889999",
"keyword": "海北HAIBEI13588889999"
},
{
"name": "海东",
"mobile": "13588889999",
"keyword": "海东HAIDONG13588889999"
},
{
"name": "海口",
"mobile": "13588889999",
"keyword": "海口HAIKOU13588889999"
}
]
},
{
"letter": "I",
"data": [{
"name": "ice",
"mobile": "13588889999",
"keyword": "佳木斯JIAMUSI13588889999"
}]
},
{
"letter": "J",
"data": [{
"name": "佳木斯",
"mobile": "13588889999",
"keyword": "佳木斯JIAMUSI13588889999"
},
{
"name": "吉安",
"mobile": "13588889999",
"keyword": "吉安JIAN13588889999"
},
{
"name": "江门",
"mobile": "13588889999",
"keyword": "江门JIANGMEN13588889999"
}
]
},
{
"letter": "K",
"data": [{
"name": "开封",
"mobile": "13588889999",
"keyword": "开封KAIFENG13588889999"
},
{
"name": "喀什",
"mobile": "13588889999",
"keyword": "喀什KASHI13588889999"
},
{
"name": "克拉玛依",
"mobile": "13588889999",
"keyword": "克拉玛依KELAMAYI13588889999"
}
]
},
{
"letter": "L",
"data": [{
"name": "来宾",
"mobile": "13588889999",
"keyword": "来宾LAIBIN13588889999"
},
{
"name": "兰州",
"mobile": "13588889999",
"keyword": "兰州LANZHOU13588889999"
},
{
"name": "拉萨",
"mobile": "13588889999",
"keyword": "拉萨LASA13588889999"
},
{
"name": "乐山",
"mobile": "13588889999",
"keyword": "乐山LESHAN13588889999"
},
{
"name": "凉山",
"mobile": "13588889999",
"keyword": "凉山LIANGSHAN13588889999"
},
{
"name": "连云港",
"mobile": "13588889999",
"keyword": "连云港LIANYUNGANG13588889999"
},
{
"name": "聊城",
"mobile": "18322223333",
"keyword": "聊城LIAOCHENG18322223333"
},
{
"name": "辽阳",
"mobile": "18322223333",
"keyword": "辽阳LIAOYANG18322223333"
},
{
"name": "辽源",
"mobile": "18322223333",
"keyword": "辽源LIAOYUAN18322223333"
},
{
"name": "丽江",
"mobile": "18322223333",
"keyword": "丽江LIJIANG18322223333"
},
{
"name": "临沧",
"mobile": "18322223333",
"keyword": "临沧LINCANG18322223333"
},
{
"name": "临汾",
"mobile": "18322223333",
"keyword": "临汾LINFEN18322223333"
},
{
"name": "临夏",
"mobile": "18322223333",
"keyword": "临夏LINXIA18322223333"
},
{
"name": "临沂",
"mobile": "18322223333",
"keyword": "临沂LINYI18322223333"
},
{
"name": "林芝",
"mobile": "18322223333",
"keyword": "林芝LINZHI18322223333"
},
{
"name": "丽水",
"mobile": "18322223333",
"keyword": "丽水LISHUI18322223333"
}
]
},
{
"letter": "M",
"data": [{
"name": "眉山",
"mobile": "15544448888",
"keyword": "眉山MEISHAN15544448888"
},
{
"name": "梅州",
"mobile": "15544448888",
"keyword": "梅州MEIZHOU15544448888"
},
{
"name": "绵阳",
"mobile": "15544448888",
"keyword": "绵阳MIANYANG15544448888"
},
{
"name": "牡丹江",
"mobile": "15544448888",
"keyword": "牡丹江MUDANJIANG15544448888"
}
]
},
{
"letter": "N",
"data": [{
"name": "南昌",
"mobile": "15544448888",
"keyword": "南昌NANCHANG15544448888"
},
{
"name": "南充",
"mobile": "15544448888",
"keyword": "南充NANCHONG15544448888"
},
{
"name": "南京",
"mobile": "15544448888",
"keyword": "南京NANJING15544448888"
},
{
"name": "南宁",
"mobile": "15544448888",
"keyword": "南宁NANNING15544448888"
},
{
"name": "南平",
"mobile": "15544448888",
"keyword": "南平NANPING15544448888"
}
]
},
{
"letter": "O",
"data": [{
"name": "欧阳",
"mobile": "15544448888",
"keyword": "欧阳ouyang15544448888"
}]
},
{
"letter": "P",
"data": [{
"name": "盘锦",
"mobile": "15544448888",
"keyword": "盘锦PANJIN15544448888"
},
{
"name": "攀枝花",
"mobile": "15544448888",
"keyword": "攀枝花PANZHIHUA15544448888"
},
{
"name": "平顶山",
"mobile": "15544448888",
"keyword": "平顶山PINGDINGSHAN15544448888"
},
{
"name": "平凉",
"mobile": "15544448888",
"keyword": "平凉PINGLIANG15544448888"
},
{
"name": "萍乡",
"mobile": "15544448888",
"keyword": "萍乡PINGXIANG15544448888"
},
{
"name": "普洱",
"mobile": "15544448888",
"keyword": "普洱PUER15544448888"
},
{
"name": "莆田",
"mobile": "15544448888",
"keyword": "莆田PUTIAN15544448888"
},
{
"name": "濮阳",
"mobile": "15544448888",
"keyword": "濮阳PUYANG15544448888"
}
]
},
{
"letter": "Q",
"data": [{
"name": "黔东南",
"mobile": "15544448888",
"keyword": "黔东南QIANDONGNAN15544448888"
},
{
"name": "黔南",
"mobile": "15544448888",
"keyword": "黔南QIANNAN15544448888"
},
{
"name": "黔西南",
"mobile": "15544448888",
"keyword": "黔西南QIANXINAN15544448888"
}
]
},
{
"letter": "R",
"data": [{
"name": "日喀则",
"mobile": "15544448888",
"keyword": "日喀则RIKAZE15544448888"
},
{
"name": "日照",
"mobile": "15544448888",
"keyword": "日照RIZHAO15544448888"
}
]
},
{
"letter": "S",
"data": [{
"name": "三门峡",
"mobile": "15544448888",
"keyword": "三门峡SANMENXIA15544448888"
},
{
"name": "三明",
"mobile": "15544448888",
"keyword": "三明SANMING15544448888"
},
{
"name": "三沙",
"mobile": "15544448888",
"keyword": "三沙SANSHA15544448888"
}
]
},
{
"letter": "T",
"data": [{
"name": "塔城",
"mobile": "15544448888",
"keyword": "塔城TACHENG15544448888"
},
{
"name": "漯河",
"mobile": "15544448888",
"keyword": "漯河TAHE15544448888"
},
{
"name": "泰安",
"mobile": "15544448888",
"keyword": "泰安TAIAN15544448888"
}
]
},
{
"letter": "W",
"data": [{
"name": "潍坊",
"mobile": "15544448888",
"keyword": "潍坊WEIFANG15544448888"
},
{
"name": "威海",
"mobile": "15544448888",
"keyword": "威海WEIHAI15544448888"
},
{
"name": "渭南",
"mobile": "15544448888",
"keyword": "渭南WEINAN15544448888"
},
{
"name": "文山",
"mobile": "15544448888",
"keyword": "文山WENSHAN15544448888"
}
]
},
{
"letter": "X",
"data": [{
"name": "厦门",
"mobile": "15544448888",
"keyword": "厦门XIAMEN15544448888"
},
{
"name": "西安",
"mobile": "15544448888",
"keyword": "西安XIAN15544448888"
},
{
"name": "湘潭",
"mobile": "15544448888",
"keyword": "湘潭XIANGTAN15544448888"
}
]
},
{
"letter": "Y",
"data": [{
"name": "雅安",
"mobile": "15544448888",
"keyword": "雅安YAAN15544448888"
},
{
"name": "延安",
"mobile": "15544448888",
"keyword": "延安YANAN15544448888"
},
{
"name": "延边",
"mobile": "15544448888",
"keyword": "延边YANBIAN15544448888"
},
{
"name": "盐城",
"mobile": "15544448888",
"keyword": "盐城YANCHENG15544448888"
}
]
},
{
"letter": "Z",
"data": [{
"name": "枣庄",
"mobile": "15544448888",
"keyword": "枣庄ZAOZHUANG15544448888"
},
{
"name": "张家界",
"mobile": "15544448888",
"keyword": "张家界ZHANGJIAJIE15544448888"
},
{
"name": "张家口",
"mobile": "15544448888",
"keyword": "张家口ZHANGJIAKOU15544448888"
}
]
},
{
"letter": "#",
"data": [{
"name": "其他.",
"mobile": "16666666666",
"keyword": "echo16666666666"
}]
}
]
}
+277
View File
@@ -0,0 +1,277 @@
<template>
<view class="modal">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>模态框</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showModal">弹出模态框</tn-button>
</dynamic-demo-template>
</view>
<!-- 模态框 -->
<tn-modal
v-model="show"
:backgroundColor="backgroundColor"
:width="width"
:padding="padding"
:radius="radius"
:fontColor="fontColor"
:fontSize="fontSize"
:title="title"
:content="content"
:button="button"
:showCloseBtn="closeBtn || !maskCloseable"
:maskCloseable="maskCloseable"
:zoom="zoom"
:custom="custom"
@click="clickBtn"
>
<view v-if="custom">
<view class="custom-modal-content">
<tn-form :labelWidth="140">
<tn-form-item label="手机号码" :borderBottom="false">
<tn-input placeholder="请输入手机号码"></tn-input>
</tn-form-item>
<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" backgroundColor="#01BEFF" fontColor="tn-color-white">获取验证码</tn-button>
</view>
</tn-form-item>
</tn-form>
</view>
</view>
</tn-modal>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsModal',
components: {dynamicDemoTemplate},
data() {
return {
title: '使用提醒',
content: '确定不使用TuniaoUI',
show: false,
backgroundColor: '',
width: '84%',
padding: '',
radius: 12,
fontColor: '',
fontSize: 0,
button:[
{
text: '取消',
backgroundColor: '#A4E82F',
fontColor: '#FFFFFF'
},
{
text: '确定',
backgroundColor: 'tn-bg-indigo',
fontColor: '#FFFFFF'
}
],
closeBtn: true,
maskCloseable: true,
zoom: true,
custom: false,
tips: ['无需依赖额外的样式文件','使用tn-modal组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '自定义颜色',
optional: ['默认','自定义'],
methods: 'colorChange'
},
{
title: '自定义大小',
optional: ['默认','自定义'],
methods: 'sizeChange'
},
{
title: '自定义内容',
optional: ['是','否'],
methods: 'customChange',
current: 1
},
{
title: '圆角',
optional: ['默认','60'],
methods: 'radiusChange'
},
{
title: '标题',
optional: ['显示','隐藏'],
methods: 'titleChange'
},
{
title: '按钮',
optional: ['显示','隐藏'],
methods: 'buttonChange'
},
{
title: '右上角关闭按钮',
optional: ['显示','隐藏'],
methods: 'closeBtnChange'
},
{
title: '点击mask关闭',
optional: ['是','否'],
methods: 'maskCloseableChange'
},
{
title: '动画',
optional: ['有','无'],
methods: 'zoomChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出模态框
showModal(event) {
this.openModal()
},
// 切换颜色
colorChange(event) {
if (event.index === 0) {
this.backgroundColor = ''
this.fontColor = ''
} else {
this.backgroundColor = '#E4E9EC'
this.fontColor = '#BA7027'
}
this.openModal()
},
// 切换大小
sizeChange(event) {
if (event.index === 0) {
// this.width = '84%'
this.padding = ''
this.fontSize = 0
} else {
// this.width = '480rpx'
this.padding = '30rpx 26rpx'
this.fontSize = 35
}
this.openModal()
},
// 切换自定义内容
customChange(event) {
if (event.index === 0) {
this.custom = true
this.$refs.demoTemplate.updateSectionBtnsState([4,5], false)
} else {
this.custom = false
this.$refs.demoTemplate.updateSectionBtnsState([4,5], true)
}
this.openModal()
},
// 切换圆角
radiusChange(event) {
this.radius = event.index === 0 ? 12 : Number(event.name)
this.openModal()
},
// 切换标题信息
titleChange(event) {
this.title = event.index === 0 ? '使用提醒' : ''
this.openModal()
},
// 切换按钮
buttonChange(event) {
this.button = event.index === 0 ? [
{
text: '取消',
backgroundColor: '#E6E6E6',
fontColor: '#FFFFFF'
},
{
text: '确定',
backgroundColor: 'tn-bg-indigo',
fontColor: '#FFFFFF'
}
] : []
this.openModal()
},
// 切换关闭按钮显示隐藏
closeBtnChange(event) {
this.closeBtn = event.index === 0 ? true : false
this.openModal()
},
// 切换蒙版层关闭
maskCloseableChange(event) {
if (event.index === 0) {
this.maskCloseable = true
} else {
this.maskCloseable = false
this.closeBtn = true
this.$refs.demoTemplate.updateSectionBtnsValue(0, 6, 0)
}
this.openModal()
},
// 切换动画
zoomChange(event) {
this.zoom = event.index === 0 ? true : false
this.openModal()
},
// 打开模态框
openModal() {
this.show = true
},
// 点击按钮
clickBtn(event) {
this.show = false
this.$tn.message.toast('点击了第'+(event.index + 1)+'个按钮')
}
},
}
</script>
<style lang="scss" scoped>
</style>
<style lang="scss">
.tn-modal-class {
.custom-modal-content {
width: 100%;
height: 100%;
padding: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.icon {
font-size: 100rpx;
margin-bottom: 20rpx;
color: $tn-main-color;
}
.text {
font-size: 40rpx;
}
}
}
</style>
+188
View File
@@ -0,0 +1,188 @@
<template>
<view class="components-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" :showRightIcon="true" rightIcon="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" :showRightIcon="true" rightIcon="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" :noDemo="true">
</dynamic-demo-template>
</view>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsNavbar',
components: {dynamicDemoTemplate},
data() {
return {
searchValue: '',
mode: 'normal',
height: 0,
backgroundColor: '#FFFFFF',
fontColor: '',
alpha: false,
bottomShadow: true,
tips: ['无需依赖额外的样式文件','使用tn-toast组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '高度',
optional: ['默认','38','80'],
methods: 'heightChange'
},
{
title: '样式',
optional: ['默认','自定义返回按钮', '隐藏返回栏自定义内容'],
methods: 'modeChange'
},
{
title: '背景颜色',
optional: ['默认','#01BEFF','tn-bg-grey','tn-main-gradient-indigo','透明'],
methods: 'backgroundColorChange'
},
{
title: '底部阴影',
optional: ['默认','隐藏'],
methods: 'bottomShadowChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 切换高度
heightChange(event) {
this.height = event.index === 0 ? 0 : Number(event.name)
},
// 切换样式
modeChange(event) {
switch(event.index) {
case 0:
this.mode = 'normal'
break
case 1:
this.mode = 'customBack'
break
case 2:
this.mode = 'customNav'
break
}
},
// 切换背景颜色
backgroundColorChange(event) {
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 4:
this.backgroundColor = ''
this.fontColor = ''
this.alpha = true
break
}
},
// 切换底部阴影
bottomShadowChange(event) {
this.bottomShadow = event.index === 0 ? true : false
}
},
}
</script>
<style lang="scss" scoped>
@import '@/static/css/templatePage/custom_nav_bar.scss';
.custom-nav-content {
width: 80%;
height: 100%;
display: flex;
align-items: center;
margin-left: 20rpx;
.search-content {
flex: 1;
.search-input {
border-radius: 30rpx;
/* #ifdef MP-WEIXIN */
/deep/ .tn-input-class {
border-radius: 30rpx;
}
/* #endif */
}
}
}
</style>
+93
View File
@@ -0,0 +1,93 @@
<template>
<view class="components-notice-bar tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>noticeBar通知栏</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsNoticeBar',
components: {demoTitle},
data() {
return {
list: [
'TuniaoUI现已发布V1.0.0',
'今天天气晴朗,适合处理bug',
'TuniaoUIV2.0.0即将发布',
'今天想提前下班,领导不允许:"你提前走人就算你是旷工了啊!"'
],
closeNoticeShow: true,
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
+80
View File
@@ -0,0 +1,80 @@
<template>
<view class="components-number_box tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>numberBox步进输入</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsNumberBox',
components: {demoTitle},
data() {
return {
value1: 0,
value2: 0,
value3: 0,
value4: 0,
value5: 0,
value6: 0,
value7: 0
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-number_box {
min-height: 100vh;
}
</style>
+303
View File
@@ -0,0 +1,303 @@
<template>
<view class="components-picker">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Picker选择器</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 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>
</dynamic-demo-template>
</view>
<!-- picker -->
<tn-picker
v-model="show"
:mode="mode"
:params="params"
:range="range"
:rangeKey="rangeKey"
:defaultSelector="defaultSelector"
:showTimeTag="showTimeTag"
:startYear="startYear"
:endYear="endYear"
:defaultTime="defaultTime"
:defaultRegin="defaultRegion"
:areaCode="areaCode"
:maskCloseable="maskCloseable"
@cancel="cancelPicker"
@confirm="confirmPicker"
>
</tn-picker>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsPicker',
components: {dynamicDemoTemplate},
data() {
return {
result: 'Picker结果',
show: false,
mode: 'selector',
params: {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false,
province: true,
city: true,
area: true,
timestamp: true
},
showTimeTag: false,
startYear: 2000,
endYear: 2100,
defaultTime: '2021/10/01 12:00:00',
defaultRegion: ['广东省','广州市','天河区'],
areaCode: [],
maskCloseable: true,
range: ['哆啦A梦','大熊','小夫','静香','胖虎'],
rangeKey: '',
defaultSelector: [0],
tips: ['无需依赖额外的样式文件','使用tn-picker组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '模式',
optional: ['单列','多列','时间','地区'],
methods: 'modeChange'
},
{
title: '显示时分秒',
optional: ['隐藏','显示'],
methods: 'timeSecondChange',
show: false
},
{
title: '显示时间单位',
optional: ['隐藏','显示'],
methods: 'showTimeTagChange',
show: false
},
{
title: '指定起始年份',
optional: ['2000-2100','2020-2030'],
methods: 'timeRangeChange',
show: false
},
{
title: '默认时间',
optional: ['2021/10/01 12:00:00','2021-10-01 17:00:00'],
methods: 'defaultTimeChange',
show: false
},
{
title: '默认地区',
optional: ['广东省-广州市-天河区','44-4401-440107'],
methods: 'defaultRegionChange',
show: false
},
{
title: '点击遮罩关闭',
optional: ['是','否'],
methods: 'maskCloseableChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出Picker
showPicker(event) {
this.openPicker()
},
// 切换模式
modeChange(event) {
switch(event.index) {
case 0:
this.mode = 'selector'
this.range = ['哆啦A梦','大熊','小夫','静香','胖虎']
this.defaultSelector = [0]
this.rangeKey = ''
this.$refs.demoTemplate.updateSectionBtnsState([1,2,3,4], false)
this.$refs.demoTemplate.updateSectionBtnsState(5, false)
break
case 1:
this.mode = 'multiSelector'
this.range = [
[
{
id: 1,
name: '哆啦A梦'
},
{
id: 2,
name: '大熊'
},
{
id: 3,
name: '小夫'
},
{
id: 4,
name: '静香'
},
{
id: 5,
name: '胖虎'
},
],
[
{
id: 1,
name: '家'
},
{
id: 2,
name: '学校'
},
{
id: 3,
name: '操场'
}
]
]
this.defaultSelector = [0,0]
this.rangeKey = 'name'
this.$refs.demoTemplate.updateSectionBtnsState([1,2,3,4], false)
this.$refs.demoTemplate.updateSectionBtnsState(5, false)
break
case 2:
this.mode = 'time'
this.$refs.demoTemplate.updateSectionBtnsState([1,2,3,4], true)
this.$refs.demoTemplate.updateSectionBtnsState(5, false)
break
case 3:
this.mode = 'region'
this.$refs.demoTemplate.updateSectionBtnsState([1,2,3,4], false)
this.$refs.demoTemplate.updateSectionBtnsState(5, true)
break
}
this.openPicker()
},
// 切换显示时分秒
timeSecondChange(event) {
this.params = {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
province: true,
city: true,
area: true,
timestamp: true
}
this.openPicker()
},
// 切换显示时间单位
showTimeTagChange(event) {
this.showTimeTag = event.index === 0 ? false : true
this.openPicker()
},
// 切换起始年份
timeRangeChange(event) {
if (event.index === 0) {
this.startYear = 2000
this.endYear = 2100
} else if (event.index === 1) {
this.startYear = 2020
this.endYear = 2030
}
this.openPicker()
},
// 切换默认时间
defaultTimeChange(event) {
this.defaultTime = event.name
this.openPicker()
},
// 切换默认地区
defaultRegionChange(event) {
if (event.index === 0) {
this.defaultRegion = ['广东省','广州市','天河区']
this.areaCode = []
} else if (event.index === 1) {
this.defaultRegion = []
this.areaCode = ['44','4401','440111']
}
this.openPicker()
},
// 切换点击遮罩关闭
maskCloseableChange(event) {
this.maskCloseable = event.index === 0 ? true : false
this.openPicker()
},
// 点击取消按钮
cancelPicker(event) {
this.$tn.message.toast('点击了取消按钮')
},
// 点击确认按钮
confirmPicker(event) {
switch (this.mode) {
case 'selector':
this.result = this.range[event[0]]
this.defaultSelector = event
break
case 'multiSelector':
this.result = `${this.range[0][event[0]][this.rangeKey]} - ${this.range[1][event[1]][this.rangeKey]}`
this.defaultSelector = event
break
case 'time':
this.result = `${event.year}-${event.month}-${event.day} ${this.params.hour ? event.hour+':' : ''}${this.params.minute ? event.minute+':' : ''}${this.params.second ? event.second : ''}`
this.defaultTime = this.result
break
case 'region':
this.result = `${event.province.label}-${event.city.label}-${event.area.label}`
break
}
},
// 打开Picker
openPicker() {
this.show = true
},
},
}
</script>
<style lang="scss" scoped>
.picker-result {
margin-top: 20rpx;
padding: 10rpx 30rpx;
background-color: $tn-font-holder-color;
text-align: center;
}
</style>
+240
View File
@@ -0,0 +1,240 @@
<template>
<view class="components-popup">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>弹框</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" :disabled="show" @click="showPopup">弹出弹框</tn-button>
</dynamic-demo-template>
</view>
<!-- popup -->
<tn-popup
v-model="show"
:marginTop="vuex_custom_bar_height"
length="50%"
:mode="mode"
:backgroundColor="backgroundColor"
:width="width"
:height="height"
:borderRadius="borderRadius"
:closeBtn="closeBtn"
:closeBtnIcon="closeBtnIcon"
:closeBtnPosition="closeBtnPosition"
:maskCloseable="maskCloseable"
@close="closedPopup"
>
<view class="popup-content" :class="{'popup-content--center': mode === 'center'}">
<tn-button shape="round" @click="closedPopup" width="220rpx" fontColor="#080808">关闭弹窗</tn-button>
</view>
</tn-popup>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsPopup',
components: {dynamicDemoTemplate},
data() {
return {
show: false,
mode: 'left',
backgroundColor: '',
width: '',
height: '',
borderRadius: 0,
closeBtn: true,
closeBtnIcon: 'close',
closeBtnPosition: 'top-right',
maskCloseable: true,
popupShowSubsectionIndex: 1,
tips: ['无需依赖额外的样式文件','使用tn-popup组件, 如果使用了自定义顶部,需要设置marginTop属性为自定义顶部的高度'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '背景颜色',
optional: ['默认','tn-bg-grey--light','#C6D1D8'],
methods: 'backgroundColorChange'
},
{
title: '宽高',
optional: ['默认','自定义'],
methods: 'widthHeightChange'
},
{
title: '圆角',
optional: ['0','23'],
methods: 'borderRadiusChange'
},
{
title: '弹出位置',
optional: ['上','下','中','左','右'],
methods: 'modeChange',
current: 3
},
{
title: '关闭按钮',
optional: ['显示','隐藏'],
methods: 'closeBtnChange'
},
{
title: '关闭按钮图标',
optional: ['close','cross-fill'],
methods: 'closeBtnIconChange'
},
{
title: '关闭按钮位置',
optional: ['左上','右上','左下','右下'],
methods: 'closeBtnPositionChange',
current: 1
},
{
title: '点击遮罩关闭',
optional: ['是','否'],
methods: 'maskCloseableChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出弹框
showPopup() {
this.openPopup()
},
// 切换弹出位置
modeChange(event) {
switch(event.index) {
case 0:
this.mode = 'top'
break
case 1:
this.mode = 'bottom'
break
case 2:
this.mode = 'center'
break
case 3:
this.mode = 'left'
break
case 4:
this.mode = 'right'
break
}
this.openPopup()
},
// 切换背景颜色
backgroundColorChange(event) {
this.backgroundColor = event.index === 0 ? '' : event.name
this.openPopup()
},
// 切换宽高设置
widthHeightChange(event) {
if (event.index === 0) {
this.width = ''
this.height = ''
} else {
this.width = this.mode !== 'center' ? '30%' : '60%'
this.height = this.mode !== 'center' ? '30%' : '20%'
}
this.openPopup()
},
// 切换圆角
borderRadiusChange(event) {
this.borderRadius = Number(event.name)
this.openPopup()
},
// 切换关闭按钮
closeBtnChange(event) {
if (event.index === 0) {
this.closeBtn = true
this.$refs.demoTemplate.updateSectionBtnsState([5,6], true)
} else {
this.closeBtn = false
this.$refs.demoTemplate.updateSectionBtnsState([5,6], false)
}
this.openPopup()
},
// 切换关闭按钮图标
closeBtnIconChange(event) {
this.closeBtnIcon = event.name
this.openPopup()
},
// 切换关闭按钮的位置
closeBtnPositionChange(event) {
switch(event.index) {
case 0:
this.closeBtnPosition = 'top-left'
break
case 1:
this.closeBtnPosition = 'top-right'
break
case 2:
this.closeBtnPosition = 'bottom-left'
break
case 3:
this.closeBtnPosition = 'bottom-right'
break
}
this.openPopup()
},
// 切换点击遮罩关闭
maskCloseableChange(event) {
if (event.index === 0) {
this.maskCloseable = true
} else {
this.maskCloseable = false
this.closeBtn = true
this.$refs.demoTemplate.updateSectionBtnsValue(0, 4, 0)
this.$refs.demoTemplate.updateSectionBtnsState([5,6], true)
}
this.openPopup()
},
// 打开Popup
openPopup() {
this.show = true
},
// 关闭Popup
closedPopup() {
this.show = false
}
},
}
</script>
<style lang="scss" scoped>
.popup-content {
height: 100%;
width: auto;
display: flex;
justify-content: center;
align-items: center;
&--center {
padding: 150rpx 50rpx;
}
}
</style>
+97
View File
@@ -0,0 +1,97 @@
<template>
<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'}">
<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>
<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>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsProgress',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-progress {
min-height: 100vh;
}
tn-line-progress, .tn-line-progress {
width: 100%;
}
</style>
+89
View File
@@ -0,0 +1,89 @@
<template>
<view class="components-radio tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Radio单选按钮</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基础">
<tn-radio-group>
<tn-radio name="选项1">选项1</tn-radio>
<tn-radio name="选项2" disabled>选项2(禁止选中)</tn-radio>
<tn-radio name="选项3">选项3</tn-radio>
</tn-radio-group>
</demo-title>
<demo-title title="方形选框">
<tn-radio-group shape="square">
<tn-radio name="选项1">选项1</tn-radio>
<tn-radio name="选项2">选项2</tn-radio>
<tn-radio name="选项3">选项3</tn-radio>
</tn-radio-group>
</demo-title>
<demo-title title="竖直排列">
<tn-radio-group width="100%" wrap>
<tn-radio name="选项1">选项1</tn-radio>
<tn-radio name="选项2">选项2</tn-radio>
<tn-radio name="选项3">选项3</tn-radio>
</tn-radio-group>
</demo-title>
<demo-title title="禁止点击标签">
<tn-radio-group :disabledLabel="true">
<tn-radio name="选项1">选项1</tn-radio>
<tn-radio name="选项2">选项2</tn-radio>
<tn-radio name="选项3">选项3</tn-radio>
</tn-radio-group>
</demo-title>
<demo-title title="自定义尺寸">
<view>
<tn-radio-group :size="20" :iconSize="14">
<tn-radio name="选项1">选项1</tn-radio>
<tn-radio name="选项2">选项2</tn-radio>
<tn-radio name="选项3" :size="36" :iconSize="26">选项3</tn-radio>
</tn-radio-group>
</view>
<view class="tn-margin-top">
<tn-radio-group :size="46" :iconSize="36">
<tn-radio name="选项1">选项1</tn-radio>
<tn-radio name="选项2">选项2</tn-radio>
<tn-radio name="选项3">选项3</tn-radio>
</tn-radio-group>
</view>
</demo-title>
<demo-title title="自定义颜色">
<tn-radio-group activeColor="#31E749">
<tn-radio name="选项1">选项1</tn-radio>
<tn-radio name="选项2">选项2</tn-radio>
<tn-radio name="选项3" activeColor="#E83A30">选项3</tn-radio>
</tn-radio-group>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsRadio',
components: {demoTitle},
data() {
return {
}
}
}
</script>
<style lang="scss" scoped>
</style>
+84
View File
@@ -0,0 +1,84 @@
<template>
<view class="components-rate tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>rate评分</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsRate',
components: {demoTitle},
data() {
return {
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: {
}
}
</script>
<style lang="scss" scoped>
.components-rate {
min-height: 100vh;
}
</style>
+84
View File
@@ -0,0 +1,84 @@
<template>
<view class="components-read-more tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>ReadMore查看更多</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基本使用">
<tn-read-more>
<rich-text :nodes="content"></rich-text>
</tn-read-more>
</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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsReadMore',
components: {demoTitle},
data() {
return {
content: `噫吁嚱,危乎高哉!
蜀道之难,难于上青天!
蚕丛及鱼凫,开国何茫然!
尔来四万八千岁,不与秦塞通人烟。
西当太白有鸟道,可以横绝峨眉巅。
地崩山摧壮士死,然后天梯石栈相钩连。
上有六龙回日之高标,下有冲波逆折之回川。
黄鹤之飞尚不得过,猿猱欲度愁攀援。
青泥何盘盘,百步九折萦岩峦。
扪参历井仰胁息,以手抚膺坐长叹。
问君西游何时还?畏途巉岩不可攀。
但见悲鸟号古木,雄飞雌从绕林间。
又闻子规啼夜月,愁空山。
蜀道之难,难于上青天,使人听此凋朱颜!
连峰去天不盈尺,枯松倒挂倚绝壁。
飞湍瀑流争喧豗,砯崖转石万壑雷。
其险也如此,嗟尔远道之人胡为乎来哉!(也如此 一作:也若此)
剑阁峥嵘而崔嵬,一夫当关,万夫莫开。
所守或匪亲,化为狼与豺。
朝避猛虎,夕避长蛇,磨牙吮血,杀人如麻。
锦城虽云乐,不如早还家。
蜀道之难,难于上青天,侧身西望长咨嗟!`,
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
+135
View File
@@ -0,0 +1,135 @@
<template>
<view class="components-scroll-list tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>ScrollList横向滚动</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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">
<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="[$tn.color.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 :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="[$tn.color.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="[$tn.color.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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsScrollList',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-scroll-list {
min-height: 100vh;
}
.icon3 {
&__item {
width: 30%;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 30rpx;
margin: 20rpx 10rpx;
margin-top: 0;
transform: scale(1);
transition: transform 0.3s linear;
transform-origin: center center;
&--icon {
width: 100rpx;
height: 100rpx;
font-size: 60rpx;
border-radius: 25%;
margin-bottom: 18rpx;
position: relative;
z-index: 1;
&::after {
content: " ";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
left: 0;
bottom: 0;
border-radius: inherit;
opacity: 1;
transform: scale(1, 1);
background-size: 100% 100%;
background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg6.png);
}
}
}
}
</style>
+381
View File
@@ -0,0 +1,381 @@
<template>
<view class="components-select">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Select列选择器</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 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>
</dynamic-demo-template>
</view>
<!-- select -->
<tn-select
v-model="show"
:mode="mode"
title="请选择数据"
:list="list"
:maskCloseable="maskCloseable"
@cancel="cancelSelect"
@confirm="confirmSelect"
>
</tn-select>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsSelect',
components: {dynamicDemoTemplate},
data() {
return {
result: 'Select结果',
show: false,
mode: 'single',
list: [
{
value: 1,
label: '哆啦A梦'
},
{
value: 2,
label: '大熊'
},
{
value: 3,
label: '小夫'
},
{
value: 4,
label: '静香'
},
{
value: 5,
label: '胖虎'
},
{
value: 6,
label: '大星'
},
],
maskCloseable: true,
tips: ['无需依赖额外的样式文件','使用tn-select组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '模式',
optional: ['单列','多列','自动多列'],
methods: 'modeChange'
},
{
title: '点击遮罩关闭',
optional: ['是','否'],
methods: 'maskCloseableChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出Select
showSelect(event) {
this.openSelect()
},
// 切换模式
modeChange(event) {
switch(event.index) {
case 0:
this.mode = 'single'
this.list = [
{
value: 1,
label: '哆啦A梦'
},
{
value: 2,
label: '大熊'
},
{
value: 3,
label: '小夫'
},
{
value: 4,
label: '静香'
},
{
value: 5,
label: '胖虎'
}
]
break
case 1:
this.mode = 'multi'
this.list = [
[
{
value: 1,
label: '哆啦A梦'
},
{
value: 2,
label: '大熊'
},
{
value: 3,
label: '小夫'
},
{
value: 4,
label: '静香'
},
{
value: 5,
label: '胖虎'
},
],
[
{
value: 1,
label: '家'
},
{
value: 2,
label: '学校'
},
{
value: 3,
label: '操场'
}
]
]
break
case 2:
this.mode = 'multi-auto'
this.list = [
{
value: 11,
label: '森林—1',
children: [
{
value: 1101,
label: '树-11',
children: [
{
value: 110101,
label: '树叶-111'
},
{
value: 110102,
label: '树叶-112'
},
{
value: 110103,
label: '树叶-113'
},
{
value: 110104,
label: '树叶-114'
}
]
},
{
value: 1102,
label: '树-12',
children: [
{
value: 110201,
label: '树叶-121'
},
{
value: 110202,
label: '树叶-122'
},
{
value: 110203,
label: '树叶-123'
},
{
value: 110204,
label: '树叶-124'
}
]
},
{
value: 1103,
label: '树-13',
children: [
{
value: 110301,
label: '树叶-131'
},
{
value: 110302,
label: '树叶-132'
},
{
value: 110303,
label: '树叶-133'
},
{
value: 110304,
label: '树叶-134'
}
]
}
]
},
{
value: 12,
label: '森林—2',
children: [
{
value: 1201,
label: '树-21',
children: [
{
value: 120101,
label: '树叶-211'
},
{
value: 120102,
label: '树叶-212'
},
{
value: 120103,
label: '树叶-213'
},
{
value: 120104,
label: '树叶-214'
}
]
},
{
value: 1202,
label: '树-22',
children: [
{
value: 120201,
label: '树叶-221'
},
{
value: 120202,
label: '树叶-222'
},
{
value: 120203,
label: '树叶-223'
},
{
value: 120204,
label: '树叶-224'
}
]
},
{
value: 1203,
label: '树-23',
children: [
{
value: 120301,
label: '树叶-231'
},
{
value: 120302,
label: '树叶-232'
},
{
value: 120303,
label: '树叶-233'
},
{
value: 120304,
label: '树叶-234'
}
]
}
]
}
]
break
}
this.openSelect()
},
// 切换点击遮罩关闭
maskCloseableChange(event) {
this.maskCloseable = event.index === 0 ? true : false
this.openSelect()
},
// 点击取消按钮
cancelSelect(event) {
this.$tn.message.toast('点击了取消按钮')
},
// 点击确认按钮
confirmSelect(event) {
console.log(event);
switch (this.mode) {
case 'single':
this.result = event[0]['label']
break
case 'multi':
this.result = ''
if (event.length) {
event.map((item, index) => {
if (index !== 0) this.result += ' - '
this.result += item.label
})
}
break
case 'multi-auto':
this.result = ''
if (event.length) {
event.map((item, index) => {
if (index !== 0) this.result += ' - '
this.result += item.label
})
}
break
}
},
// 打开Select
openSelect() {
this.show = true
},
},
}
</script>
<style lang="scss" scoped>
.select-result {
margin-top: 10rpx;
padding: 10rpx 30rpx;
background-color: $tn-font-holder-color;
text-align: center;
}
</style>
+134
View File
@@ -0,0 +1,134 @@
<template>
<view class="components-toast">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed :beforeBack="beforeBack">SignBoard签字板</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
<view class="tn-flex tn-flex-direction-column tn-flex-col-center tn-flex-row-center">
<view class="image">
<image v-if="imageSrc" :src="imageSrc" mode="heightFix"></image>
</view>
<view class="button">
<tn-button fontColor="tn-color-white" @click="showSignBoard">弹出签字板</tn-button>
</view>
</view>
</dynamic-demo-template>
</view>
<!-- SignBoard -->
<tn-sign-board :show="show" :customBarHeight="vuex_custom_bar_height" :signSelectColor="signSelectColor" :rotate="rotate" @save="saveSign" @closed="closeSign"></tn-sign-board>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
components: {dynamicDemoTemplate},
data() {
return {
show: false,
imageSrc: '',
signSelectColor: ['#080808', '#E83A30'],
rotate: true,
tips: ['无需依赖额外的样式文件','使用tn-sign-board组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '画笔颜色',
optional: ['默认','自定义'],
methods: 'colorChange'
},
{
title: '旋转签名',
optional: ['不旋转','旋转'],
methods: 'rotateChange',
current: 1
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出SignBoard
showSignBoard() {
this.show = true
},
// 切换画笔颜色
colorChange(event) {
switch (event.index) {
case 0:
this.signSelectColor = ['#080808', '#E83A30']
break
case 1:
this.signSelectColor = ['#838383', '#01BEFF']
break
}
this.showSignBoard()
},
// 切换旋转内容
rotateChange(event) {
this.rotate = event.index === 0 ? false : true
this.showSignBoard()
},
// 保存签名
saveSign(e) {
// console.log(e);
this.imageSrc = e
this.show = false
},
// 关闭签名板
closeSign() {
this.show = false
},
// 返回前判断是否已经关闭了签名板
beforeBack() {
return new Promise((resolve, reject) => {
if (!this.show) {
resolve()
return
}
this.$tn.message.modal('操作提示','当前已经打开了签名板,是否确认需要关闭', () => {
resolve()
}, true, () => {
reject()
})
})
}
},
}
</script>
<style lang="scss" scoped>
.image {
height: 200rpx;
image {
height: 200rpx;
}
}
.button {
margin-top: 20rpx;
}
</style>
+236
View File
@@ -0,0 +1,236 @@
<template>
<view class="components-skeleton tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>骨架屏</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="tn-padding-top"></view>
<view class="news tn-skeleton">
<block v-for="(item, index) in list" :key="index">
<view class="news__item tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-top">
<view class="news__item__info tn-flex tn-flex-direction-row tn-flex-row-center tn-flex-col-center">
<view class="news__item__avatar tn-skeleton-circle">
<image :src="item.userInfo.avatar"></image>
</view>
<view class="news__item__outline tn-flex tn-flex-direction-column tn-flex-col-top tn-flex-row-around">
<view class="news__item__nick-name tn-skeleton-fillet">{{ item.userInfo.nickName}}</view>
<view class="news__item__release-date tn-skeleton-fillet">{{ item.content.releaseDate }}</view>
</view>
</view>
<view class="news__item__content tn-flex tn-flex-direction-row tn-flex-col-top tn-flex-row-center">
<view class="news__item__content__data">
<view class="news__item__title tn-text-ellipsis tn-skeleton-fillet">{{ item.content.title }}</view>
<view class="news__item__desc tn-text-ellipsis-2 tn-skeleton-fillet">{{ item.content.desc }}</view>
</view>
<view class="news__item__main-image tn-skeleton-rect">
<image :src="item.content.mainImage" mode="aspectFill"></image>
</view>
</view>
</view>
</block>
</view>
<view class="tn-padding-bottom-lg"></view>
</view>
<!-- 引用组件 -->
<tn-skeleton :show="showSkeleton"></tn-skeleton>
</view>
</template>
<script>
export default {
name: 'ComponentsSkeleton',
data() {
return {
showSkeleton: true,
list: [
{
userInfo: {
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
nickName: '图鸟科技-北北'
},
content: {
title: '全新UI框架,tuniaoUI正式发布',
desc: '基于uniapp开发的UI框架,tuniaoUI现已正式发布,该UI最大的特点就是酷炫,相对于传统的UI框架,不仅仅提供了组件方便用户进行使用同时提供了酷炫的页面模板,让用户直接使用模板就可以做出精美的页面',
mainImage: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg',
releaseDate: '2020年12月30日'
}
},
{
userInfo: {
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
nickName: '图鸟科技-北北'
},
content: {
title: '全新UI框架,tuniaoUI正式发布',
desc: '基于uniapp开发的UI框架,tuniaoUI现已正式发布,该UI最大的特点就是酷炫,相对于传统的UI框架,不仅仅提供了组件方便用户进行使用同时提供了酷炫的页面模板,让用户直接使用模板就可以做出精美的页面',
mainImage: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg',
releaseDate: '2020年12月30日'
}
},
{
userInfo: {
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
nickName: '图鸟科技-北北'
},
content: {
title: '全新UI框架,tuniaoUI正式发布',
desc: '基于uniapp开发的UI框架,tuniaoUI现已正式发布,该UI最大的特点就是酷炫,相对于传统的UI框架,不仅仅提供了组件方便用户进行使用同时提供了酷炫的页面模板,让用户直接使用模板就可以做出精美的页面',
mainImage: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg',
releaseDate: '2020年12月30日'
}
},
{
userInfo: {
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
nickName: '图鸟科技-北北'
},
content: {
title: '全新UI框架,tuniaoUI正式发布',
desc: '基于uniapp开发的UI框架,tuniaoUI现已正式发布,该UI最大的特点就是酷炫,相对于传统的UI框架,不仅仅提供了组件方便用户进行使用同时提供了酷炫的页面模板,让用户直接使用模板就可以做出精美的页面',
mainImage: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg',
releaseDate: '2020年12月30日'
}
},
{
userInfo: {
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
nickName: '图鸟科技-北北'
},
content: {
title: '全新UI框架,tuniaoUI正式发布',
desc: '基于uniapp开发的UI框架,tuniaoUI现已正式发布,该UI最大的特点就是酷炫,相对于传统的UI框架,不仅仅提供了组件方便用户进行使用同时提供了酷炫的页面模板,让用户直接使用模板就可以做出精美的页面',
mainImage: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg',
releaseDate: '2020年12月30日'
}
},
{
userInfo: {
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
nickName: '图鸟科技-北北'
},
content: {
title: '全新UI框架,tuniaoUI正式发布',
desc: '基于uniapp开发的UI框架,tuniaoUI现已正式发布,该UI最大的特点就是酷炫,相对于传统的UI框架,不仅仅提供了组件方便用户进行使用同时提供了酷炫的页面模板,让用户直接使用模板就可以做出精美的页面',
mainImage: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg',
releaseDate: '2020年12月30日'
}
},
{
userInfo: {
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
nickName: '图鸟科技-北北'
},
content: {
title: '全新UI框架,tuniaoUI正式发布',
desc: '基于uniapp开发的UI框架,tuniaoUI现已正式发布,该UI最大的特点就是酷炫,相对于传统的UI框架,不仅仅提供了组件方便用户进行使用同时提供了酷炫的页面模板,让用户直接使用模板就可以做出精美的页面',
mainImage: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg',
releaseDate: '2020年12月30日'
}
},
{
userInfo: {
avatar: 'https://tnuiimage.tnkjapp.com/avatar/xiaomai1.jpg',
nickName: '图鸟科技-北北'
},
content: {
title: '全新UI框架,tuniaoUI正式发布',
desc: '基于uniapp开发的UI框架,tuniaoUI现已正式发布,该UI最大的特点就是酷炫,相对于传统的UI框架,不仅仅提供了组件方便用户进行使用同时提供了酷炫的页面模板,让用户直接使用模板就可以做出精美的页面',
mainImage: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg',
releaseDate: '2020年12月30日'
}
}
]
}
},
onLoad() {
// 模拟加载数据完毕
setTimeout(() => {
this.showSkeleton = false
}, 3000)
}
}
</script>
<style lang="scss" scoped>
.components-skeleton {
// background-color: $tn-bg-gray-color;
}
.news {
position: relative;
&__item {
margin: 0 30rpx;
padding: 10rpx;
background-color: #FFFFFF;
border-radius: 10rpx;
box-shadow: 4rpx 6rpx 28rpx 0px rgba(0, 0, 0, 0.1);
margin-bottom: 30rpx;
&__info {
height: 80rpx;
margin-bottom: 20rpx;
}
&__avatar {
width: 80rpx;
height: 100%;
border-radius: 100%;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
&__outline {
height: 100%;
margin-left: 20rpx;
}
&__nick-name {
font-size: 30rpx;
margin-bottom: 6rpx;
}
&__release-date {
font-size: 22rpx;
color: $tn-font-sub-color;
}
&__content {
height: 140rpx;
&__data {
width: 60%;
margin-right: 10rpx;
}
}
&__title {
width: 100%;
font-size: 30rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
&__desc {
width: 100%;
word-break: break-all;
font-size: 24rpx;
}
&__main-image {
width: 40%;
height: 100%;
border-radius: 5rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
}
}
</style>
+97
View File
@@ -0,0 +1,97 @@
<template>
<view class="components-slider tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>slider滑动条</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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">
{{ value7 }}
</view>
</tn-slider>
</demo-title>
<demo-title title="配合formItem使用">
<tn-form>
<tn-form-item label="价格区间" :labelWidth="140">
<tn-slider v-model="value8"></tn-slider>
</tn-form-item>
</tn-form>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsSlider',
components: {demoTitle},
data() {
return {
value1: 0,
value2: 0,
value3: 0,
value4: 0,
value5: 0,
value6: 0,
value7: 0,
value8: 0
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-slider {
min-height: 100vh;
}
.tn-slider__custom-block {
background-color: $tn-color-orange;
width: auto;
height: 40rpx;
line-height: 40rpx;
padding: 0 10rpx;
border-radius: 50%;
text-align: center;
color: #FFFFFF;
}
</style>
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+105
View File
@@ -0,0 +1,105 @@
<template>
<view class="components-steps tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Steps步骤条</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsSteps',
components: {demoTitle},
data() {
return {
list: [
{name: '第一步'},
{name: '第二步', icon: 'trusty', selectIcon: 'trusty-fill'},
{name: '第三步', icon: 'safe', selectIcon: 'safe-fill'},
{name: '第四步', icon: 'vip', selectIcon: 'vip-fill'}
],
current: 0
}
},
methods: {
prevStep() {
let current = this.current
current--
this.current = current < 0 ? 0 : current
},
nextStep() {
let current = this.current
current++
this.current = current > this.list.length ? this.list.length : current
},
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>
+67
View File
@@ -0,0 +1,67 @@
<template>
<view class="components-sticky tn-safe-area-inset-bottom" style="height: 200vh;">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>sticky吸顶</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsSticky',
components: {demoTitle},
data() {
return {
}
},
methods: {
}
}
</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;
border-radius: 10rpx;
}
</style>
+68
View File
@@ -0,0 +1,68 @@
<template>
<view class="components-subsection tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>分段器</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基本使用">
<tn-subsection :list="list"></tn-subsection>
</demo-title>
<demo-title title="按钮模式">
<tn-subsection :list="list" mode="button"></tn-subsection>
<view class="tn-margin-top">
<tn-subsection :list="list" mode="button" :borderRadius="50"></tn-subsection>
</view>
</demo-title>
<demo-title title="取消切换动画">
<tn-subsection :list="list" :animation="false"></tn-subsection>
</demo-title>
<demo-title title="贝塞尔曲线切换动画">
<tn-subsection :list="list" animationType="cubic-bezier"></tn-subsection>
<view class="tn-margin-top">
<tn-subsection :list="list" mode="button" :borderRadius="50" animationType="cubic-bezier"></tn-subsection>
</view>
</demo-title>
<demo-title title="选中字体设置为粗体">
<tn-subsection :list="list" :bold="true"></tn-subsection>
</demo-title>
<demo-title title="自定义样式">
<tn-subsection :list="list" :height="40" :fontSize="20"></tn-subsection>
<view class="tn-margin-top">
<tn-subsection :list="list" mode="button" :borderRadius="50" backgroundColor="tn-cool-bg-color-9" buttonColor="tn-cool-bg-color-7" inactiveColor="#FFFFFF" activeColor="#27A1BA"></tn-subsection>
</view>
<view class="tn-margin-top">
<tn-subsection :list="list" :borderRadius="50" backgroundColor="#FFFFFF" buttonColor="#E83A30" inactiveColor="#838383"></tn-subsection>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'ComponentsSubsection',
components: { demoTitle },
data() {
return {
list: ['全部','未付款','待发货','待收货','待评价']
}
}
}
</script>
<style lang="scss" scoped>
</style>
@@ -0,0 +1,244 @@
<template>
<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'}">
<demo-title title="基本使用">
<!-- <tn-swipe-action>
</tn-swipe-action> -->
<tn-swipe-action-item :options="options1" name="0" @click="onSwiperItemClick">
<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">
基本使用
</view>
<view class="swipe-action__item__info__desc">
向左滑动即可看到
</view>
</view>
</view>
</tn-swipe-action-item>
</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 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>
</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 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>
</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 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>
</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 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>
</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 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>
</tn-swipe-action-item>
</tn-swipe-action>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsSwipeAction',
components: { demoTitle },
data() {
return {
// 滑动菜单
options1: [{
text: '置顶',
style: {
backgroundColor: '#FFA726'
}
}],
options2: [{
text: '置顶',
style: {
backgroundColor: '#FFA726'
}
},
{
text: '删除',
style: {
backgroundColor: '#E83A30'
}
}
],
options3: [{
text: '置顶',
icon: 'star',
style: {
backgroundColor: '#FFA726'
}
},
{
text: '删除',
icon: 'delete',
style: {
backgroundColor: '#E83A30'
}
}
],
options4: [{
icon: 'star',
style: {
backgroundColor: '#FFA726',
width: '80rpx',
height: '80rpx',
margin: '0 12rpx',
borderRadius: '100rpx'
}
},
{
icon: 'delete',
style: {
backgroundColor: '#E83A30',
width: '80rpx',
height: '80rpx',
margin: '0 12rpx',
borderRadius: '100rpx'
}
}
]
}
},
methods: {
// 处理swiperActionItem点击事件
onSwiperItemClick(e) {
if (e.type === 'button') {
this.$tn.message.toast(`点击了第${e.index}个按钮`)
} else if (e.type === 'item') {
this.$tn.message.toast(`点击了item标签,name为${e.name}`)
}
}
}
}
</script>
<style lang="scss" scoped>
.swipe-action__item {
padding: 10rpx 20rpx;
&__image {
image {
width: 80rpx;
height: 80rpx;
border-radius: 20rpx;
}
}
&__info {
margin-left: 20rpx;
&__title {
font-size: 30rpx;
font-weight: bold;
}
&__desc {
margin-top: 5rpx;
font-size: 22rpx;
color: $tn-font-sub-color;
}
}
}
</style>
+73
View File
@@ -0,0 +1,73 @@
<template>
<view class="components-swiper tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Swiper轮播图</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsSwiper',
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: '秋天'},
{image: 'https://tnuiimage.tnkjapp.com/swiper/winter.jpg', title: '冬天'},
]
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
+96
View File
@@ -0,0 +1,96 @@
<template>
<view class="components-switch tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Switch开光</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsSwitch',
components: {demoTitle},
data() {
return {
value1: false,
value2: false,
value3: false,
value4: false,
value5: false,
value6: false,
value7: false,
value8: false,
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.components-switch {
min-height: 100vh;
}
</style>
+94
View File
@@ -0,0 +1,94 @@
<template>
<view class="components-tabs tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>tabs标签</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<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>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsTabs',
components: {demoTitle},
data() {
return {
current: 0,
activeItemStyle: {
borderTop: '1rpx solid #E6E6E6'
},
barStyle: {
boxShadow: `12rpx 12rpx 16rpx #01BEFF`
},
scrollList: [
{name: '关注', count: 10},
{name: '推荐'},
{name: '热榜', count: '99+'},
{name: '搞笑'},
{name: '视频'},
{name: '科技'},
{name: '音乐'},
{name: '电影'},
{name: '游戏'}
],
fixedList: [
{name: '关注', count: 10},
{name: '推荐'},
{name: '热榜', count: '99+'},
{name: '搞笑'}
]
}
},
methods: {
// tab选项卡切换
tabChange(index) {
this.current = index
}
}
}
</script>
<style lang="scss" scoped>
.components-tabs {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
</style>
+223
View File
@@ -0,0 +1,223 @@
<template>
<view class="components-time-line">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Timeline时间轴</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="time-line__wrap">
<tn-time-line>
<block v-for="(item, index) in expressData" :key="index">
<tn-time-line-item v-if="item.status !== 0" :top="2">
<template slot="node">
<view class="time-line-item__node">
<view v-if="item.status === 1" class="time-line-item__node--icon tn-icon-image-text"></view>
<view v-if="item.status === 2" class="time-line-item__node--icon tn-icon-prize"></view>
<view v-if="item.status === 3" class="time-line-item__node--icon tn-icon-gift"></view>
<view v-if="item.status === 4" class="time-line-item__node--icon tn-icon-logistics"></view>
<view v-if="item.status === 5" class="time-line-item__node--icon tn-icon-my"></view>
<view v-if="item.status === 6" class="time-line-item__node--icon tn-icon-cardbag"></view>
<view v-if="item.status === 7" class="time-line-item__node--icon tn-icon-success"></view>
</view>
</template>
<template slot="content">
<view>
<view v-if="item.status === 1" class="time-line-item__content__title">已下单</view>
<view v-if="item.status === 2" class="time-line-item__content__title">已发货</view>
<view v-if="item.status === 3" class="time-line-item__content__title">已揽件</view>
<view v-if="item.status === 4" class="time-line-item__content__title">运输中</view>
<view v-if="item.status === 5" class="time-line-item__content__title">派送中</view>
<view v-if="item.status === 6" class="time-line-item__content__title">待取件</view>
<view v-if="item.status === 7" class="time-line-item__content__title">已签收</view>
<view class="time-line-item__content__desc">{{ item.info }}</view>
<view class="time-line-item__content__time">{{ item.time }}</view>
</view>
</template>
</tn-time-line-item>
<tn-time-line-item v-else>
<template slot="content">
<view>
<view class="time-line-item__content__desc">{{ item.info }}</view>
<view class="time-line-item__content__time">{{ item.time }}</view>
</view>
</template>
</tn-time-line-item>
</block>
</tn-time-line>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'componentsTimeline',
data() {
return {
expressData: [
{
info: '派送成功',
status: 7,
time: '2021-11-11 17:42'
},
{
info: '[代收点] 您的快件已从XXX顺丰速运代理店取出〖来自代收点〗',
status: 0,
time: '2021-11-11 17:31'
},
{
info: '快件领取成功',
status: 0,
time: '2021-11-11 17:31'
},
{
info: '[代收点] 您的顺丰速运包裹已由XXX顺丰速运代理店代收,代收点地址:XXX, 联系电话:18888888888 〖来自代收点〗',
status: 6,
time: '2021-11-11 17:15'
},
{
info: '快件交给XXX,正在派送途中(联系电话:18888888888,顺丰已开启“安全呼叫”保护您的电话隐私,请放心接听!)(主单总件数:1件)',
status: 5,
time: '2021-11-11 17:07'
},
{
info: '快件到达〖XXX合作点〗',
status: 4,
time: '2021-11-11 16:25'
},
{
info: '快件在〖XXX营业点〗完成分拣,准备发往〖XXX合作点〗',
status: 0,
time: '2021-11-11 13:50'
},
{
info: '快件到达〖XXX营业点〗',
status: 0,
time: '2021-11-11 13:06'
},
{
info: '快件在〖XXX集散点〗完成分拣,准备发往〖XXX营业点〗',
status: 0,
time: '2021-11-11 12:04'
},
{
info: '快件到达〖XXX集散点〗',
status: 0,
time: '2021-11-11 10:14'
},
{
info: '快件在〖XXX中转场〗完成分拣,准备发往〖XXX集散点〗',
status: 0,
time: '2021-11-11 05:52'
},
{
info: '快件到达〖XXX转场〗',
status: 0,
time: '2021-11-11 05:36'
},
{
info: '快件在〖XXX中转场〗完成分拣,准备发往〖XXX中转场〗',
status: 0,
time: '2021-11-10 23:36'
},
{
info: '快件到达〖XXX中转场〗',
status: 0,
time: '2021-11-10 22:34'
},
{
info: '快件在〖XXX营业部〗完成分拣,准备发往〖XXX中转场〗',
status: 0,
time: '2021-11-10 22:01'
},
{
info: '顺丰速运已收取快件',
status: 3,
time: '2021-11-10 21:54'
},
{
info: '包裹正在等待揽收',
status: 1,
time: '2021-11-10 17:41'
},
{
info: '商品已经下单',
status: 1,
time: '2021-11-10 12:17'
}
]
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.tn-time-line-class {
.tn-time-line-item-class {
&:first-child {
.tn-time-line-item__node {
.time-line-item__node {
background-color: $tn-main-color !important;
}
}
}
}
}
.time-line {
&__wrap {
padding: 60rpx 30rpx 30rpx 60rpx;
}
&-item {
&__node {
width: 44rpx;
height: 44rpx;
border-radius: 100rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #AAAAAA;
&--active {
background-color: $tn-main-color;
}
&--icon {
color: #FFFFFF;
font-size: 24rpx;
}
}
&__content {
&__title {
font-weight: bold;
font-size: 32rpx;
}
&__desc {
color: $tn-font-sub-color;
font-size: 28rpx;
margin-bottom: 6rpx;
}
&__time {
color: $tn-font-holder-color;
font-size: 26rpx;
}
}
}
}
</style>
+133
View File
@@ -0,0 +1,133 @@
<template>
<view class="components-tips">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>提示信息框</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showTips">弹出Tips</tn-button>
</dynamic-demo-template>
</view>
<!-- Tips -->
<tn-tips
ref="tips"
:position="position"
:top="vuex_custom_bar_height"
@close="closeTips"
></tn-tips>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsTips',
components: {dynamicDemoTemplate},
data() {
return {
msg: '这是一条信息',
backgroundColor: '',
fontColor: '',
duration: 2000,
position: '',
tips: ['无需依赖额外的样式文件','使用tn-tips组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '自定义颜色',
optional: ['默认','自定义'],
methods: 'colorChange'
},
{
title: '弹出位置',
optional: ['默认','顶部','中间','底部'],
methods: 'positionChange'
},
{
title: '关闭时间',
optional: ['默认','5000'],
methods: 'durationChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出Tips
showTips() {
this.openTips()
},
// 切换弹出位置
positionChange(event) {
switch(event.index) {
case 0:
this.position = ''
break
case 1:
this.position = 'top'
break
case 2:
this.position = 'center'
break
case 3:
this.position = 'bottom'
break
}
this.openTips()
},
// 切换颜色
colorChange(event) {
if (event.index === 0) {
this.backgroundColor = ''
this.fontColor = ''
} else {
this.backgroundColor = 'tn-bg-gray--light'
this.fontColor = '#E83A30'
}
this.openTips()
},
// 切换Tips关闭时间
durationChange(event) {
this.duration = event.index === 0 ? 2000 : Number(event.name)
this.openTips()
},
// 打开Tips
openTips() {
this.$refs.tips.show({
msg: this.msg,
backgroundColor: this.backgroundColor,
fontColor: this.fontColor,
duration: this.duration
})
},
// 关闭Tips
closeTips() {
this.$tn.message.toast('tips提示框关闭了')
}
},
}
</script>
<style lang="scss" scoped>
</style>
+139
View File
@@ -0,0 +1,139 @@
<template>
<view class="components-toast">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Toast</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="showToast">弹出Toast</tn-button>
</dynamic-demo-template>
</view>
<!-- Toast -->
<tn-toast
ref="toast"
@closed="closedToast"
></tn-toast>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsToast',
components: {dynamicDemoTemplate},
data() {
return {
title: '提示信息',
content: '欢迎使用图鸟UI',
icon: 'balancecar',
image: '',
duration: 2000,
tips: ['无需依赖额外的样式文件','使用tn-toast组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '标题',
optional: ['无标题','有标题'],
methods: 'titleChange',
current: 1
},
{
title: '内容',
optional: ['无内容','有内容'],
methods: 'contentChange',
current: 1
},
{
title: '图标',
optional: ['无图标','balancecar','图片'],
methods: 'iconChange',
current: 1
},
{
title: '关闭时间',
optional: ['默认','5000'],
methods: 'durationChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 弹出Toast
showToast() {
this.openToast()
},
// 切换Toast标题
titleChange(event) {
this.title = event.index === 0 ? '' : '提示信息'
this.openToast()
},
// 切换Toast内容
contentChange(event) {
this.content = event.index === 0 ? '' : '欢迎使用图鸟UI'
this.openToast()
},
// 切换Toast图标
iconChange(event) {
switch (event.index) {
case 0:
this.icon = ''
this.image = ''
break
case 1:
this.icon = event.name
this.image = ''
break
case 2:
this.icon = ''
this.image = '/static/favicon.ico'
break
}
this.openToast()
},
// 切换Toast关闭时间
durationChange(event) {
this.duration = event.index === 0 ? 2000 : Number(event.name)
this.openToast()
},
// 打开Toast
openToast() {
this.$refs.toast.show({
title: this.title,
content: this.content,
icon: this.icon,
image: this.image,
duration: this.duration
})
},
// 关闭Toast
closedToast() {
this.$tn.message.toast('Toast关闭')
}
},
}
</script>
<style lang="scss" scoped>
</style>
@@ -0,0 +1,91 @@
<template>
<view class="components-verification-code-input tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>验证码输入</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<demo-title title="基础使用">
<view class="tn-bg-white">
<tn-verification-code-input v-model="value1"></tn-verification-code-input>
</view>
</demo-title>
<demo-title title="居中提示线">
<view class="tn-bg-white">
<tn-verification-code-input v-model="value2" mode="middleLine"></tn-verification-code-input>
</view>
</demo-title>
<demo-title title="底部提示线">
<view class="tn-bg-white">
<tn-verification-code-input v-model="value3" mode="bottomLine"></tn-verification-code-input>
</view>
</demo-title>
<demo-title title="修改验证码长度">
<view class="tn-bg-white">
<tn-verification-code-input v-model="value4" :maxLength="6"></tn-verification-code-input>
</view>
</demo-title>
<demo-title title="使用圆点隐藏已输入">
<view class="tn-bg-white">
<tn-verification-code-input v-model="value5" :dotFill="true"></tn-verification-code-input>
</view>
</demo-title>
<demo-title title="不带呼吸效果">
<view class="tn-bg-white">
<tn-verification-code-input v-model="value6" :breathe="false"></tn-verification-code-input>
</view>
</demo-title>
<demo-title title="字体加粗">
<view class="tn-bg-white">
<tn-verification-code-input v-model="value7" :bold="true"></tn-verification-code-input>
</view>
</demo-title>
<demo-title title="自定义样式">
<view class="tn-bg-white">
<tn-verification-code-input v-model="value8" :fontSize="40" :inputWidth="60" activeColor="#3D7EFF" inactiveColor="#9EBEFF"></tn-verification-code-input>
</view>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
</view>
</template>
<script>
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'ComponentsVerificationCode',
components: { demoTitle },
data() {
return {
value1: '24',
value2: '',
value3: '',
value4: '',
value5: '',
value6: '',
value7: '',
value8: '',
value9: '',
value10: '',
}
}
}
</script>
<style lang="scss" scoped>
.components-verification-code-input {
background-color: $tn-bg-gray-color;
min-height: 100vh;
}
</style>
@@ -0,0 +1,158 @@
<template>
<view class="components-verification_code">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>验证码倒计时</tn-nav-bar>
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
<view class="tn-flex tn-flex-row-center tn-flex-wrap">
<view style="width: 100%;">
<tn-form :labelWidth="120" :borderBottom="true">
<tn-form-item label="验证码">
<tn-input></tn-input>
<view slot="right">
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" size="sm" @click="getCode">{{ tips }}</tn-button>
</view>
</tn-form-item>
</tn-form>
</view>
<view style="width: 100%;">
<tn-button width="100%" backgroundColor="tn-bg-red" fontColor="tn-color-white" margin="30rpx 0 0 0" style="width: 100%;" @click="reset">重置</tn-button>
</view>
</view>
</dynamic-demo-template>
</view>
<!-- verification-code -->
<tn-verification-code
ref="code"
:keepRunning="keepRunning"
:seconds="seconds"
:startText="startText"
:countDownText="countDownText"
:endText="endText"
@end="codeEnd"
@start="codeStart"
@change="codeChange"
>
</tn-verification-code>
</view>
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
export default {
name: 'componentsVerificationCode',
components: {dynamicDemoTemplate},
data() {
return {
tips: '获取验证码',
keepRunning: true,
seconds: 60,
startText: '获取验证码',
countDownText: 's秒后重新获取',
endText: '重新获取',
tips: ['无需依赖额外的样式文件','使用tn-verification-code组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '倒计时间',
optional: ['60s','30s','5s'],
methods: 'secondsChange'
},
{
title: '退出后保持运行',
optional: ['是','否'],
methods: 'keepRunningChange'
},
{
title: '自定义提示语',
optional: ['默认','自定义'],
methods: 'customTitleChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 切换倒计时间
secondsChange(event) {
this.seconds = Number(event.name.replace('s',''))
},
// 切换是否保持
keepRunningChange(event) {
this.keepRunning = event.index === 0 ? true : false
},
// 切换是否使用自定义提示语
customTitleChange(event) {
switch (event.index) {
case 0:
this.startText = '点击获取验证码'
this.countDownText = '重新获取s秒后'
this.endText = '再次获取'
break
case 1:
this.startText = '获取验证码'
this.countDownText = 's秒后重新获取'
this.endText = '重新获取'
break
}
this.reset()
},
// 获取验证码
getCode() {
if (this.$refs.code.canGetCode) {
this.$tn.message.loading('正在获取验证码')
setTimeout(() => {
this.$tn.message.closeLoading()
this.$tn.message.toast('验证码已经发送')
// 通知组件开始计时
this.$refs.code.start()
}, 2000)
} else {
this.$tn.message.toast(this.$refs.code.secNum + '秒后再重试')
}
},
// 重置验证码
reset() {
this.$refs.code.reset()
},
// 开始倒计时
codeStart() {
this.$tn.message.toast('倒计时开始')
},
// 结束倒计时
codeEnd() {
this.$tn.message.toast('倒计时结束')
},
// 正在倒计时
codeChange(event) {
this.tips = event
}
},
}
</script>
<style lang="scss" scoped>
</style>
+14
View File
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>
+94
View File
@@ -0,0 +1,94 @@
<template>
<view class="demo-title">
<view>
<view v-if="type === 'first'" class="main_title">
<view v-if="leftIcon" class="main_title__icon main_title__icon--left" :class="[`tn-icon-${leftIcon}`]"></view>
<view class="main_title__content">{{ title }}</view>
<view v-if="rightIcon" class="main_title__icon main_title__icon--right" :class="[`tn-icon-${rightIcon}`]"></view>
</view>
<view v-if="type === 'second'" class="second_title">
<view class="second_title__content">{{ title }}</view>
</view>
</view>
<view class="content" :class="[{
'content--padding': contentPadding
}]">
<slot></slot>
</view>
</view>
</template>
<script>
export default {
name: 'demo-title',
options: {
// 在微信小程序中将组件节点渲染为虚拟节点,更加接近Vue组件的表现(不会出现shadow节点下再去创建元素)
virtualHost: true
},
props: {
// 标题类型
type: {
type: String,
default: 'first'
},
// 标题
title: {
type: String,
default: ''
},
// 左图标
leftIcon: {
type: String,
default: 'star'
},
// 右图标
rightIcon: {
type: String,
default: 'star'
},
// 内容容器是否有两边边距
contentPadding: {
type: Boolean,
default: true
}
}
}
</script>
<style lang="scss" scoped>
.main_title {
display: flex;
align-items: center;
justify-content: center;
margin-top: 50rpx;
font-size: 36rpx;
font-weight: bold;
&__content {
padding: 0 18rpx;
}
&__icon {
font-size: 34rpx;
}
}
.second_title {
margin: 24rpx 0;
margin-left: 30rpx;
&__content {
font-size: 32rpx;
font-weight: bold;
}
}
.content {
margin-top: 30rpx;
&--padding {
margin-left: 30rpx;
margin-right: 30rpx;
}
}
</style>
+689
View File
@@ -0,0 +1,689 @@
<template>
<view class="dynamic-demo">
<!-- 效果预览窗口 -->
<view v-if="!noDemo" class="demo-container" :class="{'demo-container--full': full}">
<view class="demo">
<slot></slot>
</view>
<!-- 提示信息 -->
<view v-if="haveTips">
<view class="demo__tips__icon" @click="demoTipsClick">
<view class="icon tn-icon-help"></view>
</view>
<view class="demo__tips__content"
:class="[showContentTips ? 'demo__tips__content--show' : 'demo__tips__content--hide']">
<view v-for="(item,index) in tipsData" :key="index" class="demo__tips__content--item">{{ item }}</view>
</view>
</view>
</view>
<!-- 模式切换 -->
<view v-if="multiMode" class="mode-switch">
<view class="mode-switch__container">
<view v-for="(item, index) in sectionModeListInfos" :key="index" class="mode-switch__item"
:class="[`mode-switch-item-${index}`,{'mode-switch__item--active': modeIndex === index}]"
@click="switchMode(index)">{{ item.name }}</view>
<!-- 滑块样式 -->
<view class="mode-switch__slider" :style="[modeSwitchSliderStyle]"></view>
</view>
</view>
<!-- 组件对应可选项容器 -->
<view class="section-container">
<scroll-view
class="section__scroll-view"
:class="{'section__scroll-view--auto': sectionScrollViewStyle.height === 'auto'}"
:style="[sectionScrollViewStyle]"
:scroll-y="sectionScrollViewStyle.height !== 'auto'"
>
<block v-for="(item,index) in btnsList" :key="index">
<view class="section__content" :class="{'section__content--visible': item.show}">
<view class="section__content__title">
<view class="section__content__title__left-line" :class="[`tn-main-gradient-${tuniaoColorList[index]}`]"></view>
<view class="section__content__title--text tn-text-ellipsis" :class="[`tn-main-gradient-${tuniaoColorList[index]}`]">{{ item.title }}</view>
<view class="section__content__title__right-line" :class="[`tn-main-gradient-${tuniaoColorList[index]}`]"></view>
</view>
<view class="section__content__btns">
<view v-for="(section_btn,section_index) in item.optional" :key="section_index"
class="section__content__btns__item" :class="[`tn-main-gradient-${tuniaoColorList[index]}--light`]" @click="sectionBtnClick(index, section_index)">
<view class="section__content__btns__item__bg"
:class="[`tn-main-gradient-${tuniaoColorList[index]}`, {'section__content__btns__item__bg--active':sectionIndex[modeIndex][index]['value'] === section_index}]"></view>
<view class="section__content__btns__item--text tn-text-ellipsis"
:class="[sectionIndex[modeIndex][index]['value'] === section_index ? 'section__content__btns__item--text--active' : `tn-color-${tuniaoColorList[index]}`]">{{ section_btn }}</view>
</view>
</view>
</view>
</block>
</scroll-view>
</view>
</view>
</template>
<script>
export default {
name: 'dynamic-demo-template',
props: {
// 可选项列表数据
sectionList: {
type: Array,
default() {
return []
}
},
// 提示信息
tips: {
type: [String, Array],
default: ''
},
// 演示框的内容是否为铺满
full: {
type: Boolean,
default: false
},
// 是否使用了自定义顶部导航栏
customBar: {
type: Boolean,
default: true
},
// 是否全屏滚动
fullWindowsScroll: {
type: Boolean,
default: false
},
// 没有演示内容
noDemo: {
type: Boolean,
default: false
}
},
computed: {
tipsData() {
if (typeof this.tips === 'string') {
return [this.tips]
}
return this.tips
},
haveTips() {
return this.tips && this.tips.length > 0
},
multiMode() {
return this.sectionList.length > 1
},
sectionModeList() {
return this.sectionList.map((item) => {
return item.name
})
}
},
data() {
return {
// 图鸟颜色列表
tuniaoColorList: this.$tn.color.getTuniaoColorList(),
// 保存选项列表信息(由于prop中的数据时不能被修改的)
_sectionList: [],
// 模式列表信息
sectionModeListInfos: [],
// 所选模式的序号
modeIndex: 0,
// 模式选择滑块样式
modeSwitchSliderStyle: {
width: 0,
left: 0
},
// 显示组件相关提示信息
showContentTips: false,
// 可选项滚动容器样式
sectionScrollViewStyle: {
height: 0
},
// 按钮列表信息
btnsList: [],
// 标记当前所选按钮
sectionIndex: [],
// 标记选项按钮是否可以滑动(使用scroll-view进行包裹)
sectionScrollFlag: true
}
},
watch: {
sectionList: {
handler(value) {
// 如果sectionList发生改变,重新初始化选项列表信息
this.initSectionBtns()
},
deep: true
},
sectionScrollFlag(value) {
if (!value) {
this.sectionScrollViewStyle.height = 'auto'
}
},
fullWindowsScroll: {
handler(value) {
if (value) {
this.sectionScrollViewStyle.height = 'auto'
}
},
immediate: true
}
},
created() {
// 初始化可选项模式列表
this.sectionModeListInfos = this.sectionModeList.map((item) => {
return {
name: item
}
})
// 初始化选项按钮默认信息
this.initSectionBtns()
},
mounted() {
// 等待加载组件完成
// setTimeout(() => {
// // 计算出底部scroll-view的高度
// this.initSectionScrollView()
// if (this.multiMode) {
// // 获取模式切换标签的信息
// this.getModeTabsInfo()
// }
// }, 10)
this.$nextTick(() => {
// 计算出底部scroll-view的高度
this.initSectionScrollView()
if (this.multiMode) {
// 获取模式切换标签的信息
this.getModeTabsInfo()
}
})
},
methods: {
// 初始化选项滑动窗口的高度
initSectionScrollView() {
// 全屏滚动时不进行任何的操作
if (this.fullWindowsScroll) {
return
}
// 获取屏幕的高度
uni.getSystemInfo({
success: (systemInfo) => {
// 通过当前屏幕的安全高度减去上一个元素的底部和距离上一个元素的外边距,然后减获取到的值减去标题栏的高度即可
const navBarHeight = this.customBar ? 0 : this.vuex_custom_bar_height
if (this.multiMode) {
uni.createSelectorQuery().in(this).select('.mode-switch').boundingClientRect(data => {
if (data.bottom >= systemInfo.safeArea.height) {
this.sectionScrollFlag = false
} else {
this.sectionScrollFlag = true
const containerBaseHeight = systemInfo.safeArea.height - data.bottom
this.sectionScrollViewStyle.height = (containerBaseHeight - navBarHeight) + systemInfo.statusBarHeight - uni.upx2px(75) + 'px'
}
}).exec()
} else {
if (!this.noDemo) {
uni.createSelectorQuery().in(this).select('.demo-container').boundingClientRect(data => {
if (data.bottom >= systemInfo.safeArea.height) {
this.sectionScrollFlag = false
} else {
this.sectionScrollFlag = true
const containerBaseHeight = systemInfo.safeArea.height - data.bottom
this.sectionScrollViewStyle.height = (containerBaseHeight - navBarHeight) + systemInfo.statusBarHeight - uni.upx2px(75) + 'px'
}
}).exec()
} else {
this.sectionScrollFlag = false
}
}
}
})
},
// 更新选项滑动容器的高度
updateSectionScrollView() {
this.$nextTick(() => {
this.initSectionScrollView()
})
},
// 获取各个模式tab的节点信息
getModeTabsInfo() {
let view = uni.createSelectorQuery().in(this)
for (let i = 0; i < this.sectionModeListInfos.length; i++) {
view.select('.mode-switch-item-' + i).boundingClientRect()
}
view.exec(res => {
// 如果没有获取到,则重新获取
if (!res.length) {
setTimeout(() => {
this.getModeTabsInfo()
}, 10)
return
}
// 将每个模式的宽度放入list中
res.map((item, index) => {
this.sectionModeListInfos[index].width = item.width
})
// 初始化滑块的宽度
this.modeSwitchSliderStyle.width = this.sectionModeListInfos[0].width + 'px'
// 初始化滑块的位置
this.modeSliderPosition()
})
},
// 设置模式滑块的位置
modeSliderPosition() {
let left = 0
// 计算当前所选模式选项到组件左边的距离
this.sectionModeListInfos.map((item, index) => {
if (index < this.modeIndex) left += item.width
})
this.modeSwitchSliderStyle.left = left + 'px'
},
// 切换模式
switchMode(index) {
// 不允许点击当前激活的选项
if (index === this.modeIndex) return
this.modeIndex = index
this.modeSliderPosition()
this.updateSectionBtns()
this.$emit('modeClick', {
index: index
})
},
// 点击内容提示信息
demoTipsClick() {
this.showContentTips = !this.showContentTips
},
// 初始化被选中选项按钮
initSectionBtns() {
this.sectionIndex = []
this.sectionIndex = this.sectionList.map((item) => {
if (item.hasOwnProperty('section') && item.section.length > 0) {
return Array(item.section.length).fill({
value: 0,
change: false
})
} else {
return []
}
})
this._sectionList = this.$tn.deepClone(this.sectionList)
// 给本地选项按钮列表给默认show属性
this._sectionList.map((item) => {
const section = item.section.map((section_item) => {
if (!section_item.hasOwnProperty('show')) {
section_item.show = true
}
return section_item
})
item.section = section
return item
})
// 更新按钮信息
this.updateSectionBtns()
},
// 跟新选项按钮信息
updateSectionBtns(sectionIndex = -1, showState = true) {
let sectionOptional = this._sectionList[this.modeIndex]['section']
this.btnsList = sectionOptional.map((item, index) => {
// 判断是否已经修改了对应的值
let changeValue = this.sectionIndex[this.modeIndex][index]['change'] || false
let currentSectionIndexValue = this.sectionIndex[this.modeIndex][index]['value'] || 0
// 取出默认值(如果是已经修改过的选项,则使用之前的选项信息)
let indexValue = changeValue ? currentSectionIndexValue : item.hasOwnProperty('current') ? item.current : 0
// 取出是否显示当前选项
let show = (sectionIndex !== -1 && sectionIndex === index) ? showState : item.hasOwnProperty('show') ? item.show : true
// 处理最大最小值
if (indexValue < 0) {
indexValue = 0
}
if (indexValue >= item.optional.length) {
indexValue = item.optional.length
}
// this.sectionIndex[this.modeIndex][index]['value'] = indexValue
this.$set(this.sectionIndex[this.modeIndex], index, {value: indexValue, change: changeValue})
item.show = show
return item
})
},
// 更新选项按钮状态信息
updateSectionBtnsState(sectionIndex = -1, showState = true) {
// 判断sectionIndex是否为数组
if (this.$tn.array.isArray(sectionIndex)) {
if (sectionIndex.length === 0) {
return
}
sectionIndex = sectionIndex.filter((item) => item >= 0 && item < this.sectionList[this.modeIndex]['section'].length)
sectionIndex.map((item) => {
this.btnsList[item]['show'] = showState
this._sectionList[this.modeIndex]['section'][item]['show'] = showState
})
} else {
if (sectionIndex < 0 || sectionIndex >= this.sectionList[this.modeIndex]['section'].length) {
return
}
// 将按键的对应显示状态设置为对应的状态
this.btnsList[sectionIndex]['show'] = showState
this._sectionList[this.modeIndex]['section'][sectionIndex]['show'] = showState
}
},
// 更新选项按钮选中信息
updateSectionBtnsValue(modeIndex = 0, sectionIndex = -1, value = 0) {
if (sectionIndex < 0 || sectionIndex >= this.sectionList[modeIndex]['section'].length) {
return
}
// 如果showState为false则移除对应的选项按钮,否则往对应的位置添加上对应的选项按钮
this.sectionIndex[modeIndex][sectionIndex] = {
value,
change: true
}
},
// 选项按钮点击事件
sectionBtnClick(index, sectionIndex) {
// if (this.sectionIndex[this.modeIndex][index] === sectionIndex) {
// return
// }
this.$set(this.sectionIndex[this.modeIndex], index, {value: sectionIndex, change: true})
this.$emit('click', {
methods: this.btnsList[index]['methods'],
index: sectionIndex,
name: this.btnsList[index]['optional'][sectionIndex]
})
}
}
}
</script>
<style lang="scss" scoped>
.dynamic-demo {
padding-top: 78rpx;
/* 顶部模式切换start */
.mode-switch {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 75rpx;
padding: 0 30rpx;
&__container {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
width: 476rpx;
height: 62rpx;
background-color: #FFFFFF;
box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
border-radius: 31rpx;
}
&__item {
flex: 1;
height: 62rpx;
width: 100%;
line-height: 62rpx;
text-align: center;
font-size: 28rpx;
color: $tn-font-sub-color;
z-index: 2;
transition: all 0.3s;
&--active {
color: #FFFFFF;
font-weight: bold;
}
}
&__slider {
position: absolute;
height: 62rpx;
border-radius: 31rpx;
// background-image: linear-gradient(-86deg, #FF8359 0%, #FFDF40 100%);
background-image: linear-gradient(-86deg, #00C3FF 0%, #58FFF5 100%);
box-shadow: 1rpx 10rpx 24rpx 0rpx #00C3FF77;
z-index: 1;
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
}
/* 顶部模式切换end */
/* 演示内容展示start */
.demo-container {
min-height: 327rpx;
width: calc(100% - 60rpx);
background-color: #FFFFFF;
box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
margin: 0 30rpx 5rpx 30rpx;
border-radius: 20rpx;
position: relative;
display: flex;
justify-content: center;
align-items: center;
&--full {
display: inline-block;
padding-bottom: 20rpx;
min-height: 0rpx;
padding: 10rpx 20rpx 30rpx;
}
.demo {
padding-top: 70rpx;
&__tips {
&__icon {
position: absolute;
top: 20rpx;
right: 16rpx;
width: 39rpx;
height: 39rpx;
line-height: 39rpx;
font-size: 39rpx;
.icon {
background: linear-gradient(-45deg, #FF8359 0%, #FFDF40 100%);
-webkit-background-clip: text;
color: transparent;
text-shadow: 0rpx 10rpx 10rpx rgba(255, 156, 82, 0.2);
}
}
&__content {
position: absolute;
top: 65rpx;
right: 16rpx;
font-size: 20rpx;
margin-left: 20rpx;
word-wrap: normal;
display: flex;
flex-direction: column;
background-color: #E6E6E6;
padding: 20rpx;
border-radius: 10rpx;
transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1);
transform-origin: 0 0;
z-index: 999999;
&--hide {
transform: scaleY(0);
}
&--show {
transform: scaleY(100%);
&::after {
content: "";
width: 0px;
height: 0px;
border-width: 4px;
border-style: solid;
border-color: transparent transparent rgba(149, 149, 149, 0.1) transparent;
position: absolute;
top: -8px;
right: 6px;
}
}
}
}
}
}
/* 演示内容展示end */
/* 可选项start */
.section-container {
width: 100%;
height: auto;
margin-top: 70rpx;
.section {
&__content {
margin-top: 70rpx;
display: none;
&--visible {
display: block;
&:last-child {
padding-bottom: calc(70rpx + env(safe-area-inset-bottom));
}
}
&:nth-child(1) {
margin-top: 0rpx;
}
&__title {
display: flex;
justify-content: center;
align-items: center;
margin: 0 30rpx;
text-align: center;
&__left-line,
&__right-line {
width: 100rpx;
height: 2rpx;
position: relative;
}
&__left-line {
&::after {
content: '';
background: inherit;
width: 12rpx;
height: 12rpx;
position: absolute;
top: -12rpx;
right: 0rpx;
border-radius: 50%;
transform: translateY(50%);
}
}
&__right-line {
&::after {
content: '';
background: inherit;
width: 12rpx;
height: 12rpx;
position: absolute;
top: -12rpx;
left: 0rpx;
border-radius: 50%;
transform: translateY(50%);
}
}
&--text {
-webkit-background-clip: text;
color: transparent;
min-width: 124rpx;
height: 30rpx;
font-size: 32rpx;
line-height: 1;
margin: 0 35rpx;
}
}
&__btns {
width: calc(100% - 60rpx);
margin: 0 30rpx;
margin-top: 29rpx;
padding: 50rpx 30rpx 0rpx 0rpx;
background-color: #FFFFFF;
box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
border-radius: 20rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
flex-wrap: wrap;
&__item {
max-width: 30%;
padding: 17rpx 36rpx;
border-radius: 10rpx;
margin-bottom: 40rpx;
margin-left: 40rpx;
position: relative;
z-index: 1;
// &::before {
// content: " ";
// position: absolute;
// top: 10rpx;
// left: 1rpx;
// width: 100%;
// height: 100%;
// background: inherit;
// filter: blur(24rpx);
// opacity: 1;
// z-index: -1;
// }
&__bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: inherit;
z-index: -1;
opacity: 0;
transform: scale(0);
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
&--active {
opacity: 1;
transform: scale(1);
}
}
&--text {
font-size: 24rpx;
line-height: 1.2em;
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
&--active {
color: #FFFFFF;
}
}
}
}
}
}
}
/* 可选项end */
}
</style>
+147
View File
@@ -0,0 +1,147 @@
<template>
<view class="multiple-options">
<view class="list">
<block v-for="(item, index) in listData" :key="index">
<view
class="list__item"
:class="[`tn-main-gradient-${tuniaoColorList[item.bgColorIndex]}--light`]"
@tap="navOptionsPage(item.url)"
>
<view class="list__content">
<view class="list__content__title">{{ item.title }}</view>
<view class="list__content__desc">{{ item.desc }}</view>
</view>
<view class="list__icon">
<view class="list__icon__main" :class="[`tn-icon-${item.mainIcon}`, `tn-main-gradient-${tuniaoColorList[item.bgColorIndex]}`]"></view>
<view class="list__icon__sub" :class="[`tn-icon-${item.subIcon}`, `tn-main-gradient-${tuniaoColorList[item.bgColorIndex]}`]"></view>
</view>
</view>
</block>
</view>
</view>
</template>
<script>
export default {
name: 'multiple-options-demo',
props: {
// 显示的列表数据
list: {
type: Array,
default() {
return []
}
}
},
data() {
return {
// 图鸟颜色列表
tuniaoColorList: [
'red',
'purplered',
'purple',
'bluepurple',
'aquablue',
'blue',
'indigo',
'cyan',
'teal',
'green',
'orange',
'orangered'
],
listData: []
}
},
watch: {
list(val) {
this.initList()
}
},
created() {
this.initList()
},
methods: {
// 初始化列表数据
initList() {
// 给列表添加背景颜色数据
this.listData = this.list.map((item, index) => {
item.bgColorIndex = this.getBgNum()
item.mainIcon = item?.mainIcon || 'computer-fill'
item.subIcon = item?.subIcon || 'share'
return item
})
},
// 跳转到对应的选项页面
navOptionsPage(url) {
uni.navigateTo({
url: url
})
},
// 获取酷炫背景随机数
getBgNum() {
return Math.floor((Math.random() * this.tuniaoColorList.length))
}
}
}
</script>
<style lang="scss" scoped>
.list {
&__item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: calc(100% - 60rpx);
margin: 108rpx 30rpx 0rpx 30rpx;
box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
border-radius: 20rpx;
}
&__content {
flex: 1;
// color: $tn-font-color;
margin: 34rpx 0rpx 27rpx 37rpx;
&__title {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 12rpx;
}
&__desc {
font-size: 28rpx;
}
}
&__icon {
flex: 1;
margin-right: 26rpx;
position: relative;
&__main, &__sub {
-webkit-background-clip: text;
color: transparent;
position: absolute;
transition: transform 0.25s ease;
}
&__main {
font-size: 200rpx;
width: 190rpx;
line-height: 200rpx;
top: 0;
right: 0rpx;
transform: translateY(-60%);
}
&__sub {
font-size: 70rpx;
top: 0;
right: 175rpx;
transform: translateY(-5rpx);
}
}
}
</style>
+169
View File
@@ -0,0 +1,169 @@
<template>
<view class="nav-index-button" :style="{bottom: `${bottom}rpx`, right: `${right}rpx`}" @tap.stop="navIndex">
<view class="nav-index-button__content">
<view class="nav-index-button__content--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-cool-bg-color-7">
<view class="tn-icon-home-vertical-fill"></view>
</view>
</view>
<view class="nav-index-button__meteor">
<view class="nav-index-button__meteor__wrapper">
<view v-for="(item,index) in 6" :key="index" class="nav-index-button__meteor__item" :style="{transform: `rotateX(${-60 + (30 * index)}deg) rotateZ(${-60 + (30 * index)}deg)`}">
<view class="nav-index-button__meteor__item--pic"></view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'nav-index-button',
props: {
// 距离底部的距离
bottom: {
type: [Number, String],
default: 300
},
// 距离右边的距离
right: {
type: [Number, String],
default: 75
},
// 首页地址
indexPath: {
type: String,
default: '/pages/index/index'
}
},
methods: {
// 跳转回首页
navIndex() {
// 通过判断当前页面的页面栈信息,是否有上一页进行返回,如果没有则跳转到首页
const pages = getCurrentPages()
if (pages && pages.length > 0) {
const indexPath = this.indexPath || '/pages/index/index'
const firstPage = pages[0]
if (pages.length == 1 && (!firstPage.route || firstPage.route != indexPath.substring(1, indexPath.length))) {
uni.reLaunch({
url: indexPath
})
} else {
uni.navigateBack({
delta: 1
})
}
} else {
uni.reLaunch({
url: indexPath
})
}
}
}
}
</script>
<style lang="scss" scoped>
.nav-index-button {
position: fixed;
animation: suspension 3s ease-in-out infinite;
z-index: 999999;
&__content {
position: absolute;
width: 100rpx;
height: 100rpx;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
&--icon {
width: 100rpx;
height: 100rpx;
font-size: 60rpx;
border-radius: 50%;
margin-bottom: 18rpx;
position: relative;
z-index: 1;
transform: scale(0.85);
&::after {
content: " ";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
left: 0;
bottom: 0;
border-radius: inherit;
opacity: 1;
transform: scale(1, 1);
background-size: 100% 100%;
background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg6.png);
}
}
}
&__meteor {
position: absolute;
top: 50%;
left: 50%;
width: 100rpx;
height: 100rpx;
transform-style: preserve-3d;
transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
&__wrapper {
width: 100rpx;
height: 100rpx;
transform-style: preserve-3d;
animation: spin 20s linear infinite;
}
&__item {
position: absolute;
width: 100rpx;
height: 100rpx;
border-radius: 1000rpx;
left: 0;
top: 0;
&--pic {
display: block;
width: 100%;
height: 100%;
background: url(https://tnuiimage.tnkjapp.com/cool_bg_image/arc3.png) no-repeat center center;
background-size: 100% 100%;
animation: arc 4s linear infinite;
}
}
}
}
@keyframes suspension {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-0.8rem);
}
}
@keyframes spin {
0% {
transform: rotateX(0deg);
}
100% {
transform: rotateX(-360deg);
}
}
@keyframes arc {
to {
transform: rotate(360deg);
}
}
</style>
+52
View File
@@ -0,0 +1,52 @@
/**
* 动态参数演示mixin
*/
module.exports = {
data() {
return {
// 效果显示框top的值
contentContainerTop: '0px',
contentContainerIsTop: false,
// 参数显示框top的值
sectionContainerTop: '0px'
}
},
onReady() {
this.updateSectionContainerTop()
},
methods: {
// 处理演示效果框的位置
async _handleContentConatinerPosition() {
// 获取效果演示框的节点信息
const contentContainer = await this._tGetRect('#content_container')
// 获取参数框的节点信息
this._tGetRect('#section_container').then((res) => {
// 判断参数框是否在移动,如果是则更新效果框的位置
// 如果效果框的顶部已经触控到顶部导航栏就停止跟随
if (res.top - contentContainer.bottom != 15) {
const newTop = res.top - (contentContainer.height + uni.upx2px(20))
const minTop = this.vuex_custom_bar_height + 1
if (newTop < minTop) {
this.contentContainerTop = minTop + 'px'
this.contentContainerIsTop = true
} else {
this.contentContainerTop = newTop + 'px'
this.contentContainerIsTop = false
}
}
})
},
// 更新状态切换栏位置信息
updateSectionContainerTop() {
this._tGetRect('#content_container').then((res) => {
this.contentContainerTop = (this.vuex_custom_bar_height + 148) + 'px'
this.sectionContainerTop = (res.height + 20) + 'px'
})
}
},
// 监听页面滚动
onPageScroll() {
this._handleContentConatinerPosition()
}
}
+60
View File
@@ -0,0 +1,60 @@
/**
* 演示页面mixin
*/
module.exports = {
data() {
return {
}
},
onLoad() {
// 更新顶部导航栏信息
this.updateCustomBarInfo()
},
methods: {
// 点击左上角返回按钮时触发事件
goBack() {
// 通过判断当前页面的页面栈信息,是否有上一页进行返回,如果没有则跳转到首页
const pages = getCurrentPages()
if (pages && pages.length > 0) {
const firstPage = pages[0]
if (pages.length == 1 && (!firstPage.route || firstPage.route != 'pages/index/index')) {
uni.reLaunch({
url: '/pages/index/index'
})
} else {
uni.navigateBack({
delta: 1
})
}
} else {
uni.reLaunch({
url: '/pages/index/index'
})
}
},
// 更新顶部导航栏信息
async updateCustomBarInfo() {
// 获取vuex中的自定义顶栏的高度
let customBarHeight = this.vuex_custom_bar_height
let statusBarHeight = this.vuex_status_bar_height
// 如果获取失败则重新获取
if (!customBarHeight) {
try {
const navBarInfo = await this.$tn.updateCustomBar()
customBarHeight = navBarInfo.customBarHeight
statusBarHeight = navBarInfo.statusBarHeight
} catch(e) {
setTimeout(() => {
this.updateCustomBarInfo()
}, 10)
return
}
}
// 更新vuex中的导航栏信息
this.$tn.vuex('vuex_status_bar_height', statusBarHeight)
this.$tn.vuex('vuex_custom_bar_height', customBarHeight)
}
}
}
+28
View File
@@ -0,0 +1,28 @@
import App from './App'
import store from './store'
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
// 引入全局TuniaoUI
import TuniaoUI from 'tuniao-ui'
Vue.use(TuniaoUI)
// 引入TuniaoUI提供的vuex简写方法
let vuexStore = require('@/store/$tn.mixin.js')
Vue.mixin(vuexStore)
// 引入TuniaoUI对小程序分享的mixin封装
let mpShare = require('tuniao-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)
const app = new Vue({
store,
...App
})
// 引入请求封装
require('./util/request/index')(app)
app.$mount()
+133
View File
@@ -0,0 +1,133 @@
{
"name" : "TuniaoUI_UniApp",
"appid" : "__UNI__C82400B",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {},
"splashscreen" : {
"androidStyle" : "common"
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxf3d81a452b88ff4b",
"setting" : {
"urlCheck" : false,
"es6" : true,
"minified" : true,
"postcss" : true
},
"usingComponents" : true,
"optimization" : {
"subPackages" : true
},
"permission" : {
"scope.userLocation" : {
"desc" : "获取您的位置信息方便为您提供服务"
}
}
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2",
"h5" : {
"title" : "Tuniao UI",
"template" : "template.h5.html",
"router" : {
"mode" : "hash",
"base" : "./"
},
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "IXBBZ-HHSK3-UWW3K-3DB6K-M7Y5K-F4FM5"
}
}
}
}
}
+88
View File
@@ -0,0 +1,88 @@
/**
* 页面展示列表数据
*/
export default {
data: [
{
title: '基础元素',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'menu-more',
title: 'Flex布局',
url: '/basicPage/flex-layout/flex-layout'
},
{
icon: 'menu-circle',
title: 'Grid布局',
url: '/basicPage/grid-layout/grid-layout'
},
{
icon: 'gloves',
title: '配色',
url: '/basicPage/color/color'
},
{
icon: 'font',
title: '图标',
url: '/basicPage/icon/icon'
},
{
icon: 'circle-fill',
title: '按钮',
url: '/basicPage/button/button'
},
{
icon: 'tag',
title: '标签',
url: '/basicPage/tag/tag'
},
{
icon: 'square',
title: '边框',
url: '/basicPage/border/border'
},
{
icon: 'copy-fill',
title: '阴影',
url: '/basicPage/shadow/shadow'
},
{
icon: 'moon',
title: '微标',
url: '/basicPage/badge/badge'
},
{
icon: 'emoji-good',
title: '头像',
url: '/basicPage/avatar/avatar'
}
]
}, {
title: '常用工具',
backgroundColor: 'tn-cool-bg-color-2',
list: [
{
icon: 'code',
title: 'String工具',
url: '/basicPage/utils/string/index'
},
{
icon: 'code',
title: 'Number工具',
url: '/basicPage/utils/number/index'
},
{
icon: 'code',
title: 'Message工具',
url: '/basicPage/utils/message/index'
},
{
icon: 'code',
title: 'Color工具',
url: '/basicPage/utils/color/index'
}
]
}
]
}
+266
View File
@@ -0,0 +1,266 @@
/**
* 页面展示列表数据
*/
export default {
data: [
{
title: '基础组件',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'signpost',
title: '列表',
url: '/componentsPage/list/list'
},
{
icon: 'circle-arrow',
title: 'Loading加载',
url: '/componentsPage/loading/loading'
},
{
icon: 'tag',
title: 'tabs标签',
url: '/componentsPage/tabs/tabs'
},
{
icon: 'receipt',
title: 'sticky吸顶',
url: '/componentsPage/sticky/sticky'
},
{
icon: 'all',
title: 'navBar导航栏',
url: '/componentsPage/nav-bar/nav-bar'
},
{
icon: 'sound',
title: 'noticeBar通知栏',
url: '/componentsPage/notice-bar/notice-bar'
},
{
icon: 'image',
title: 'swiper轮播图',
url: '/componentsPage/swiper/swiper'
},
{
icon: 'server',
title: 'collapse折叠面板',
url: '/componentsPage/collapse/collapse'
},
{
icon: 'more-circle',
title: 'readMore查看更多',
url: '/componentsPage/read-more/read-more'
},
{
icon: 'success-square',
title: 'steps步骤条',
url: '/componentsPage/steps/steps'
},
{
icon: 'clock',
title: 'timeLine时间轴',
url: '/componentsPage/time-line/time-line'
},
{
icon: 'level',
title: 'indexList索引列表',
url: '/componentsPage/index-list/index-list'
},
{
icon: 'group-square',
title: 'scrollList横向滚动',
url: '/componentsPage/scroll-list/scroll-list'
},
{
icon: 'brand',
title: 'swipeAction滑动菜单',
url: '/componentsPage/swipe-action/swipe-action'
},
{
icon: 'pharmacy',
title: 'fab悬浮按钮',
url: '/componentsPage/fab/fab'
},
{
icon: 'cardbag',
title: '懒加载',
url: '/componentsPage/lazy-load/lazy-load'
},
{
icon: 'down-double',
title: '加载更多',
url: '/componentsPage/load-more/load-more'
},
{
icon: 'menu-more',
title: '骨架屏',
url: '/componentsPage/skeleton/skeleton'
},
{
icon: 'empty-search',
title: '空页面',
url: '/componentsPage/empty/empty'
},
{
icon: 'share',
title: '商品导航',
url: '/componentsPage/goods-nav/goods-nav'
}
]
},
{
title: '弹框组件',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'prize',
title: '弹出层',
url: '/componentsPage/popup/popup'
},
{
icon: 'bankcard',
title: '模态框',
url: '/componentsPage/modal/modal'
},
{
icon: 'comment',
title: 'Toast',
url: '/componentsPage/toast/toast'
},
{
icon: 'creative',
title: '提示信息框',
url: '/componentsPage/tips/tips'
},
{
icon: 'reply',
title: '压屏窗',
url: '/componentsPage/landscape/landscape'
}
]
},
{
title: '表单组件',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'image-text',
title: 'Form表单',
url: '/componentsPage/form/form'
},
{
icon: 'square',
title: 'Input输入框',
url: '/componentsPage/input/input'
},
{
icon: 'circle-fill',
title: 'Radio单选框',
url: '/componentsPage/radio/radio'
},
{
icon: 'copy',
title: 'Checkbox复选框',
url: '/componentsPage/check-box/check-box'
},
{
icon: 'ticket',
title: 'ActionSheet操作菜单',
url: '/componentsPage/action-sheet/action-sheet'
},
{
icon: 'deploy',
title: 'Picker选择器',
url: '/componentsPage/picker/picker'
},
{
icon: 'organizatio',
title: 'Select列选择器',
url: '/componentsPage/select/select'
},
{
icon: 'data',
title: '验证码倒计时',
url: '/componentsPage/verification-code/verification-code'
},
{
icon: 'power',
title: 'Switch开关',
url: '/componentsPage/switch/switch'
},
{
icon: 'upload',
title: '图片上传',
url: '/componentsPage/image-upload/image-upload'
},
{
icon: 'calendar',
title: '日历',
url: '/componentsPage/calendar/calendar'
},
{
icon: 'edit-write',
title: '签名板',
url: '/componentsPage/sign-board/sign-board'
},
{
icon: 'safe',
title: '验证码输入',
url: '/componentsPage/verification-code-input/verification-code-input'
},
{
icon: 'expand',
title: '分段器',
url: '/componentsPage/subsection/subsection'
}
]
},
{
title: '数据组件',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'watercup',
title: 'Progress进度条',
url: '/componentsPage/progress/progress'
},
{
icon: 'star',
title: 'rate评分',
url: '/componentsPage/rate/rate'
},
{
icon: 'light',
title: 'slider滑动条',
url: '/componentsPage/slider/slider'
},
{
icon: 'statistics',
title: 'numberBox步进输入',
url: '/componentsPage/number-box/number-box'
},
{
icon: 'keyboard-circle',
title: 'keyboard键盘',
url: '/componentsPage/keyboard/keyboard'
},
{
icon: 'time',
title: 'countDown倒计时',
url: '/componentsPage/count-down/count-down'
},
{
icon: 'group-circle',
title: 'countTo数字跳转',
url: '/componentsPage/count-to/count-to'
},
{
icon: 'sequence-vertical',
title: 'countScroll数字滚动',
url: '/componentsPage/count-scroll/count-scroll'
}
]
}
]
}
+247
View File
@@ -0,0 +1,247 @@
/**
* 页面展示列表数据
*/
export default {
data: [
{
title: '登录注册',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'send',
title: '火箭登录',
author: '图鸟北北',
url: '/templatePage/login/demo1/demo1'
},
{
icon: 'send',
title: '粒子登录',
author: '图鸟北北',
url: '/templatePage/login/demo2/demo2'
},
{
icon: 'send',
title: '背景登录',
author: '图鸟北北',
url: '/templatePage/login/demo3/demo3'
},
{
icon: 'send',
title: '简约登录',
author: '图鸟北北',
url: '/templatePage/login/demo4/demo4'
}
]
},
{
title: '个人中心',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'send',
title: '夏天个人',
author: '图鸟北北',
url: '/templatePage/my/demo1/demo1'
},
{
icon: 'send',
title: '图鸟个人',
author: '图鸟北北',
url: '/templatePage/my/demo2/demo2'
},
{
icon: 'send',
title: '外卖个人',
author: '图鸟北北',
url: '/templatePage/my/demo3/demo3'
},
{
icon: 'send',
title: '高端个人',
author: '图鸟北北',
url: '/templatePage/my/demo4/demo4'
}
]
},
{
title: '常用首页',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'send',
title: '音乐首页',
author: '图鸟北北',
url: '/templatePage/home/music/music'
},
{
icon: 'send',
title: '课程首页',
author: '图鸟北北',
url: '/templatePage/home/course/course'
},
{
icon: 'send',
title: '设计首页',
author: '图鸟北北',
url: '/templatePage/home/design/design'
},
{
icon: 'send',
title: '招聘首页',
author: '图鸟北北',
url: '/templatePage/home/job/job'
},
{
icon: 'send',
title: '投屏首页',
author: '图鸟北北',
url: '/templatePage/home/screen/screen'
},
{
icon: 'send',
title: '壁纸首页',
author: '图鸟北北',
url: '/templatePage/home/wallpaper/wallpaper'
},
]
},
{
title: '骚气页面',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'send',
title: '健康码',
author: '图鸟北北',
url: '/templatePage/health/qrcode/qrcode'
},
{
icon: 'send',
title: '关于我们',
author: 'Jaylen',
url: '/templatePage/life/about/about'
},
{
icon: 'send',
title: '全新出发',
author: '你的小可爱',
url: '/templatePage/life/outset/outset'
},
{
icon: 'send',
title: '资讯左图',
author: '图鸟北北',
url: '/templatePage/article/demo1/demo1'
},
{
icon: 'send',
title: '资讯右图',
author: '图鸟北北',
url: '/templatePage/article/demo2/demo2'
},
{
icon: 'send',
title: '全屏轮播',
author: '图鸟北北',
url: '/templatePage/life/fullpage/fullpage'
},
{
icon: 'rocket',
title: '浏览器',
author: '图鸟北北',
url: '/templatePage/life/browser/browser'
},
{
icon: 'rocket',
title: '时钟',
author: '图鸟北北',
url: '/templatePage/time/clock/clock'
}
]
},
{
title: '动效元素',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'send',
title: '加载动画',
author: '图鸟北北',
url: '/templatePage/animate/loading/loading'
},
{
icon: 'send',
title: '流星悬浮',
author: '图鸟北北',
url: '/templatePage/animate/suspended/suspended'
},
{
icon: 'send',
title: '随机粒子',
author: 'Jaylen',
url: '/templatePage/animate/particle/particle'
},
{
icon: 'send',
title: '相册图集',
author: '你的小可爱',
url: '/templatePage/animate/photo/photo'
},
{
icon: 'send',
title: '镂空效果',
author: '你的小可爱',
url: '/templatePage/animate/hollow/hollow'
},
{
icon: 'send',
title: '泡泡飘出',
author: 'Jaylen',
url: '/templatePage/animate/bubble/bubble'
},
{
icon: 'send',
title: 'css波浪',
author: '图鸟北北',
url: '/templatePage/animate/wave/wave'
}
]
},
{
title: '群友力献',
backgroundColor: 'tn-cool-bg-color-1',
list: [
{
icon: 'send',
title: '3D全景(第三方,约120¥一年)',
author: '图鸟北北 & 芊云全景',
url: '/templatePage/life/pano/pano'
},
{
icon: 'rocket',
title: 'Ucharts图表(第三方,免费开源)',
author: '图鸟北北 & Ucharts秋云',
url: '/templatePage/life/candle/candle'
},
{
icon: 'rocket',
title: '阿凡提·污克西西(第三方,免费开源)',
author: '阿凡提·污克西西',
url: '/templatePage/life/candle/candle'
},
{
icon: 'rocket',
title: '微信红包封面',
author: '微信红包封面',
url: '/templatePage/life/cover/cover'
},
{
icon: 'rocket',
title: '营销小游戏-魔方',
author: '最帅的你',
url: '/templatePage/life/cube/cube'
},
]
}
]
}
+299
View File
@@ -0,0 +1,299 @@
/**
* 页面展示列表数据
*/
export default {
data: [{
title: '圈子博客',
backgroundColor: 'tn-cool-bg-color-1',
list: [{
icon: 'order',
title: '操作指引',
author: '图鸟科技',
url: '/vipPage/life/guide/guide'
},{
icon: 'order',
title: '首次指引',
author: '图鸟科技',
url: '/vipPage/life/start/start'
},
{
icon: 'order',
title: '圈子首页',
author: '图鸟科技',
url: '/vipPage/blog/blog/blog'
},
{
icon: 'order',
title: '社交圈子',
author: '图鸟科技',
url: '/vipPage/blog/socialize/socialize'
},
{
icon: 'order',
title: '简约圈子(旧)',
author: '图鸟科技',
url: '/vipPage/blog/circle/circle'
},
{
icon: 'order',
title: '圈子个人',
author: '图鸟科技',
url: '/vipPage/blog/myblog/myblog'
},
{
icon: 'order',
title: '消息通知',
author: '图鸟科技',
url: '/vipPage/blog/message/message'
},
{
icon: 'order',
title: '商品优选',
author: '图鸟科技',
url: '/vipPage/blog/prefer/prefer'
},
{
icon: 'order',
title: '优选详情',
author: '图鸟科技',
url: '/vipPage/blog/product/product'
},
{
icon: 'order',
title: '博客博主',
author: '图鸟科技',
url: '/vipPage/blog/blogger/blogger'
},
{
icon: 'order',
title: '酷炫功能',
author: '图鸟科技',
url: '/vipPage/home/cool/cool'
},
{
icon: 'order',
title: '友情链接',
author: '图鸟科技',
url: '/vipPage/home/link/link'
},
{
icon: 'order',
title: '祝福页面',
author: '图鸟科技',
url: '/vipPage/life/bless/bless'
}
]
},
{
title: '酷炫首页',
backgroundColor: 'tn-cool-bg-color-1',
list: [{
icon: 'order',
title: '图鸟首页',
author: '图鸟科技',
url: '/vipPage/home/tuniao/tuniao'
},
{
icon: 'order',
title: '奶茶首页',
author: '图鸟科技',
url: '/vipPage/home/tea/tea'
},
{
icon: 'order',
title: '阅读首页',
author: '图鸟科技',
url: '/vipPage/home/read/read'
},
{
icon: 'order',
title: '月亮首页',
author: '图鸟科技',
url: '/vipPage/home/moon/moon'
},
{
icon: 'order',
title: '计划首页',
author: '图鸟科技',
url: '/vipPage/home/plan/plan'
},
{
icon: 'order',
title: '新年首页',
author: '图鸟科技',
url: '/vipPage/home/year/year'
},
{
icon: 'order',
title: '电影首页',
author: '图鸟科技',
url: '/vipPage/home/movie/movie'
},
{
icon: 'order',
title: '食物首页',
author: '图鸟科技',
url: '/vipPage/home/food/food'
},
{
icon: 'order',
title: '拟态首页',
author: '图鸟科技',
url: '/vipPage/home/mimicry/mimicry'
},
{
icon: 'order',
title: '充电首页',
author: '图鸟科技',
url: '/vipPage/life/power/power'
},
{
icon: 'order',
title: '卡片首页',
author: '图鸟科技',
url: '/vipPage/home/card/card'
},
{
icon: 'order',
title: '健康首页',
author: '图鸟科技',
url: '/vipPage/home/health/health'
},
{
icon: 'order',
title: '全景首页',
author: '图鸟科技',
url: '/vipPage/home/panoramic/panoramic'
},
{
icon: 'order',
title: 'uCharts首页',
author: '图鸟科技',
url: '/vipPage/home/ucharts/ucharts'
},
]
},
{
title: '商城店铺',
backgroundColor: 'tn-cool-bg-color-1',
list: [{
icon: 'order',
title: '店铺商品',
author: '图鸟科技',
url: '/vipPage/shop/store/store'
},
{
icon: 'order',
title: '商品订单',
author: '图鸟科技',
url: '/vipPage/shop/order/order'
},
{
icon: 'order',
title: '商品分类',
author: '图鸟科技',
url: '/vipPage/shop/classify/classify'
},
{
icon: 'order',
title: '积分活动',
author: '图鸟科技',
url: '/vipPage/shop/money/money'
}
]
},
{
title: '会员需求',
backgroundColor: 'tn-cool-bg-color-1',
list: [{
icon: 'order',
title: 'Drag长按拖拽随机固定',
author: '图鸟科技',
url: '/vipPage/components/drag/basic-drag/basic-drag'
},
{
icon: 'order',
title: '图片上传长按拖拽',
author: '图鸟科技',
url: '/vipPage/components/drag/upload-image-drag/upload-image-drag'
},
{
icon: 'order',
title: 'Cropper图片裁剪',
author: '图鸟科技',
url: '/vipPage/components/cropper/cropper'
},
{
icon: 'order',
title: 'StackSwiper堆叠轮播',
author: '图鸟科技',
url: '/vipPage/components/stack-swiper/stack-swiper'
},
{
icon: 'order',
title: '重力效果',
author: '图鸟科技',
url: '/vipPage/home/gravity/page1/page1'
},
{
icon: 'order',
title: '下拉刷新',
author: '图鸟科技',
url: '/vipPage/components/scroll-view/index'
},
{
icon: 'order',
title: '级联选择',
author: '图鸟科技',
url: '/vipPage/components/cascade-selection/cascade-selection'
},
{
icon: 'order',
title: '瀑布流',
author: '图鸟科技',
url: '/vipPage/components/waterfall/waterfall'
},
{
icon: 'order',
title: '树形菜单',
author: '图鸟科技',
url: '/vipPage/components/tree-view/tree-view'
},
{
icon: 'order',
title: '表格',
author: '图鸟科技',
url: '/vipPage/components/table/index'
},
{
icon: 'order',
title: '图鸟轮播(实验)',
author: '图鸟科技',
url: '/vipPage/components/custom-swiper/index'
}
]
},
{
title: '生态支持',
backgroundColor: 'tn-cool-bg-color-1',
list: [{
icon: 'order',
title: '短视频',
author: '图鸟 & 第三方',
url: '/thirdPage/short-video/short-video'
},{
icon: 'order',
title: '外卖模板',
author: '图鸟 & 第三方',
url: '/takeOutPage/walking-route/walking-route'
},
{
icon: 'order',
title: '期待你的加入',
author: '图鸟 & 第三方',
url: '/templatePage/life/candle/candle'
}
]
}
]
}
+667
View File
@@ -0,0 +1,667 @@
{
"easycom": {
"^tn-(.*)": "@/tuniao-ui/components/tn-$1/tn-$1.vue"
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"mp-weixin": {
"disableScroll": true
},
"app-plus": {
"bounce": "none"
},
"mp-alipay": {
"allowsBounceVertical": "NO"
},
"mp-baidu": {
"disableScroll": true
}
}
}
],
"subPackages": [{
"root": "basicPage",
"pages": [{
"path": "test/test",
"style": {
"navigationStyle": "default",
"navigationBarTitleText": "测试页面",
"enablePullDownRefresh": false
}
},
{
"path": "flex-layout/flex-layout",
"style": {
"navigationBarTitleText": "Flex布局",
"enablePullDownRefresh": false
}
}, {
"path": "grid-layout/grid-layout",
"style": {
"navigationBarTitleText": "Grid布局",
"enablePullDownRefresh": false
}
}, {
"path": "color/color",
"style": {
"navigationBarTitleText": "配色",
"enablePullDownRefresh": false
}
}, {
"path": "icon/icon",
"style": {
"navigationBarTitleText": "图标",
"enablePullDownRefresh": false
}
}, {
"path": "button/button",
"style": {
"navigationBarTitleText": "按钮",
"enablePullDownRefresh": false
}
}, {
"path": "tag/tag",
"style": {
"navigationBarTitleText": "标签",
"enablePullDownRefresh": false
}
}, {
"path": "border/border",
"style": {
"navigationBarTitleText": "边框",
"enablePullDownRefresh": false
}
}, {
"path": "shadow/shadow",
"style": {
"navigationBarTitleText": "阴影",
"enablePullDownRefresh": false
}
}, {
"path": "badge/badge",
"style": {
"navigationBarTitleText": "微标",
"enablePullDownRefresh": false
}
}, {
"path": "avatar/avatar",
"style": {
"navigationBarTitleText": "头像",
"enablePullDownRefresh": false
}
}, {
"path": "utils/string/index",
"style": {
"navigationBarTitleText": "String工具",
"enablePullDownRefresh": false
}
}, {
"path": "utils/number/index",
"style": {
"navigationBarTitleText": "Number工具",
"enablePullDownRefresh": false
}
}, {
"path": "utils/message/index",
"style": {
"navigationBarTitleText": "Message工具",
"enablePullDownRefresh": false
}
}, {
"path": "utils/color/index",
"style": {
"navigationBarTitleText": "Color工具",
"enablePullDownRefresh": false
}
}
]
}, {
"root": "componentsPage",
"pages": [{
"path": "list/list",
"style": {
"navigationBarTitleText": "列表",
"enablePullDownRefresh": false
}
}, {
"path": "popup/popup",
"style": {
"navigationBarTitleText": "弹出层",
"enablePullDownRefresh": false
}
}, {
"path": "modal/modal",
"style": {
"navigationBarTitleText": "模态框",
"enablePullDownRefresh": false
}
}, {
"path": "toast/toast",
"style": {
"navigationBarTitleText": "Toast",
"enablePullDownRefresh": false
}
}, {
"path": "tips/tips",
"style": {
"navigationBarTitleText": "提示信息",
"enablePullDownRefresh": false
}
}, {
"path": "form/form",
"style": {
"navigationBarTitleText": "Form表单",
"enablePullDownRefresh": false
}
}, {
"path": "action-sheet/action-sheet",
"style": {
"navigationBarTitleText": "操作菜单",
"enablePullDownRefresh": false
}
}, {
"path": "picker/picker",
"style": {
"navigationBarTitleText": "Picker选择器",
"enablePullDownRefresh": false
}
}, {
"path": "select/select",
"style": {
"navigationBarTitleText": "Select列选择器",
"enablePullDownRefresh": false
}
}, {
"path": "verification-code/verification-code",
"style": {
"navigationBarTitleText": "验证码倒计时",
"enablePullDownRefresh": false
}
}, {
"path": "loading/loading",
"style": {
"navigationBarTitleText": "Loading加载",
"enablePullDownRefresh": false
}
}, {
"path": "switch/switch",
"style": {
"navigationBarTitleText": "Switch开关",
"enablePullDownRefresh": false
}
}, {
"path": "progress/progress",
"style": {
"navigationBarTitleText": "Progress进度条",
"enablePullDownRefresh": false
}
}, {
"path": "image-upload/image-upload",
"style": {
"navigationBarTitleText": "图片上传",
"enablePullDownRefresh": false
}
}, {
"path": "rate/rate",
"style": {
"navigationBarTitleText": "rate评分",
"enablePullDownRefresh": false
}
}, {
"path": "slider/slider",
"style": {
"navigationBarTitleText": "slider滑动条",
"enablePullDownRefresh": false
}
}, {
"path": "number-box/number-box",
"style": {
"navigationBarTitleText": "numberBox步进输入",
"enablePullDownRefresh": false
}
}, {
"path": "keyboard/keyboard",
"style": {
"navigationBarTitleText": "keyboard键盘",
"enablePullDownRefresh": false
}
}, {
"path": "tabs/tabs",
"style": {
"navigationBarTitleText": "tabs标签",
"enablePullDownRefresh": false
}
}, {
"path": "count-down/count-down",
"style": {
"navigationBarTitleText": "countDown倒计时",
"enablePullDownRefresh": false
}
}, {
"path": "count-to/count-to",
"style": {
"navigationBarTitleText": "countTo数字跳转",
"enablePullDownRefresh": false
}
}, {
"path": "count-scroll/count-scroll",
"style": {
"navigationBarTitleText": "countTo数字滚动",
"enablePullDownRefresh": false
}
}, {
"path": "sticky/sticky",
"style": {
"navigationBarTitleText": "sticky吸顶",
"enablePullDownRefresh": false
}
}, {
"path": "nav-bar/nav-bar",
"style": {
"navigationBarTitleText": "navBar导航栏",
"enablePullDownRefresh": false
}
}, {
"path": "notice-bar/notice-bar",
"style": {
"navigationBarTitleText": "noticeBar通知栏",
"enablePullDownRefresh": false
}
}, {
"path": "swiper/swiper",
"style": {
"navigationBarTitleText": "swiper轮播图",
"enablePullDownRefresh": false
}
}, {
"path": "collapse/collapse",
"style": {
"navigationBarTitleText": "collapse折叠面板",
"enablePullDownRefresh": false
}
}, {
"path": "read-more/read-more",
"style": {
"navigationBarTitleText": "readMore查看更多",
"enablePullDownRefresh": false
}
}, {
"path": "steps/steps",
"style": {
"navigationBarTitleText": "steps步骤条",
"enablePullDownRefresh": false
}
}, {
"path": "time-line/time-line",
"style": {
"navigationBarTitleText": "timeLine时间轴",
"enablePullDownRefresh": false
}
}, {
"path": "index-list/index-list",
"style": {
"navigationBarTitleText": "indexList索引列表",
"enablePullDownRefresh": false
}
}, {
"path": "index-list/base/index-list",
"style": {
"navigationBarTitleText": "indexList索引列表",
"enablePullDownRefresh": false
}
}, {
"path": "index-list/avatar/index-list",
"style": {
"navigationBarTitleText": "indexList索引列表",
"enablePullDownRefresh": false
}
}, {
"path": "calendar/calendar",
"style": {
"navigationBarTitleText": "calendar日历",
"enablePullDownRefresh": false
}
}, {
"path": "scroll-list/scroll-list",
"style": {
"navigationBarTitleText": "scrollList横向滚动",
"enablePullDownRefresh": false
}
}, {
"path": "swipe-action/swipe-action",
"style": {
"navigationBarTitleText": "swipeAction滑动菜单",
"enablePullDownRefresh": false
}
}, {
"path": "sign-board/sign-board",
"style": {
"navigationBarTitleText": "signBoard签名板",
"enablePullDownRefresh": false
// "pageOrientation": "landscape"
}
}, {
"path": "fab/fab",
"style": {
"navigationBarTitleText": "fab悬浮按钮",
"enablePullDownRefresh": false
}
}, {
"path": "input/input",
"style": {
"navigationBarTitleText": "输入框",
"enablePullDownRefresh": false
}
}, {
"path": "radio/radio",
"style": {
"navigationBarTitleText": "单选框",
"enablePullDownRefresh": false
}
}, {
"path": "check-box/check-box",
"style": {
"navigationBarTitleText": "复选框",
"enablePullDownRefresh": false
}
}, {
"path": "lazy-load/lazy-load",
"style": {
"navigationBarTitleText": "懒加载",
"enablePullDownRefresh": false
}
}, {
"path": "load-more/load-more",
"style": {
"navigationBarTitleText": "加载更多",
"enablePullDownRefresh": false
}
}, {
"path": "skeleton/skeleton",
"style": {
"navigationBarTitleText": "骨架屏",
"enablePullDownRefresh": false
}
}, {
"path": "empty/empty",
"style": {
"navigationBarTitleText": "空页面",
"enablePullDownRefresh": false
}
}, {
"path": "landscape/landscape",
"style": {
"navigationBarTitleText": "压屏窗",
"enablePullDownRefresh": false
}
}, {
"path": "verification-code-input/verification-code-input",
"style": {
"navigationBarTitleText": "验证码输入",
"enablePullDownRefresh": false
}
}, {
"path": "subsection/subsection",
"style": {
"navigationBarTitleText": "分段器",
"enablePullDownRefresh": false
}
}, {
"path": "goods-nav/goods-nav",
"style": {
"navigationBarTitleText": "商品导航",
"enablePullDownRefresh": false
}
}]
}, {
"root": "templatePage",
"pages": [{
"path": "login/demo1/demo1",
"style": {
"navigationBarTitleText": "火箭登录",
"enablePullDownRefresh": false
}
}, {
"path": "login/demo2/demo2",
"style": {
"navigationBarTitleText": "粒子登录",
"enablePullDownRefresh": false
}
}, {
"path": "login/demo3/demo3",
"style": {
"navigationBarTitleText": "背景登录",
"enablePullDownRefresh": false
}
}, {
"path": "login/demo4/demo4",
"style": {
"navigationBarTitleText": "简约登录",
"enablePullDownRefresh": false
}
}, {
"path": "health/qrcode/qrcode",
"style": {
"navigationBarTitleText": "健康码",
"enablePullDownRefresh": false
}
}, {
"path": "home/course/course",
"style": {
"navigationBarTitleText": "课程首页",
"enablePullDownRefresh": false
}
}, {
"path": "home/music/music",
"style": {
"navigationBarTitleText": "音乐首页",
"enablePullDownRefresh": false
}
}, {
"path": "home/design/design",
"style": {
"navigationBarTitleText": "设计首页",
"enablePullDownRefresh": false
}
}, {
"path": "home/job/job",
"style": {
"navigationBarTitleText": "招聘首页",
"enablePullDownRefresh": false
}
}, {
"path": "home/screen/screen",
"style": {
"navigationBarTitleText": "投屏首页",
"enablePullDownRefresh": false
}
}, {
"path": "home/wallpaper/wallpaper",
"style": {
"navigationBarTitleText": "壁纸首页",
"enablePullDownRefresh": false
}
}, {
"path": "life/fullpage/fullpage",
"style": {
"navigationBarTitleText": "全屏轮播",
"enablePullDownRefresh": false
}
}, {
"path": "life/pano/pano",
"style": {
"navigationBarTitleText": "3D全景",
"enablePullDownRefresh": false
}
}, {
"path": "life/plus/plus",
"style": {
"navigationBarTitleText": "会员协议",
"enablePullDownRefresh": false
}
}, {
"path": "life/browser/browser",
"style": {
"navigationBarTitleText": "浏览器",
"enablePullDownRefresh": false
}
}, {
"path": "life/share/share",
"style": {
"navigationBarTitleText": "",
// 图鸟公众号
"enablePullDownRefresh": false
}
}, {
"path": "life/candle/candle",
"style": {
"navigationBarTitleText": "敬请期待",
"enablePullDownRefresh": false
}
}, {
"path": "life/cover/cover",
"style": {
"navigationBarTitleText": "红包封面",
"enablePullDownRefresh": false
}
},{
"path": "life/cube/cube",
"style": {
"navigationBarTitleText": "魔方游戏",
"enablePullDownRefresh": false
}
}, {
"path": "time/clock/clock",
"style": {
"navigationBarTitleText": "时钟",
"enablePullDownRefresh": false
}
}, {
"path": "animate/loading/loading",
"style": {
"navigationBarTitleText": "加载动画",
"enablePullDownRefresh": false
}
}, {
"path": "animate/particle/particle",
"style": {
"navigationBarTitleText": "随机粒子",
"enablePullDownRefresh": false
}
}, {
"path": "animate/photo/photo",
"style": {
"navigationBarTitleText": "相册图集",
"enablePullDownRefresh": false
}
}, {
"path": "animate/hollow/hollow",
"style": {
"navigationBarTitleText": "镂空效果",
"enablePullDownRefresh": false
}
}, {
"path": "my/demo1/demo1",
"style": {
"navigationBarTitleText": "夏天个人",
"enablePullDownRefresh": false
}
}, {
"path": "my/demo2/demo2",
"style": {
"navigationBarTitleText": "图鸟个人",
"enablePullDownRefresh": false
}
}, {
"path": "my/demo3/demo3",
"style": {
"navigationBarTitleText": "外卖个人",
"enablePullDownRefresh": false
}
}, {
"path": "my/demo4/demo4",
"style": {
"navigationBarTitleText": "高端个人",
"enablePullDownRefresh": false
}
}, {
"path": "animate/suspended/suspended",
"style": {
"navigationBarTitleText": "流星悬浮",
"enablePullDownRefresh": false
}
}, {
"path": "animate/bubble/bubble",
"style": {
"navigationBarTitleText": "泡泡飘出",
"enablePullDownRefresh": false
}
}, {
"path": "article/demo1/demo1",
"style": {
"navigationBarTitleText": "资讯左图",
"enablePullDownRefresh": false
}
}, {
"path": "article/demo2/demo2",
"style": {
"navigationBarTitleText": "资讯右图",
"enablePullDownRefresh": false
}
}, {
"path": "life/about/about",
"style": {
"navigationBarTitleText": "关于我们",
"enablePullDownRefresh": false
}
}, {
"path": "animate/wave/wave",
"style": {
"navigationBarTitleText": "css波浪",
"enablePullDownRefresh": false
}
}, {
"path": "life/outset/outset",
"style": {
"navigationBarTitleText": "全新出发",
"enablePullDownRefresh": false
}
}]
},
{
"root": "thirdPage",
"pages": [{
"path": "short-video/short-video",
"style": {
"navigationBarTitleText": "短视频",
"enablePullDownRefresh": false
}
}]
},{
"root":"takeOutPage",
"pages": [{
"path": "walking-route/walking-route",
"style": {
"navigationBarTitleText": "路线轨迹",
"enablePullDownRefresh": false
}
}]
}],
"preloadRule": {
"pages/index/index": {
"network": "all",
"packages": ["basicPage", "componentsPage", "templatePage", "vipPage", "thirdPage"]
}
},
"globalStyle": {
"navigationStyle": "custom",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "Tuniao UI",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}
+170
View File
@@ -0,0 +1,170 @@
<template>
<view class="basic tn-safe-area-inset-bottom">
<view class="top-backgroup">
<image src='https://tnuiimage.tnkjapp.com/index_bg/basic_new.jpg' mode='widthFix' class='backgroud-image'></image>
</view>
<block v-for="(item, index) in navList" :key="index">
<view class="nav_title--wrap tn-margin-bottom-sm">
<view class="nav_title tn-cool-bg-color-15">{{ item.title | titleFilter}}</view>
</view>
<view class='nav-list'>
<block v-for="(content_item, content_index) in item.list" :key="content_index">
<navigator
open-type="navigate"
hover-class='none'
:url="content_item.url"
class="nav-list-item tn-shadow-blur tn-cool-bg-image tn-flex tn-flex-direction-column tn-flex-col-center tn-flex-row-between"
:class="[
getRandomCoolBg(content_index)
]"
>
<view class="icon">
<view :class="['tn-icon-' + content_item.icon]"></view>
</view>
<view class="nav-link">
<view class='title'>{{ content_item.title }}</view>
</view>
</navigator>
</block>
</view>
</block>
<view class="tn-padding-bottom-xs"></view>
</view>
</template>
<script>
import basicListData from '@/mock/basic_page.js'
export default {
name: 'Basic',
filters: {
titleFilter(value) {
if (value.length === 0) {
return ''
}
let newString = ''
for (let i = 0; i < value.length; i++) {
if (i !== 0) {
newString += ' / '
}
newString += value[i]
}
return newString
}
},
data() {
return {
// nav菜单列表
navList: basicListData.data
}
},
methods: {
getRandomCoolBg() {
return this.$tn.color.getRandomCoolBgClass()
}
}
}
</script>
<style lang="scss" scoped>
/* 顶部背景图 start */
.top-backgroup {
height: 450rpx;
z-index: -1;
.backgroud-image {
width: 100%;
height: 667rpx;
}
}
/* 顶部背景图 end */
/* 标题start */
.nav_title {
-webkit-background-clip: text;
color: transparent;
&--wrap {
position: relative;
display: flex;
height: 120rpx;
font-size: 46rpx;
align-items: center;
justify-content: center;
font-weight: bold;
background-image: url(https://tnuiimage.tnkjapp.com/title_bg/title44.png);
background-size: cover;
}
}
/* 标题end */
/* 组件导航列表 start*/
.nav-list {
display: flex;
flex-wrap: wrap;
padding: 0rpx 12rpx 0rpx;
justify-content: space-between;
/* 列表元素 start */
.nav-list-item {
padding: 20rpx 30rpx;
border-radius: 12rpx;
width: 45%;
margin: 0 18rpx 40rpx;
background-size: cover;
background-position: center;
position: relative;
z-index: 99;
/* 元素标题 start */
.nav-link {
font-size: 32rpx;
text-transform: capitalize;
padding: 0 0 10rpx 0;
position: relative;
.title {
color: #FFFFFF;
margin-top: 20rpx;
text-align: center;
}
}
/* 元素标题 end */
/* 元素图标 start */
.icon {
font-variant: small-caps;
width: 90rpx;
height: 90rpx;
line-height: 90rpx;
margin: 0;
padding: 0;
display: inline-flex;
text-align: center;
justify-content: center;
vertical-align: middle;
font-size: 50rpx;
color: #FFFFFF;
white-space: nowrap;
opacity: 0.9;
background-color: rgba(0, 0, 0, 0.05);
background-size: cover;
background-position: 50%;
border-radius: 5000rpx;
}
/* 元素图标 end */
}
/* 列表元素 end */
}
/* 组件导航列表 end*/
</style>
+167
View File
@@ -0,0 +1,167 @@
<template>
<view class="components tn-safe-area-inset-bottom">
<view class="top-backgroup">
<image src='https://tnuiimage.tnkjapp.com/index_bg/components_new.jpg' mode='widthFix' class='backgroud-image'></image>
</view>
<block v-for="(item, index) in navList" :key="index">
<view class="nav_title--wrap tn-margin-bottom-sm">
<view class="nav_title tn-cool-bg-color-15">{{ item.title | titleFilter}}</view>
</view>
<view class='nav-list'>
<block v-for="(content_item, content_index) in item.list" :key="content_index">
<navigator
open-type="navigate"
hover-class='none'
:url="content_item.url"
class="nav-list-item tn-shadow-blur tn-cool-bg-image tn-flex tn-flex-col-center tn-flex-row-between"
:class="[
getRandomCoolBg(content_index)
]"
>
<view class="nav-link tn-flex-1">
<view class='title'>{{ content_item.title }}</view>
</view>
<view class="icon">
<view :class="['tn-icon-' + content_item.icon]"></view>
</view>
</navigator>
</block>
</view>
</block>
<view class="tn-padding-bottom-xs"></view>
</view>
</template>
<script>
import componentsListData from '@/mock/components_page.js'
export default {
name: 'Components',
filters: {
titleFilter(value) {
if (value.length === 0) {
return ''
}
let newString = ''
for (let i = 0; i < value.length; i++) {
if (i !== 0) {
newString += ' / '
}
newString += value[i]
}
return newString
}
},
data() {
return {
// nav菜单列表
navList: componentsListData.data
}
},
methods: {
getRandomCoolBg() {
return this.$tn.color.getRandomCoolBgClass()
}
}
}
</script>
<style lang="scss" scoped>
/* 顶部背景图 start */
.top-backgroup {
height: 450rpx;
z-index: -1;
.backgroud-image {
width: 100%;
height: 667rpx;
}
}
/* 顶部背景图 end */
/* 标题start */
.nav_title {
-webkit-background-clip: text;
color: transparent;
&--wrap {
position: relative;
display: flex;
height: 120rpx;
font-size: 46rpx;
align-items: center;
justify-content: center;
font-weight: bold;
background-image: url(https://tnuiimage.tnkjapp.com/title_bg/title44.png);
background-size: cover;
}
}
/* 标题end */
/* 组件导航列表 start*/
.nav-list {
display: flex;
flex-wrap: wrap;
padding: 0rpx 12rpx 0rpx;
justify-content: space-between;
/* 列表元素 start */
.nav-list-item {
padding: 30rpx 30rpx 20rpx 30rpx;
border-radius: 12rpx;
width: 45%;
margin: 0 18rpx 40rpx;
background-size: cover;
background-position: 50%;
position: relative;
z-index: 99;
/* 元素标题 start */
.nav-link {
font-size: 32rpx;
line-height: 1.2;
text-transform: capitalize;
padding: 0rpx 10rpx 0rpx 0;
position: relative;
.title {
color: #FFFFFF;
text-align: left;
}
}
/* 元素标题 end */
/* 元素图标 start */
.icon {
font-variant: small-caps;
width: 70rpx;
height: 70rpx;
line-height: 70rpx;
margin: 0;
padding: 0;
display: inline-flex;
text-align: center;
justify-content: center;
vertical-align: middle;
font-size: 45rpx;
color: #FFFFFF;
white-space: nowrap;
opacity: 0.9;
background-color: rgba(0, 0, 0, 0.05);
background-size: cover;
background-position: 50%;
border-radius: 5000rpx;
}
/* 元素图标 end */
}
/* 列表元素 end */
}
/* 组件导航列表 end*/
</style>
+146
View File
@@ -0,0 +1,146 @@
<template>
<view class="index">
<view v-if="tabberPageLoadFlag[0]" :style="{display: currentIndex === 0 ? '' : 'none'}">
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
<Basic ref="basic"></Basic>
</scroll-view>
</view>
<view v-if="tabberPageLoadFlag[1]" :style="{display: currentIndex === 1 ? '' : 'none'}">
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
<components ref="components"></components>
</scroll-view>
</view>
<view v-if="tabberPageLoadFlag[2]" :style="{display: currentIndex === 2 ? '' : 'none'}">
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
<vip ref="vip"></vip>
</scroll-view>
</view>
<view v-if="tabberPageLoadFlag[3]" :style="{display: currentIndex === 3 ? '' : 'none'}">
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
<templatePage ref="template"></templatePage>
</scroll-view>
</view>
<view v-if="tabberPageLoadFlag[4]" :style="{display: currentIndex === 4 ? '' : 'none'}">
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
<tuniao ref="about"></tuniao>
</scroll-view>
</view>
<tn-tabbar
v-model="currentIndex"
:list="tabbarList"
activeColor="#838383"
inactiveColor="#AAAAAA"
activeIconColor="tn-cool-bg-color-7"
:animation="true"
:safeAreaInsetBottom="true"
@change="switchTabbar"
></tn-tabbar>
</view>
</template>
<script>
import Basic from '../basic/basic.vue'
import Components from '../components/components.vue'
import TemplatePage from '../template/template.vue'
import Vip from '../vip/vip.vue'
import Tuniao from '../tuniao/tuniao.vue'
export default {
components: {
Basic,
Components,
TemplatePage,
Vip,
Tuniao
},
data() {
return {
// 底部tabbar菜单数据
tabbarList: [
{
title: '元素',
activeIcon: 'count-fill',
inactiveIcon: 'menu'
},
{
title: '组件',
activeIcon: 'honor-fill',
inactiveIcon: 'honor'
},
{
title: '会员',
activeIcon: 'vip-fill',
inactiveIcon: 'vip',
activeIconColor: '#FFFFFF',
inactiveIconColor: '#FFFFFF',
iconSize: 50,
out: true
},
{
title: '发现',
activeIcon: 'discover-fill',
inactiveIcon: 'discover',
count: 100
},
{
title: '图鸟',
activeIcon: 'computer-fill',
inactiveIcon: 'computer',
dot: true
}
],
// tabbar当前被选中的序号
currentIndex: 0,
// 自定义底栏对应页面的加载情况
tabberPageLoadFlag: []
}
},
onLoad(options) {
const index = Number(options.index || 0)
// 根据底部tabbar菜单列表设置对应页面的加载情况
this.tabberPageLoadFlag = this.tabbarList.map((item, tabbar_index) => {
return index === tabbar_index
})
this.switchTabbar(index)
},
methods: {
// 切换导航
switchTabbar(index) {
this._switchTabbarPage(index)
},
// 导航页面滚动到底部
tabbarPageScrollLower(e) {
},
// 切换导航页面
_switchTabbarPage(index) {
const selectPageFlag = this.tabberPageLoadFlag[index]
if (selectPageFlag === undefined) {
return
}
if (selectPageFlag === false) {
this.tabberPageLoadFlag[index] = true
}
this.currentIndex = index
}
}
}
</script>
<style lang="scss" scoped>
.index {
overflow: hidden;
height: 100%;
}
.custom-tabbar-page {
height: calc(100vh - (100rpx + env(safe-area-inset-bottom) / 2));
}
</style>
+194
View File
@@ -0,0 +1,194 @@
<template>
<view class="template tn-safe-area-inset-bottom">
<view class="top-backgroup">
<image src='https://tnuiimage.tnkjapp.com/index_bg/template_new.jpg' mode='widthFix' class='backgroud-image'></image>
</view>
<block v-for="(item, index) in navList" :key="index">
<view class="nav_title--wrap tn-margin-bottom-sm">
<view class="nav_title tn-cool-bg-color-15">{{ item.title | titleFilter}}</view>
</view>
<view class='nav-list'>
<block v-for="(content_item, content_index) in item.list" :key="content_index">
<navigator
open-type="navigate"
hover-class='none'
:url="content_item.url"
class="nav-list-item tn-shadow-blur tn-cool-bg-image"
:class="[
getRandomCoolBg(content_index)
]"
>
<view class="tn-flex tn-flex-col-center tn-flex-row-between">
<view class="nav-link">
<view class='title'>{{ content_item.title }}</view>
</view>
<view class="icon">
<view :class="['tn-icon-' + content_item.icon]"></view>
</view>
</view>
<view class="author">
<view class='name tn-text-sm tn-color-gray' style="margin-left: -10rpx;">
<text class="tn-icon-code tn-padding-right-xs"></text>
<text class=""> {{ content_item.author }} </text>
</view>
</view>
</navigator>
</block>
</view>
</block>
<view class="tn-padding-bottom-xs"></view>
</view>
</template>
<script>
import templateListData from '@/mock/template_page.js'
export default {
name: 'TemplatePage',
filters: {
titleFilter(value) {
if (value.length === 0) {
return ''
}
let newString = ''
for (let i = 0; i < value.length; i++) {
if (i !== 0) {
newString += ' / '
}
newString += value[i]
}
return newString
}
},
data() {
return {
// nav菜单列表
navList: templateListData.data
}
},
methods: {
getRandomCoolBg() {
return this.$tn.color.getRandomCoolBgClass()
}
}
}
</script>
<style lang="scss" scoped>
/* 顶部背景图 start */
.top-backgroup {
height: 450rpx;
z-index: -1;
.backgroud-image {
width: 100%;
height: 667rpx;
}
}
/* 顶部背景图 end */
/* 标题start */
.nav_title {
-webkit-background-clip: text;
color: transparent;
&--wrap {
position: relative;
display: flex;
height: 120rpx;
font-size: 46rpx;
align-items: center;
justify-content: center;
font-weight: bold;
background-image: url(https://tnuiimage.tnkjapp.com/title_bg/title44.png);
background-size: cover;
}
}
/* 标题end */
/* 组件导航列表 start*/
.nav-list {
display: flex;
flex-wrap: wrap;
padding: 0rpx 12rpx 0rpx;
justify-content: space-between;
/* 列表元素 start */
.nav-list-item {
padding: 50rpx 30rpx 36rpx 30rpx;
border-radius: 12rpx;
width: 100%;
margin: 0 18rpx 90rpx;
background-size: cover;
background-position: center;
position: relative;
z-index: 99;
// display: flex;
// align-items: center;
// justify-content: space-between;
/* 元素标题 start */
.nav-link {
flex: 1;
font-size: 32rpx;
text-transform: capitalize;
padding: 10rpx 0 20rpx 0;
position: relative;
.title {
color: #FFFFFF;
text-align: left;
}
}
/* 元素标题 end */
/* 元素图标 start */
.icon {
font-variant: small-caps;
width: 70rpx;
height: 70rpx;
line-height: 70rpx;
margin: 0;
padding: 0;
display: inline-flex;
text-align: center;
justify-content: center;
vertical-align: middle;
font-size: 45rpx;
color: #FFFFFF;
white-space: nowrap;
opacity: 0.9;
background-color: rgba(0, 0, 0, 0.05);
background-size: cover;
background-position: 50%;
border-radius: 5000rpx;
}
/* 元素图标 end */
/* 作者信息 start*/
.author {
// background-color: red;
box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.12);
border-radius: 0 0 15rpx 15rpx;
position: absolute;
width: 85%;
line-height: 50rpx;
left: 50%;
bottom: -50rpx;
transform: translateX(-50%);
z-index: -1;
text-align: center;
}
/* 作者信息 end*/
}
/* 列表元素 end */
}
/* 组件导航列表 end*/
</style>
+563
View File
@@ -0,0 +1,563 @@
<template>
<view class="about tn-safe-area-inset-bottom">
<view class="top-backgroup">
<image src='https://tnuiimage.tnkjapp.com/index_bg/about_new.jpg' mode='widthFix' class='backgroud-image'></image>
</view>
<view class="about__wrap">
<!-- 头像用户信息 -->
<view class="user-info__container tn-flex tn-flex-direction-column tn-flex-col-center tn-flex-row-center">
<view class="user-info__avatar tn-bg-grey--light tn-flex tn-flex-col-center tn-flex-row-center">
<view class="tn-shadow-blur" style="background-image:url('https://tnuiimage.tnkjapp.com/logo/tuniao.jpg');width: 180rpx;height: 180rpx;background-size: cover;">
</view>
<!-- <view class="tn-icon-logo-tuniao" style="font-size: 140rpx;color: #01BEFF;"></view> -->
</view>
<view class="user-info__nick-name">图鸟小伙伴</view>
</view>
<!-- banner start-->
<!-- <view class="tn-flex tn-flex-wrap tn-padding-xs" @click="navTuniaoVue3">
<view class="" style="width: 100%;">
<view class="image-piccapsule tn-shadow-blur" style="background-image:url('https://tnuiimage.tnkjapp.com/capsule-banner/banner-Vue3.png');">
<view class="image-capsule">
</view>
</view>
</view>
</view> -->
<!-- banner end-->
<view class="tn-margin-left tn-margin-right">
<!-- 方式20 start-->
<view class="tn-flex">
<view class="tn-flex-1 about-shadow tn-bg-white" style="margin: 50rpx 15rpx 0 0;padding: 30rpx 0;" @click="navTuniaoWebsite">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view class="icon20__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-orangered tn-color-white">
<view class="tn-icon-computer-fill"></view>
</view>
<view class="tn-text-center" style="font-size: 30rpx;">
<view class="tn-text-ellipsis">图鸟官网</view>
</view>
</view>
</view>
<view class="tn-flex-1 about-shadow tn-bg-white" style="margin: 50rpx 0 0 15rpx;padding: 30rpx 0;" @click="navShare">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view class="icon20__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-purplered tn-color-white">
<view class="tn-icon-moon-fill"></view>
</view>
<view class="tn-text-center" style="font-size: 30rpx;">
<view class="tn-text-ellipsis">图鸟公众号</view>
</view>
</view>
</view>
</view>
<!-- 数据信息 -->
<!-- <view class="tn-info__container tn-flex tn-flex-wrap tn-flex-col-center tn-flex-row-between">
<block v-for="(item, index) in tuniaoData" :key="index">
<view class="tn-info__item tn-flex tn-flex-direction-row tn-flex-col-center tn-flex-row-between about-shadow">
<view class="tn-info__item__left tn-flex tn-flex-direction-row tn-flex-col-center tn-flex-row-left">
<view class="tn-info__item__left--icon tn-flex tn-flex-col-center tn-flex-row-center" :class="[`tn-bg-${item.color}--light tn-color-${item.color}`]">
<view :class="[`tn-icon-${item.icon}`]"></view>
</view>
<view class="tn-info__item__left__content">
<view class="tn-info__item__left__content--title">{{ item.title }}</view>
<view class="tn-info__item__left__content--data tn-padding-top-xs">{{ item.value }}</view>
</view>
</view>
<view class="tn-info__item__right">
<view class="tn-info__item__right--icon">
<view class="tn-icon-code"></view>
</view>
</view>
</view>
</block>
</view> -->
<!-- 更多信息-->
<view class="about-shadow tn-margin-top-lg tn-padding-top-sm tn-padding-bottom-sm">
<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="copyDCloud">
<view class="tn-flex tn-flex-col-center">
<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-1 tn-color-white">
<view class="tn-icon-fire-fill"></view>
</view>
<view class="tn-margin-left-sm tn-flex-1">插件市场</view>
<view class="tn-margin-left-sm tn-color-blue tn-icon-copy-fill"></view>
</view>
</tn-list-cell>
<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="copyGitee">
<view class="tn-flex tn-flex-col-center">
<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-3 tn-color-white">
<view class="tn-icon-star-fill"></view>
</view>
<view class="tn-margin-left-sm tn-flex-1">Gitee地址</view>
<view class="tn-margin-left-sm tn-color-blue tn-icon-copy-fill"></view>
</view>
</tn-list-cell>
<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="navPlus">
<view class="tn-flex tn-flex-col-center">
<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-6 tn-color-white">
<view class="tn-icon-safe-fill"></view>
</view>
<view class="tn-margin-left-sm tn-flex-1">会员协议</view>
<view class="tn-margin-left-sm tn-color-red tn-icon-send-fill"></view>
</view>
</tn-list-cell>
<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30">
<view class="tn-flex tn-flex-col-center">
<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-2 tn-color-white">
<view class="tn-icon-set-fill"></view>
</view>
<view class="tn-margin-left-sm tn-flex-1">更新日志</view>
<view class="tn-margin-left-sm tn-color-gray"></view>
</view>
</tn-list-cell>
</view>
<!-- 更多信息-->
<view class="about-shadow tn-margin-top-lg tn-margin-bottom-lg tn-padding-top-sm tn-padding-bottom-sm">
<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30">
<button class="tn-flex tn-flex-col-center tn-button--clear-style" open-type="contact">
<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-9 tn-color-white">
<view class="tn-icon-wechat-fill"></view>
</view>
<view class="tn-margin-left-sm">合作勾搭</view>
</button>
</tn-list-cell>
<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30">
<button class="tn-flex tn-flex-col-center tn-button--clear-style" open-type="feedback">
<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-13 tn-color-white">
<view class="tn-icon-comment-fill"></view>
</view>
<view class="tn-margin-left-sm">问题反馈</view>
</button>
</tn-list-cell>
</view>
<view class="tn-flex tn-flex-row-between">
<view class="justify-content-item tn-text-bold tn-text-lg">
<text class="">友情链接</text>
</view>
<view class="justify-content-item tn-text-df">
<text class="tn-padding-xs">全部</text>
<text class="tn-icon-right"></text>
</view>
</view>
<!-- 更多信息-->
<view class="about-shadow tn-margin-top tn-margin-bottom-lg tn-padding-top-sm tn-padding-bottom-sm">
<tn-scroll-list :indicator="false">
<view class="tn-flex tn-margin-left-sm tn-margin-right-sm tn-margin-top">
<navigator target="miniProgram" :app-id="item.appid" :path="item.path" version="release" delta="1" hover-class="none"
v-for="(item, index) in linksData" :key="index">
<view class="tn-flex-1 tn-padding-sm tn-radius">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<!-- <view class="icon11__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur"
:class="[`tn-bg-${item.color}--light tn-color-${item.color}`]">
<view :class="[`tn-icon-${item.icon}`]"></view>
</view> -->
<view class="icon5__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur"
:style="'background-image:url('+ item.url + ');background-size:100% 100%;'">
</view>
<view class="tn-color-black tn-text-df tn-text-center tn-margin-top-sm">
<text class="tn-text-ellipsis">{{ item.title }}</text>
</view>
</view>
</view>
</navigator>
</view>
</tn-scroll-list>
</view>
</view>
</view>
<view class="tn-padding-bottom-xs"></view>
</view>
</template>
<script>
export default {
name: 'Tuniao',
data() {
return {
tuniaoData: [
{
title: 'View',
icon: 'eye',
color: 'indigo',
value: '1.22 W'
},
{
title: 'Star',
icon: 'star',
color: 'orange',
value: '406'
},
{
title: 'Fork',
icon: 'fork',
color: 'purplered',
value: '129'
},
{
title: 'Version',
icon: 'trusty',
color: 'green',
value: '1.2.0'
}
],
linksData: [{
url: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1646920408332-assets/web-upload/6ea58bb4-cb0d-4034-b9ac-a0155d5c3afb.jpeg',
title: 'uCharts',
appid: 'wx37a9ee6a7398dec0',
path: ''
},
{
url: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1646963464962-assets/web-upload/3c14732e-cc92-4726-9a9c-1fa7133f8147.jpeg',
title: '芊云全景',
appid: 'wx9f77d65eb4eff65b',
path: ''
},
{
url: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1648734439954-assets/web-upload/2e3d3e73-a28c-4c5d-885a-e5cdf2da13af.jpeg',
title: '前端铺子',
appid: 'wx201efd3f86fa2ba7',
path: ''
},
{
url: 'https://cdn.nlark.com/yuque/0/2022/png/280373/1647178609988-assets/web-upload/37a6d22c-410b-4f51-a083-993306bbc4fa.png',
title: 'DIY神器',
appid: 'wxda438798441f31f1',
path: ''
},
{
url: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1666880969854-assets/web-upload/95902944-1be6-4c23-a2f5-47cf78eda072.jpeg',
title: '江夏生活',
appid: 'wx2257f5c246ad1bcd',
path: ''
},
{
url: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1667656184223-assets/web-upload/cc3dbf5c-1483-4c74-83fc-03c2bd7c373e.jpeg',
title: '多客社交',
appid: 'wx86cc21f2f7fa3efa',
path: ''
},
{
url: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1647505953019-assets/web-upload/a6c0a823-5b55-4cb7-aee5-5b82990533ed.jpeg',
title: '样式库',
appid: 'wx853f345b163a00d6',
path: ''
},
{
url: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1647765849135-assets/web-upload/dfcacf41-b1c0-4dbf-8613-3f948e43d125.jpeg',
title: '旺石头科技',
appid: 'wx6007249d6b2348ea',
path: ''
},
{
url: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1655887617723-assets/web-upload/028185c8-fac6-4863-a00f-7e9bbe3ea54e.jpeg',
title: '邻邻邦',
appid: 'wxf7512cb916d6d1c2',
path: ''
},
]
}
},
methods: {
// 跳转到图鸟官网
navTuniaoWebsite() {
uni.navigateToMiniProgram({
appId: 'wxa698b1eee960632f'
})
},
// 跳转到图鸟Vue3
navTuniaoVue3(e) {
wx.vibrateLong();
uni.navigateToMiniProgram({
appId: 'wxd4296f570b8b39c9'
})
},
// 跳转到会员协议
navPlus() {
uni.navigateTo({
url: '/templatePage/life/plus/plus'
})
},
// 跳转到图鸟公众号
navShare() {
uni.navigateTo({
url: '/templatePage/life/share/share'
})
},
// 复制插件市场地址
copyDCloud() {
uni.setClipboardData({
data: "https://ext.dcloud.net.cn/publisher?id=356088",
})
},
// 复制Gitee地址
copyGitee() {
uni.setClipboardData({
data: "https://gitee.com/TSpecific/tuniao-ui",
})
},
}
}
</script>
<style lang="scss" scoped>
/* 顶部背景图 start */
.top-backgroup {
height: 450rpx;
z-index: -1;
.backgroud-image {
width: 100%;
height: 667rpx;
// z-index: -1;
}
}
/* 顶部背景图 end */
/* 页面 start*/
.about-shadow{
border-radius: 15rpx;
box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
}
.about {
&__wrap {
position: relative;
z-index: 1;
margin: 20rpx 0rpx;
margin-top: -180rpx;
}
}
/* 页面 end*/
/* 用户信息 start */
.user-info {
&__container {
}
&__avatar {
width: 180rpx;
height: 180rpx;
border: 8rpx solid rgba(255,255,255,0.05);
border-radius: 50%;
overflow: hidden;
box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
}
&__nick-name {
margin-top: 26rpx;
font-size: 42rpx;
font-weight: 600;
text-align: center;
}
}
/* 用户信息 end */
/* 信息展示 start */
.tn-info {
&__container {
margin-top: 0rpx;
}
&__item {
width: 48%;
margin: 15rpx 0rpx;
padding: 28rpx;
border-radius: 15rpx;
position: relative;
z-index: 1;
&::after {
content: " ";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
left: 0;
bottom: 0;
border-radius: inherit;
opacity: 1;
transform: scale(1, 1);
background-size: 100% 100%;
background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/6.png);
}
&__left {
&--icon {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
font-size: 40rpx;
margin-right: 20rpx;
position: relative;
z-index: 1;
&::after {
content: " ";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
left: 0;
bottom: 0;
border-radius: inherit;
opacity: 1;
transform: scale(1, 1);
background-size: 100% 100%;
background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg5.png);
}
}
&__content {
font-size: 30rpx;
&--data {
margin-top: 5rpx;
font-weight: bold;
}
}
}
&__right {
&--icon {
font-size: 60rpx;
opacity: 0.15;
}
}
}
}
/* 信息展示 end */
/* 图标容器5 start */
.icon5 {
&__item {
// width: 30%;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 0rpx;
margin: 0rpx;
transform: scale(1);
transition: transform 0.3s linear;
transform-origin: center center;
&--icon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin-bottom: 18rpx;
position: relative;
z-index: 1;
}
}
}
.icon20 {
&__item {
width: 30%;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 30rpx;
margin: 20rpx 10rpx;
transform: scale(1);
transition: transform 0.3s linear;
transform-origin: center center;
&--icon {
width: 100rpx;
height: 100rpx;
font-size: 60rpx;
border-radius: 50%;
margin-bottom: 18rpx;
position: relative;
z-index: 1;
&::after {
content: " ";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
left: 0;
bottom: 0;
border-radius: inherit;
opacity: 1;
transform: scale(1, 1);
background-size: 100% 100%;
background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg.png);
}
}
}
}
/* 图标容器1 start */
.icon1 {
&__item {
// width: 30%;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 30rpx;
margin: 20rpx 10rpx;
transform: scale(1);
transition: transform 0.3s linear;
transform-origin: center center;
&--icon {
width: 40rpx;
height: 40rpx;
font-size: 28rpx;
border-radius: 50%;
position: relative;
z-index: 1;
&::after {
content: " ";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
left: 0;
bottom: 0;
border-radius: inherit;
opacity: 1;
transform: scale(1, 1);
background-size: 100% 100%;
background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg.png);
}
}
}
}
/* 图标容器1 end */
/* 胶囊banner*/
.image-capsule{
padding: 100rpx 0rpx;
font-size: 40rpx;
font-weight: 300;
position: relative;
}
.image-piccapsule{
background-size: cover;
background-repeat:no-repeat;
// background-attachment:fixed;
background-position:top;
border-radius: 20rpx 20rpx 0 0;
}
</style>
+508
View File
@@ -0,0 +1,508 @@
<template>
<view class="vip tn-safe-area-inset-bottom">
<view class="top-backgroup">
<image src='https://tnuiimage.tnkjapp.com/index_bg/tools_new.jpg' mode='widthFix' class='backgroud-image'></image>
</view>
<swiper class="card-swiper" :circular="true"
:autoplay="false" duration="500" interval="180000" previous-margin="170rpx" next-margin="170rpx" @change="cardSwiper" style="margin-top: -280rpx;">
<swiper-item v-for="(item,index) in swiperList" :key="index" :class="cardCur==index?'cur':''">
<!-- <view class="swiper-item image-banner">
<image :src="item.url" mode="widthFix" v-if="item.type=='image'"></image>
</view> -->
<!-- <view class="swiper-item image-banner" :style="'background-image:url('+ item.url + ');width: 230rpx;height: 100%;background-size:100% 100%;'">
</view> -->
<view class="tnphone-white-min swiper-item wow fadeInLeft2" @click="navTuniaoMoban">
<view class="skin wow fadeInRight2">
<view class="screen wow fadeInUp2">
<!-- <view class="head">
<text>{{item.name}}</text>
</view> -->
<view class="peak wow">
<view class="sound"></view>
<view class="lens"></view>
</view>
<!-- <view class="area-l">
<view class="">
<text class="tn-icon-all"></text>
<text class="tn-icon-wifi tn-padding-left-xs"></text>
</view>
</view>
<view class="area-r">
<view class="">
<text class="tn-icon-light"></text>
<text class="tn-icon-time tn-padding-left-xs"></text>
</view>
</view> -->
<!-- <view class="talk"></view> -->
<view class="image-banner">
<image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
</view>
</view>
</view>
</view>
</swiper-item>
</swiper>
<!-- 方式4 start-->
<view class="tn-flex tn-padding-bottom-sm">
<view class="tn-flex-1 tn-padding-sm tn-radius" @click="navTuniaoVUE3">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view class="icon4__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur">
<view class="tn-icon-level-fill tn-cool-color-icon4 tn-cool-bg-color-5"></view>
</view>
<view class="tn-color-gray--dark tn-text-center">
<text class="tn-text-ellipsis">图鸟VUE3</text>
</view>
</view>
</view>
<view class="tn-flex-1 tn-padding-sm tn-radius" @click="navTuniaoMoban">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view class="icon4__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur">
<view class="tn-icon-discover-planet-fill tn-cool-color-icon4 tn-cool-bg-color-8"></view>
</view>
<view class="tn-color-gray--dark tn-text-center">
<text class="tn-text-ellipsis">圈子博客</text>
</view>
</view>
</view>
<view class="tn-flex-1 tn-padding-sm tn-radius" @click="navBusiness">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view class="icon4__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur">
<view class="tn-icon-identity-fill tn-cool-color-icon4 tn-cool-bg-color-15"></view>
</view>
<view class="tn-color-gray--dark tn-text-center">
<text class="tn-text-ellipsis">简约商圈</text>
</view>
</view>
</view>
<view class="tn-flex-1 tn-padding-sm tn-radius" @click="navXiongJie">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view class="icon4__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur">
<view class="tn-icon-image-fill tn-cool-color-icon4 tn-cool-bg-color-3"></view>
</view>
<view class="tn-color-gray--dark tn-text-center">
<text class="tn-text-ellipsis">凶姐壁纸</text>
</view>
</view>
</view>
</view>
<!-- 方式4 end-->
<!-- banner start-->
<view class="tn-flex tn-flex-wrap tn-padding-xs" @click="navTuniaoMoban">
<view class="" style="width: 100%;">
<view class="image-piccapsule tn-shadow-blur" style="background-image:url('https://tnuiimage.tnkjapp.com/capsule-banner/banner-circle2.png');">
<view class="image-capsule">
</view>
</view>
</view>
</view>
<!-- banner end-->
<block v-for="(item, index) in navList" :key="index">
<view class="nav_title--wrap tn-margin-bottom-sm">
<view class="nav_title tn-cool-bg-color-15">{{ item.title | titleFilter}}</view>
</view>
<view class='nav-list'>
<block v-for="(content_item, content_index) in item.list" :key="content_index">
<navigator
open-type="navigate"
hover-class='none'
:url="content_item.url"
class="nav-list-item tn-shadow-blur tn-cool-bg-image"
:class="[
getRandomCoolBg(content_index)
]"
>
<view class="nav-link">
<view class='title'>{{ content_item.title }}</view>
<view class='author'> <text class="tn-icon-code tn-padding-right-xs"></text> {{ content_item.author }}</view>
</view>
<!-- <view class="icon">
<view :class="['tn-icon-' + content_item.icon]"></view>
</view> -->
</navigator>
</block>
</view>
</block>
<view class="tn-padding-xl tn-text-center tn-color-gray">
<view class="tn-padding-bottom-sm" @click="navPlus">
关于图鸟会员
<text class="tn-icon-rocket tn-padding-left-xs"></text>
</view>
</view>
</view>
</template>
<script>
import vipListData from '@/mock/vip_page.js'
export default {
name: 'Vip',
filters: {
titleFilter(value) {
if (value.length === 0) {
return ''
}
let newString = ''
for (let i = 0; i < value.length; i++) {
if (i !== 0) {
newString += ' / '
}
newString += value[i]
}
return newString
}
},
data() {
return {
cardCur: 0,
swiperList: [{
id: 0,
type: 'image',
url: 'https://tnuiimage.tnkjapp.com/index_bg/circle1.jpg',
}, {
id: 1,
type: 'image',
url: 'https://tnuiimage.tnkjapp.com/index_bg/circle2.jpg',
}, {
id: 2,
type: 'image',
url: 'https://tnuiimage.tnkjapp.com/index_bg/circle3.jpg',
}, {
id: 3,
type: 'image',
url: 'https://tnuiimage.tnkjapp.com/index_bg/circle4.jpg',
},{
id: 4,
type: 'image',
url: 'https://tnuiimage.tnkjapp.com/index_bg/circle5.jpg',
},{
id: 5,
type: 'image',
url: 'https://tnuiimage.tnkjapp.com/index_bg/circle6.jpg',
},{
id: 6,
type: 'image',
url: 'https://tnuiimage.tnkjapp.com/index_bg/circle7.jpg',
}
],
// nav菜单列表
navList: vipListData.data
}
},
methods: {
// cardSwiper
cardSwiper(e) {
this.cardCur = e.detail.current
},
getRandomCoolBg() {
return this.$tn.color.getRandomCoolBgClass()
},
// 跳转到图鸟VUE3
navTuniaoVUE3(e) {
wx.vibrateLong();
uni.navigateToMiniProgram({
appId: 'wxd4296f570b8b39c9'
})
},
// 跳转到图鸟模板
navTuniaoMoban(e) {
wx.vibrateLong();
uni.navigateToMiniProgram({
appId: 'wx13c0ed55c12d2afb'
})
},
// 跳转到关于作者
navSaitolia(e) {
wx.vibrateLong();
uni.navigateTo({
url: '/templatePage/life/plus/plus'
})
},
// 跳转到图鸟模板2
navBusiness(e) {
wx.vibrateLong();
uni.navigateToMiniProgram({
appId: 'wx9056aabd1c0c6a8a'
})
},
// 跳转到图鸟模板3
navXiongJie(e) {
wx.vibrateLong();
uni.navigateToMiniProgram({
appId: 'wx76bb942a2810e8e5'
})
},
// 跳转到会员协议
navPlus() {
uni.navigateTo({
url: '/templatePage/life/plus/plus'
})
},
}
}
</script>
<style lang="scss" scoped>
/* 顶部背景图 start */
.top-backgroup {
height: 350rpx;
z-index: -1;
.backgroud-image {
width: 100%;
height: 667rpx;
}
}
/* 顶部背景图 end */
/* 轮播 start */
/* .tnphone-white-min 细边框*/
.tnphone-white-min {width: 380rpx; height: 800rpx; border-radius: 40rpx; background: #E9E5F3; padding: 7rpx; display: table; color: #333;
box-sizing: border-box; box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0,0,0,0.15); margin: 70rpx auto; cursor: default; position: relative}
.tnphone-white-min .skin {width: 100%; height: 100%; border-radius: 40rpx; background: #E9E5F3; padding: 10rpx;}
.tnphone-white-min .screen {width: 100%; height: 100%; border-radius: 30rpx; background: #E9E5F3; position: relative; overflow: hidden}
.tnphone-white-min .head {width: 100%; height: 90rpx; text-align: center; position: absolute; padding: 45rpx 15rpx 10rpx 15rpx;}
.tnphone-white-min .peak {left: 22%;width: 56%; height: 27rpx; margin: -2rpx auto 0rpx; border-radius: 0 0 20rpx 20rpx; background: #E9E5F3; position: absolute}
.tnphone-white-min .sound {width: 48rpx; height: 6rpx; border-radius: 15rpx; background: #555; position: absolute; left: 50%; top: 50%; margin-left: -24rpx; margin-top: -10rpx;
box-shadow: 0rpx 4rpx 4rpx 0rpx #444 inset}
.tnphone-white-min .lens {width: 6rpx; height: 6rpx; border-radius: 50%; background: #2c5487; position: absolute; left: 50%; top: 50%; margin-left: 34rpx; margin-top: -10rpx}
.tnphone-white-min .talk {width: 50%; height: 6rpx; border-radius: 15rpx; background: rgba(0,0,0,.3); position: absolute; bottom: 8rpx; left: 50%; margin-left: -25%}
.tnphone-white-min .area-l,.tnphone-white-min .area-r {width: 70rpx; height: 16rpx; position: absolute; top: 6rpx}
.tnphone-white-min .area-l {left: 0; text-align: center; font-size: 12rpx; line-height: 22rpx; text-indent: 10rpx; font-weight: 600; padding-left: 20rpx;}
.tnphone-white-min .area-r {right: 0; text-align: center; font-size: 12rpx; line-height: 22rpx; text-indent: 10rpx; font-weight: 600; padding-right: 20rpx;}
.tnphone-white-min .fa-feed {float: left; font-size: 12rpx!important; transform:rotate(-45deg); margin-top: 4rpx; margin-right: 8rpx}
.tnphone-white-min .fa-battery-full {float: left; font-size: 12rpx!important; margin-top: 6rpx}
.tnphone-white-min .fa-chevron-left {float: left; margin-top: 4rpx}
.tnphone-white-min .fa-cog {float: right; margin-top: 4rpx}
.tnphone-white-min .btn01 {width: 3rpx; height: 28rpx; border-radius: 3rpx 0 0 3rpx; background: #222; position: absolute; top: 105rpx; left: -3rpx}
.tnphone-white-min .btn02 {width: 3rpx; height: 54rpx; border-radius: 3rpx 0 0 3rpx; background: #222; position: absolute; top: 160rpx; left: -3rpx}
.tnphone-white-min .btn03 {width: 3rpx; height: 54rpx; border-radius: 3rpx 0 0 3rpx; background: #222; position: absolute; top: 230rpx; left: -3rpx}
.tnphone-white-min .btn04 {width: 3rpx; height: 86rpx; border-radius: 0 3rpx 3rpx 0; background: #222; position: absolute; top: 180rpx; right: -3rpx}
/* 轮播样机样式 start*/
.card-swiper {
height: 830rpx !important;
}
.card-swiper swiper-item {
width: 260rpx !important;
// left: 170rpx;
// width: 380rpx !important;
box-sizing: border-box;
padding: 0rpx 15rpx 90rpx 15rpx;
overflow: initial;
}
.card-swiper swiper-item .swiper-item {
display: block;
transform: scale(0.45);
transition: all 0.2s ease-in 0s;
overflow: hidden;
}
.card-swiper swiper-item.cur .swiper-item {
transform: scale(0.65);
transition: all 0.2s ease-in 0s;
}
.image-banner{
display: flex;
align-items: center;
justify-content: center;
}
.image-banner image{
width: 100%;
height: 770rpx;
// border: 1rpx solid red;
}
/* 轮播指示点 start*/
.indication{
z-index: 9999;
width: 100%;
height: 36rpx;
position: absolute;
display:flex;
flex-direction:row;
align-items:center;
justify-content:center;
}
.spot{
background-color: #000;
opacity: 0;
width: 10rpx;
height: 10rpx;
border-radius: 20rpx;
margin: 0 8rpx !important;
top: -80rpx;
position: relative;
}
.spot.active{
opacity: 0;
width: 30rpx;
background-color: #000;
}
/* 轮播 end */
/* 图标容器4 start */
.tn-cool-color-icon4{
// background-image: -webkit-linear-gradient(135deg, #ED1C24, #FECE12); 16
// background-image: linear-gradient(135deg, #ED1C24, #FECE12);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
text-fill-color: transparent;
}
.icon4 {
&__item {
width: 30%;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 30rpx;
margin: 20rpx 10rpx;
transform: scale(1);
transition: transform 0.3s linear;
transform-origin: center center;
&--icon {
width: 110rpx;
height: 110rpx;
font-size: 55rpx;
border-radius: 50%;
margin-bottom: 18rpx;
position: relative;
z-index: 1;
box-shadow: 0px 10px 30px rgba(70,23,129, 0.12),
0px -8px 40px rgba(255, 255, 255, 1),
inset 0px -10px 10px rgba(70,23,129, 0.05),
inset 0px 10px 20px rgba(255, 255, 255, 1);
}
}
}
/* 标题start */
.nav_title {
-webkit-background-clip: text;
color: transparent;
&--wrap {
position: relative;
display: flex;
height: 120rpx;
font-size: 46rpx;
align-items: center;
justify-content: center;
font-weight: bold;
background-image: url(https://tnuiimage.tnkjapp.com/title_bg/title44.png);
background-size: cover;
}
}
/* 标题end */
/* 组件导航列表 start*/
.nav-list {
display: flex;
flex-wrap: wrap;
padding: 0rpx 12rpx 0rpx;
justify-content: space-between;
/* 列表元素 start */
.nav-list-item {
padding: 35rpx 30rpx 5rpx 30rpx;
border-radius: 12rpx;
width: 45%;
margin: 0 18rpx 40rpx;
background-size: cover;
background-position: center;
position: relative;
z-index: 99;
/* 元素标题 start */
.nav-link {
font-size: 32rpx;
text-transform: capitalize;
padding: 0 0 10rpx 0;
position: relative;
.title {
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
margin-top: 30rpx;
text-align: center;
}
.author {
font-size: 25rpx;
color: #FFFFFF;
margin-top: 50rpx;
margin-left: -10rpx;
text-align: center;
}
}
/* 元素标题 end */
/* 元素图标 start */
.icon {
font-variant: small-caps;
position: absolute;
top: 20rpx;
right: 50rpx;
left: 37%;
width: 90rpx;
height: 90rpx;
line-height: 90rpx;
margin: 0;
padding: 0;
display: inline-flex;
text-align: center;
justify-content: center;
vertical-align: middle;
font-size: 50rpx;
color: #FFFFFF;
white-space: nowrap;
opacity: 0.9;
background-color: rgba(0, 0, 0, 0.05);
background-size: cover;
background-position: 50%;
border-radius: 5000rpx;
}
/* 元素图标 end */
}
/* 列表元素 end */
}
/* 组件导航列表 end*/
/* 胶囊banner*/
.image-capsule{
padding: 100rpx 0rpx;
font-size: 40rpx;
font-weight: 300;
position: relative;
}
.image-piccapsule{
background-size: cover;
background-repeat:no-repeat;
// background-attachment:fixed;
background-position:top;
border-radius: 20rpx 20rpx 0 0;
}
</style>
+193
View File
@@ -0,0 +1,193 @@
/* 顶部 start */
.header {
padding: 80rpx 60rpx 40rpx 60rpx;
.title {
font-size: 36rpx;
color: $tn-font-color;
font-weight: bold;
}
.sub-title {
font-size: 28rpx;
color: $tn-content-color;
padding-top: 18rpx;
}
.tips-title {
font-size: 24rpx;
color: $tn-font-sub-color;
padding-top: 5rpx;
}
}
/* 顶部 end */
/* 展示内容容器 start */
.show-content-container {
/* 标题容器 start */
.title-container {
display: flex;
position: relative;
align-items: center;
justify-content: space-between;
min-height: 100rpx;
// 标题样式
.title {
height: 100%;
max-width: 100%;
margin: 0 20rpx;
font-size: 30rpx;
display: flex;
align-items: center;
justify-content: center;
// 标题前面小点
&:before {
content: " ";
background-color: $tn-main-color;
width: 15rpx;
height: 15rpx;
border-radius: 10rpx;
margin-right: 18rpx;
}
}
}
/* 标题容器 end */
/* 内容 start */
.content {
padding: 20rpx;
}
/* 内容 end */
}
/* 展示内容容器 end */
/* 内容容器 start */
.demo-content-container {
border: 1rpx dashed $tn-main-color;
margin: 20rpx;
margin-top: 0rpx;
position: fixed;
width: 95%;
z-index: 10;
transition: all 0.15s ease-out;
&.top {
width: 100%;
margin: 0;
}
&.no-fixed {
position: relative !important;
}
/* 标题容器 start */
.title-container {
display: flex;
position: relative;
align-items: center;
justify-content: center;
min-height: 100rpx;
// 标题样式
.title {
height: 100%;
max-width: 100%;
margin: 0 30rpx;
font-size: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
/* 标题容器 end */
/* 内容 start */
.content {
padding: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
/* 内容 end */
}
/* 内容容器 end */
/* 可选项内容容器 start */
.demo-section-container {
margin: 20rpx;
height: 100%;
/* 标题容器 start */
.title-container {
display: flex;
position: relative;
align-items: center;
justify-content: center;
min-height: 100rpx;
margin-bottom: 10rpx;
// 标题样式
.title {
height: 100%;
max-width: 100%;
margin: 0 30rpx;
font-size: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
&::after {
content: " ";
box-sizing: border-box;
width: 90%;
height: 100%;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
border-bottom: 1rpx solid $tn-border-solid-color;
}
}
/* 标题容器 end */
/* 参数内容 start*/
.content {
padding: 0 20rpx 10rpx 20rpx;
// 标题样式
.title {
padding-left: 20rpx;
height: 100%;
position: relative;
&::before {
content: " ";
position: absolute;
top: 50%;
left: 0;
width: 4rpx;
height: 90%;
background-color: $tn-main-color;
border-radius: 6rpx;
transform: translateY(-50%);
}
}
// 参数样式
.section {
margin-top: 15rpx;
margin-bottom: 20rpx;
}
}
/* 参数内容 end*/
}
/* 可选项内容容器 end */
@@ -0,0 +1,38 @@
.tn-custom-nav-bar__back {
width: 100%;
height: 100%;
position: relative;
display: flex;
justify-content: space-evenly;
align-items: center;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.15);
border-radius: 1000rpx;
border: 1rpx solid rgba(255, 255, 255, 0.5);
color: #FFFFFF;
font-size: 18px;
.icon {
display: block;
flex: 1;
margin: auto;
text-align: center;
}
&:before {
content: " ";
width: 1rpx;
height: 110%;
position: absolute;
top: 22.5%;
left: 0;
right: 0;
margin: auto;
transform: scale(0.5);
transform-origin: 0 0;
pointer-events: none;
box-sizing: border-box;
opacity: 0.7;
background-color: #FFFFFF;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

+28
View File
@@ -0,0 +1,28 @@
import { mapState } from 'vuex'
import store from '@/store'
// 尝试将用户在根目录中的store/index.js的vuex的state变量加载到全局变量中
let $tStoreKey = []
try {
$tStoreKey = store.state ? Object.keys(store.state) : []
} catch(e) {
}
module.exports = {
beforeCreate() {
// 将vuex方法挂在在$t中
// 使用方法:
// 修改vuex的state中的user.name变量为图鸟小菜 => this.$tn.vuex('user.name', '图鸟小菜')
// 修改vuexde state中的version变量为1.0.1 => this.$tn.vuex('version', 1.0.1)
this.$tn.vuex = (name, value) => {
this.$store.commit('$tStore', {
name, value
})
}
},
computed: {
// 将vuex的state中的变量结构到全局混入mixin中
...mapState($tStoreKey)
}
}

Some files were not shown because too many files have changed in this diff Show More