This commit is contained in:
hero920103 committed 2026-11-11 18:42:09 +08:00
1 parent fb04d66e61
commit b6b528490c
13 files changed
+518 -168

No files matched your search

+18 -5
View File
@@ -2,7 +2,7 @@
<view class="app-tabbar">
<view class="tabbar-inner">
<view
v-for="tab in tabs"
v-for="tab in list"
:key="tab.name"
class="tab-item"
:class="{ active: current === tab.name }"
@@ -21,23 +21,32 @@
</template>
<script setup>
import { computed } from 'vue'
/**
* 主 tabbar —— 工作台 / 应用 / 我的。
* 仅这三个页面使用;子系统内部页面请用 AppTabbar(带 group 参数)。
* 主 tabbar —— 默认「工作台 / 应用 / 我的」。
* 传入 tabs 时按自定义页签渲染(个人中心用「我的 / 回平台」两项);
* name=platform 为特殊动作:清空页面栈回到平台模块选择页。
*/
const props = defineProps({
current: {
type: String,
default: 'dashboard'
},
tabs: {
type: Array,
default: null
}
})
const tabs = [
const DEFAULT_TABS = [
{ name: 'dashboard', text: '工作台', icon: 'grip' },
{ name: 'features', text: '应用', icon: 'th-large' },
{ name: 'profile', text: '我的', icon: 'user' }
]
const list = computed(() => (props.tabs && props.tabs.length ? props.tabs : DEFAULT_TABS))
const routes = {
dashboard: '/pages/dashboard/dashboard',
features: '/pages/features/features',
@@ -45,7 +54,11 @@ const routes = {
}
function onChange(name) {
if (name === props.current) return
if (name === 'platform') {
uni.reLaunch({ url: '/pages/nav/nav' })
return
}
if (name === props.current || !routes[name]) return
uni.redirectTo({ url: routes[name] })
}
</script>
+2 -16
View File
@@ -1,10 +1,6 @@
<template>
<view class="page" :class="{ embedded }">
<view v-if="!embedded" class="head" :style="headPad">
<view class="head-row" @tap="goBackNav">
<FaIcon name="chevron-left" color="#1f2b48" :size="18" />
<text class="head-back">返回导航</text>
</view>
<text class="head-title">{{ sub.title }}</text>
</view>
@@ -204,20 +200,10 @@ onShow(() => {
box-shadow: $shadow-header;
}
.head-row {
display: flex;
align-items: center;
gap: 4rpx;
}
.head-back {
font-size: 24rpx;
color: $color-text-muted;
}
.head-title {
display: block;
margin-top: 14rpx;
/* 取消顶部返回按钮后,保留头部避让高度 */
margin-top: 32rpx;
font-size: 36rpx;
font-weight: 600;
color: $color-text;
+2 -17
View File
@@ -2,10 +2,6 @@
<view class="page" :class="{ embedded }">
<!-- 顶部标识条(独立页模式使用;嵌入 tabs.vue 时由父页提供) -->
<view v-if="!embedded" class="hero" :class="sub.tint" :style="headPad">
<view class="hero-row" @tap="goBackNav">
<FaIcon name="chevron-left" color="#ffffff" :size="18" />
<text class="hero-back">返回导航</text>
</view>
<view class="hero-main">
<view class="hero-icon">
<FaIcon :name="sub.icon" color="#ffffff" :size="26" />
@@ -446,23 +442,12 @@ onShow(() => {
color: #ffffff;
}
.hero-row {
display: flex;
align-items: center;
gap: 4rpx;
opacity: 0.85;
}
.hero-back {
font-size: 24rpx;
color: #ffffff;
}
.hero-main {
display: flex;
align-items: center;
gap: 20rpx;
margin-top: 24rpx;
/* 取消顶部返回按钮后,补偿其占位,保证与状态栏/胶囊的间距 */
margin-top: 40rpx;
}
.hero-icon {
+2 -17
View File
@@ -2,10 +2,6 @@
<view class="page" :class="{ embedded }">
<!-- 独立页模式:渐变用户头部(嵌入 tabs.vue 时由父页提供顶部条) -->
<view v-if="!embedded" class="head" :style="headPad">
<view class="head-row" @tap="goBackNav">
<FaIcon name="chevron-left" color="#ffffff" :size="18" />
<text class="head-back">返回导航</text>
</view>
<view class="user">
<view class="avatar">
<text class="avatar-text">{{ avatarText }}</text>
@@ -242,23 +238,12 @@ onShow(() => {
background: $hero-gradient;
}
.head-row {
display: flex;
align-items: center;
gap: 4rpx;
opacity: 0.85;
}
.head-back {
font-size: 24rpx;
color: #ffffff;
}
.user {
display: flex;
align-items: center;
gap: 20rpx;
margin-top: 26rpx;
/* 取消顶部返回按钮后,补偿其占位 */
margin-top: 42rpx;
}
.avatar {
+2 -16
View File
@@ -1,10 +1,6 @@
<template>
<view class="page" :class="{ embedded }">
<view v-if="!embedded" class="head" :style="headPad">
<view class="head-row" @tap="goBackNav">
<FaIcon name="chevron-left" color="#1f2b48" :size="18" />
<text class="head-back">返回导航</text>
</view>
<text class="head-title">{{ sub.title }} · 待办</text>
<view class="kpi">
<view class="kpi-item">
@@ -149,20 +145,10 @@ onShow(() => {
box-shadow: $shadow-header;
}
.head-row {
display: flex;
align-items: center;
gap: 4rpx;
}
.head-back {
font-size: 24rpx;
color: $color-text-muted;
}
.head-title {
display: block;
margin-top: 14rpx;
/* 取消顶部返回按钮后,保留头部避让高度 */
margin-top: 32rpx;
font-size: 36rpx;
font-weight: 600;
color: $color-text;