2026-09-10 10:57:40 +08:00
|
|
|
<template>
|
2026-09-18 12:59:43 +08:00
|
|
|
<view class="bottom-nav" :style="bottomStyle(14)">
|
2026-09-20 10:52:10 +08:00
|
|
|
<view class="nav-item" @click="go('/pages/home/home')"><view :class="active == 'home' ? 'nav-icon active-icon' : 'nav-icon'"><image class="nav-image" :class="active != 'home' ? 'muted-icon' : ''" src="/static/mobile/navigation/home.png" mode="aspectFit" /></view><text :class="active == 'home' ? 'nav-label active-label' : 'nav-label'">首页</text></view>
|
|
|
|
|
<view class="nav-item" @click="go('/packages/content/news/news')"><view :class="active == 'news' ? 'nav-icon active-icon' : 'nav-icon'"><image class="nav-image" :class="active != 'news' ? 'muted-icon' : ''" src="/static/mobile/navigation/file-text.png" mode="aspectFit" /></view><text :class="active == 'news' ? 'nav-label active-label' : 'nav-label'">新闻</text></view>
|
|
|
|
|
<view class="nav-item" @click="go('/packages/account/messages/messages')"><view :class="active == 'message' ? 'nav-icon active-icon' : 'nav-icon'"><image class="nav-image" :class="active != 'message' ? 'muted-icon' : ''" src="/static/mobile/navigation/message.png" mode="aspectFit" /></view><text :class="active == 'message' ? 'nav-label active-label' : 'nav-label'">消息</text></view>
|
|
|
|
|
<view class="nav-item" @click="go('/packages/account/profile/profile')"><view :class="active == 'profile' ? 'nav-icon active-icon' : 'nav-icon'"><image class="nav-image" :class="active != 'profile' ? 'muted-icon' : ''" src="/static/mobile/navigation/user.png" mode="aspectFit" /></view><text :class="active == 'profile' ? 'nav-label active-label' : 'nav-label'">我的</text></view>
|
2026-09-10 10:57:40 +08:00
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="uts">
|
2026-09-18 12:59:43 +08:00
|
|
|
import { usePageLayout } from '@/services/layout.uts'
|
|
|
|
|
const { bottomStyle } = usePageLayout()
|
2026-09-10 10:57:40 +08:00
|
|
|
defineProps({ active: { type: String, default: 'home' } })
|
2026-09-18 12:59:43 +08:00
|
|
|
const go = (url: string) => {
|
|
|
|
|
const pages = getCurrentPages()
|
|
|
|
|
if (pages.length > 0 && '/' + pages[pages.length - 1].route == url) return
|
|
|
|
|
uni.reLaunch({ url: url })
|
|
|
|
|
}
|
2026-09-10 10:57:40 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
2026-09-18 12:59:43 +08:00
|
|
|
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; min-height: 130rpx; background-color: #ffffff; border-top: 1rpx solid #e7edf6; flex-direction: row; box-shadow: 0 -6rpx 18rpx rgba(18, 38, 75, 0.04); }
|
2026-09-10 10:57:40 +08:00
|
|
|
.nav-item { flex: 1; height: 116rpx; align-items: center; justify-content: center; }
|
2026-09-18 12:59:43 +08:00
|
|
|
.nav-icon { width: 64rpx; height: 60rpx; border-radius: 18rpx; align-items: center; justify-content: center; }
|
2026-09-20 10:52:10 +08:00
|
|
|
/* 专用位图已统一图案边界,不再叠加 AppIcon 的整体缩放。 */
|
|
|
|
|
.nav-image { width: 58rpx; height: 58rpx; flex-shrink: 0; }
|
|
|
|
|
.muted-icon { opacity: .70; }
|
2026-09-18 12:59:43 +08:00
|
|
|
.active-icon { background-color: #edf5ff; }
|
2026-09-20 10:52:10 +08:00
|
|
|
.nav-label { margin-top: 7rpx; height: 34rpx; line-height: 34rpx; font-size: 24rpx; color: #64748b; text-align: center; }
|
2026-09-10 10:57:40 +08:00
|
|
|
.active-label { color: #0868f7; font-weight: 700; }
|
|
|
|
|
</style>
|