feat: 去掉导航栏、首页轮播全屏占屏1/3、场馆切换移至公告活动下方
- pages.json 全局设置 navigationStyle: custom 移除原生导航栏 - App.vue 全局 page 添加状态栏安全区 padding-top - 综合场馆/冰场馆首页轮播图改为全屏模式(无圆角无边距、去除标题) - 轮播图高度改为 33.33vh 占屏幕三分之一 - VenueSwitchHeader 从轮播图上方移至公告活动板块下方 - 合并 tabBar 页面路由、清理废弃组件 VenueTabBar
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
<view v-if="isLoading" class="load-more-tip">加载中...</view>
|
||||
</view>
|
||||
</block>
|
||||
<VenueTabBar venue="comprehensive" active="bookings" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -47,7 +46,6 @@ import { ticketApi } from '@/modules/comprehensive/api/ticket'
|
||||
import { membershipApi } from '@/modules/comprehensive/api/membership'
|
||||
import { useComprehensiveSessionStore } from '@/modules/comprehensive/stores/session'
|
||||
import { formatDateTime, formatTimeRange } from '@/modules/comprehensive/utils/date'
|
||||
import VenueTabBar from '@/components/VenueTabBar.vue'
|
||||
import UnauthLoginPanel from '@/components/UnauthLoginPanel.vue'
|
||||
|
||||
const session = useComprehensiveSessionStore()
|
||||
@@ -124,6 +122,8 @@ const loadItems = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ refresh: loadItems })
|
||||
|
||||
const getItemTitle = (item) => {
|
||||
if (businessType.value === 'course') return item.session?.title || '课程预约'
|
||||
if (businessType.value === 'private') return item.courts?.map((court) => court.name).join('、') || '包场预约'
|
||||
|
||||
@@ -41,17 +41,14 @@
|
||||
<view v-else-if="sessions.length === 0" class="empty-state">当前筛选条件下暂无课程</view>
|
||||
<view v-else-if="!hasMore" class="load-more-tip">已加载全部</view>
|
||||
</view>
|
||||
<VenueTabBar venue="comprehensive" active="courses" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { courseApi } from '@/modules/comprehensive/api/course'
|
||||
import { venueApi } from '@/modules/comprehensive/api/venue'
|
||||
import { formatTimeRange, todayString } from '@/modules/comprehensive/utils/date'
|
||||
import VenueTabBar from '@/components/VenueTabBar.vue'
|
||||
|
||||
const selectedDate = ref(todayString())
|
||||
const selectedCoachIndex = ref(0)
|
||||
@@ -83,16 +80,6 @@ onMounted(async () => {
|
||||
loadSessions(true)
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
loadSessions(true).finally(() => uni.stopPullDownRefresh())
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
if (!hasMore.value || isLoadingMore.value) return
|
||||
page.value += 1
|
||||
loadSessions(false)
|
||||
})
|
||||
|
||||
const loadSessions = async (reset) => {
|
||||
if (reset) {
|
||||
page.value = 1
|
||||
@@ -134,6 +121,19 @@ const onCourtTypeChange = (e) => {
|
||||
const goDetail = (id) => {
|
||||
uni.navigateTo({ url: `/pages/comprehensive/courses/detail?id=${id}` })
|
||||
}
|
||||
|
||||
const refresh = async () => {
|
||||
page.value = 1
|
||||
await loadSessions(true)
|
||||
}
|
||||
|
||||
const loadMore = () => {
|
||||
if (!hasMore.value || isLoadingMore.value) return
|
||||
page.value += 1
|
||||
loadSessions(false)
|
||||
}
|
||||
|
||||
defineExpose({ refresh, loadMore })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import { membershipApi } from '@/modules/comprehensive/api/membership'
|
||||
import { storedValueApi } from '@/modules/comprehensive/api/storedValue'
|
||||
import { useComprehensiveSessionStore } from '@/modules/comprehensive/stores/session'
|
||||
@@ -76,10 +75,6 @@ onMounted(async () => {
|
||||
await loadPage()
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
loadPage().finally(() => uni.stopPullDownRefresh())
|
||||
})
|
||||
|
||||
const loadPage = async () => {
|
||||
isLoading.value = true
|
||||
try {
|
||||
@@ -128,6 +123,8 @@ const buyCard = async (card) => {
|
||||
submittingId.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ refresh: loadPage })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="private-page page-bottom-safe">
|
||||
<view class="private-page">
|
||||
<view class="top-panel">
|
||||
<view class="type-tabs">
|
||||
<view
|
||||
@@ -475,4 +475,5 @@ const goConfirm = () => {
|
||||
.submit-btn {
|
||||
width: 260rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
</view>
|
||||
</block>
|
||||
<AgreementLinks v-if="session.isLoggedIn" class="profile-agreement-links" compact />
|
||||
<VenueTabBar venue="comprehensive" active="profile" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -76,7 +75,6 @@ import { computed, onMounted, ref } from 'vue'
|
||||
import { useComprehensiveSessionStore } from '@/modules/comprehensive/stores/session'
|
||||
import { memberApi } from '@/modules/comprehensive/api/member'
|
||||
import { formatAmount } from '@/modules/comprehensive/utils/money'
|
||||
import VenueTabBar from '@/components/VenueTabBar.vue'
|
||||
import AgreementLinks from '@/components/AgreementLinks.vue'
|
||||
import UnauthLoginPanel from '@/components/UnauthLoginPanel.vue'
|
||||
|
||||
@@ -86,14 +84,12 @@ const balance = ref('0.00')
|
||||
const balanceText = computed(() => formatAmount(balance.value))
|
||||
|
||||
const menuItems = [
|
||||
{ title: '包场预约', url: '/pages/comprehensive/private/index', theme: 'private-theme', icon: 'private' },
|
||||
{ title: '篮球门票', url: '/pages/comprehensive/tickets/index', theme: 'ticket-theme', icon: 'ticket' },
|
||||
{ title: '商城', url: '/pages/comprehensive/mall/index', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '充值', url: '/pages/comprehensive/mall/index', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '我的次卡', url: '/pages/comprehensive/membership/cards', theme: 'profile-theme', icon: 'profile' },
|
||||
{ title: '我的订单', url: '/pages/comprehensive/profile/orders', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '我的预约', url: '/pages/comprehensive/bookings/index', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '余额流水', url: '/pages/comprehensive/profile/balance', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '消费记录', url: '/pages/comprehensive/profile/orders', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '个人信息', url: '/pages/comprehensive/profile/detail', theme: 'profile-theme', icon: 'profile' },
|
||||
{ title: '切换场馆', url: '/pages/venue-select/index?mode=switch', theme: 'profile-theme', icon: 'profile' }
|
||||
]
|
||||
@@ -120,6 +116,8 @@ const logout = () => {
|
||||
const go = (url) => {
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
|
||||
defineExpose({ onPageShow: () => {} })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user