feat: 去掉导航栏、首页轮播全屏占屏1/3、场馆切换移至公告活动下方

- pages.json 全局设置 navigationStyle: custom 移除原生导航栏
- App.vue 全局 page 添加状态栏安全区 padding-top
- 综合场馆/冰场馆首页轮播图改为全屏模式(无圆角无边距、去除标题)
- 轮播图高度改为 33.33vh 占屏幕三分之一
- VenueSwitchHeader 从轮播图上方移至公告活动板块下方
- 合并 tabBar 页面路由、清理废弃组件 VenueTabBar
This commit is contained in:
gqt
2026-07-13 19:27:49 +08:00
parent 9b38518426
commit 5c97e8b1f8
30 changed files with 506 additions and 453 deletions
@@ -1,7 +1,5 @@
<template>
<view class="home-container">
<VenueSwitchHeader venue-name="综合场馆" />
<view class="banner-wrapper">
<swiper
v-if="banners.length"
@@ -11,46 +9,44 @@
interval="4000"
duration="600"
indicator-dots
indicator-color="rgba(15, 23, 42, 0.1)"
indicator-active-color="#0F172A"
indicator-color="rgba(255, 255, 255, 0.4)"
indicator-active-color="#FFFFFF"
>
<swiper-item v-for="banner in banners" :key="banner.id">
<view class="banner-item">
<image :src="banner.image" mode="aspectFill" class="banner-img" />
<view class="banner-overlay">
<text class="banner-title">{{ banner.title }}</text>
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="section-container last-section">
<view class="section-header">
<text class="section-title">公告活动</text>
</view>
<view class="content-wrapper">
<view class="section-container">
<view class="section-header">
<text class="section-title">公告活动</text>
</view>
<view v-if="articles.length" class="activity-grid">
<view v-for="article in articles" :key="article.id" class="activity-card" @tap="go(`/pages/comprehensive/activities/detail?id=${article.id}`)">
<image :src="article.cover_image" mode="aspectFill" class="activity-cover" />
<view class="activity-info">
<text class="activity-title">{{ article.title }}</text>
<text class="activity-date">{{ formatDate(article.published_at || article.created_at) }}</text>
<view v-if="articles.length" class="activity-grid">
<view v-for="article in articles" :key="article.id" class="activity-card" @tap="go(`/pages/comprehensive/activities/detail?id=${article.id}`)">
<image :src="article.cover_image" mode="aspectFill" class="activity-cover" />
<view class="activity-info">
<text class="activity-title">{{ article.title }}</text>
<text class="activity-date">{{ formatDate(article.published_at || article.created_at) }}</text>
</view>
</view>
</view>
<view v-else class="empty-placeholder">暂无公告活动</view>
</view>
<view v-else class="empty-placeholder">暂无公告活动</view>
<VenueSwitchHeader venue-name="综合场馆" />
</view>
<VenueTabBar venue="comprehensive" active="home" />
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { onPullDownRefresh } from '@dcloudio/uni-app'
import { contentApi } from '@/modules/comprehensive/api/content'
import { formatDate } from '@/modules/comprehensive/utils/date'
import VenueTabBar from '@/components/VenueTabBar.vue'
import VenueSwitchHeader from '@/components/VenueSwitchHeader.vue'
const banners = ref([])
@@ -60,10 +56,6 @@ onMounted(() => {
loadPage()
})
onPullDownRefresh(() => {
loadPage().finally(() => uni.stopPullDownRefresh())
})
const loadPage = async () => {
const home = await contentApi.getHomeContent({ banner_limit: 5, article_limit: 3 })
banners.value = home.banners || []
@@ -73,23 +65,24 @@ const loadPage = async () => {
const go = (url) => {
uni.navigateTo({ url })
}
defineExpose({ refresh: loadPage })
</script>
<style lang="scss" scoped>
.home-container {
min-height: 100vh;
padding: $spacing-lg $spacing-md;
background-color: $bg-color-soft;
margin-top: calc(-1 * var(--status-bar-height, 0px));
}
.banner-wrapper {
margin-bottom: $spacing-lg;
width: 100%;
}
.banner-swiper {
height: 320rpx;
border-radius: $border-radius-base;
overflow: hidden;
width: 100%;
height: 33.33vh;
}
.banner-item {
@@ -104,30 +97,12 @@ const go = (url) => {
background-color: $bg-color-hover;
}
.banner-overlay {
position: absolute;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: flex-end;
padding: $spacing-md;
background: linear-gradient(to top, rgba(15, 23, 42, 0.6), transparent);
}
.banner-title {
color: #FFFFFF;
font-size: 24rpx;
font-weight: 400;
line-height: 1.4;
.content-wrapper {
padding: $spacing-lg $spacing-md;
}
.section-container {
margin-bottom: $spacing-xl;
}
.section-container.last-section {
margin-bottom: 0;
margin-bottom: $spacing-lg;
}
.section-header {