批量优化
This commit is contained in:
1 parent
e3db229f41
commit
aa92ca40a2
79 files changed
+7495
-1104
No files matched your search
@@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="app-tabbar">
|
||||
<view class="tabbar-inner">
|
||||
<view
|
||||
@@ -10,8 +10,8 @@
|
||||
>
|
||||
<FaIcon
|
||||
:name="tab.icon"
|
||||
:color="current === tab.name ? '#3c9cff' : '#909399'"
|
||||
:size="22"
|
||||
:color="current === tab.name ? '#3973ff' : '#8a94ad'"
|
||||
:size="20"
|
||||
/>
|
||||
<text class="tab-text">{{ tab.text }}</text>
|
||||
</view>
|
||||
@@ -21,44 +21,52 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* 子系统内底部 tabbar。
|
||||
*
|
||||
* 每个子系统(crm / erp / oa / cms / toolbox)都有独立的页面组与独立的 tabbar,
|
||||
* 通过 group(子系统目录名)解析路由;导航页 nav.vue 不使用本组件。
|
||||
*/
|
||||
const props = defineProps({
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
current: {
|
||||
type: String,
|
||||
default: 'dashboard'
|
||||
default: 'home'
|
||||
}
|
||||
})
|
||||
|
||||
const tabs = [
|
||||
{ name: 'dashboard', text: '仪表盘', icon: 'table-cells' },
|
||||
{ name: 'features', text: '功能', icon: 'grip' },
|
||||
{ name: 'profile', text: '我的', icon: 'user' }
|
||||
{ name: 'home', text: '概览', icon: 'gauge' },
|
||||
{ name: 'functions', text: '功能', icon: 'table-cells' },
|
||||
{ name: 'todo', text: '待办', icon: 'circle-check' },
|
||||
{ name: 'mine', text: '我的', icon: 'user' }
|
||||
]
|
||||
|
||||
const routes = {
|
||||
dashboard: '/pages/dashboard/dashboard',
|
||||
features: '/pages/features/features',
|
||||
profile: '/pages/profile/profile'
|
||||
}
|
||||
|
||||
function onChange(name) {
|
||||
if (name === props.current) return
|
||||
uni.redirectTo({ url: routes[name] })
|
||||
// 子系统内部页面与 tab 一一对应,用 redirectTo 避免页面栈堆积
|
||||
uni.redirectTo({ url: `/pages/${props.group}/${name}/${name}` })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/src/styles/theme.scss';
|
||||
|
||||
.app-tabbar {
|
||||
flex-shrink: 0;
|
||||
background: #ffffff;
|
||||
border-top: 1rpx solid #ebeef5;
|
||||
box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04);
|
||||
background: $color-card;
|
||||
border-top: 1rpx solid $color-border;
|
||||
box-shadow: $shadow-header;
|
||||
}
|
||||
|
||||
.tabbar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
padding: 12rpx 0 8rpx;
|
||||
padding: 10rpx 0 6rpx;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
@@ -70,14 +78,14 @@ function onChange(name) {
|
||||
padding: 8rpx 0;
|
||||
|
||||
&.active .tab-text {
|
||||
color: #3c9cff;
|
||||
font-weight: 500;
|
||||
color: $color-primary;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 22rpx;
|
||||
color: #909399;
|
||||
color: $color-text-muted;
|
||||
}
|
||||
|
||||
.safe-area {
|
||||
|
||||
Reference in new issue
Block a user