feat: 去掉导航栏、首页轮播全屏占屏1/3、场馆切换移至公告活动下方
- pages.json 全局设置 navigationStyle: custom 移除原生导航栏 - App.vue 全局 page 添加状态栏安全区 padding-top - 综合场馆/冰场馆首页轮播图改为全屏模式(无圆角无边距、去除标题) - 轮播图高度改为 33.33vh 占屏幕三分之一 - VenueSwitchHeader 从轮播图上方移至公告活动板块下方 - 合并 tabBar 页面路由、清理废弃组件 VenueTabBar
@@ -21,6 +21,7 @@ page {
|
||||
line-height: 1.5;
|
||||
box-sizing: border-box;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
padding-top: var(--status-bar-height, 0px);
|
||||
}
|
||||
|
||||
view,
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
<template>
|
||||
<view class="venue-tabbar-wrap">
|
||||
<view class="venue-tabbar-spacer" />
|
||||
<view class="venue-tabbar">
|
||||
<view
|
||||
v-for="item in items"
|
||||
:key="item.key"
|
||||
class="venue-tabbar__item"
|
||||
:class="{ active: item.key === active }"
|
||||
@tap="go(item)"
|
||||
>
|
||||
<image
|
||||
class="venue-tabbar__icon"
|
||||
:src="item.key === active ? item.activeIcon : item.icon"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text class="venue-tabbar__label">{{ item.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { setStoredVenue } from '@/utils/venue'
|
||||
|
||||
const props = defineProps({
|
||||
venue: {
|
||||
type: String,
|
||||
required: true,
|
||||
validator: (value) => ['ice', 'comprehensive'].includes(value)
|
||||
},
|
||||
active: {
|
||||
type: String,
|
||||
required: true,
|
||||
validator: (value) => ['home', 'courses', 'bookings', 'profile'].includes(value)
|
||||
}
|
||||
})
|
||||
|
||||
const tabDefinitions = [
|
||||
{ key: 'home', label: '首页', icon: 'home', path: 'home' },
|
||||
{ key: 'courses', label: '课程', icon: 'course', path: 'courses' },
|
||||
{ key: 'bookings', label: '预约', icon: 'booking', path: 'bookings' },
|
||||
{ key: 'profile', label: '我的', icon: 'mine', path: 'profile' }
|
||||
]
|
||||
|
||||
const items = computed(() => {
|
||||
return tabDefinitions.map((item) => ({
|
||||
...item,
|
||||
icon: `/static/${props.venue}/tab/${item.icon}.png`,
|
||||
activeIcon: `/static/${props.venue}/tab/${item.icon}-active.png`,
|
||||
url: `/pages/${props.venue}/${item.path}/index`
|
||||
}))
|
||||
})
|
||||
|
||||
const go = (item) => {
|
||||
setStoredVenue(props.venue)
|
||||
if (item.key === props.active) return
|
||||
|
||||
uni.reLaunch({ url: item.url })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.venue-tabbar-spacer {
|
||||
height: calc(124rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.venue-tabbar {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
padding: 10rpx 0 calc(10rpx + env(safe-area-inset-bottom));
|
||||
border-top: 1rpx solid $border-color;
|
||||
background: rgba(255, 255, 255, 0.98);
|
||||
box-shadow: 0 -8rpx 24rpx rgba(15, 23, 42, 0.06);
|
||||
}
|
||||
|
||||
.venue-tabbar__item {
|
||||
min-width: 0;
|
||||
height: 104rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6rpx;
|
||||
color: $text-color-light;
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.venue-tabbar__item.active {
|
||||
color: $text-color-main;
|
||||
}
|
||||
|
||||
.venue-tabbar__icon {
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
}
|
||||
|
||||
.venue-tabbar__label {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
@@ -17,24 +17,54 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/comprehensive/home/index",
|
||||
"path": "pages/home/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/private/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订场"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mall/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商城",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/courses/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "约课",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/profile/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/comprehensive/home/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/comprehensive/courses/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "课程",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "约课"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/comprehensive/bookings/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的预约",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "我的预约"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -71,7 +101,7 @@
|
||||
{
|
||||
"path": "pages/comprehensive/private/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "包场预约"
|
||||
"navigationBarTitleText": "订场"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -175,15 +205,25 @@
|
||||
{
|
||||
"path": "pages/ice/home/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "首页"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/ice/private/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订场"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/ice/mall/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商城"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/ice/courses/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "近期课程",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "近期课程"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -238,7 +278,46 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#6D7C84",
|
||||
"selectedColor": "#0B8FB3",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"borderStyle": "white",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/home/index",
|
||||
"text": "首页",
|
||||
"iconPath": "static/comprehensive/tab/home.png",
|
||||
"selectedIconPath": "static/comprehensive/tab/home-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/private/index",
|
||||
"text": "订场",
|
||||
"iconPath": "static/comprehensive/tab/private.png",
|
||||
"selectedIconPath": "static/comprehensive/tab/private-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mall/index",
|
||||
"text": "商城",
|
||||
"iconPath": "static/comprehensive/tab/mall.png",
|
||||
"selectedIconPath": "static/comprehensive/tab/mall-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/courses/index",
|
||||
"text": "约课",
|
||||
"iconPath": "static/comprehensive/tab/course.png",
|
||||
"selectedIconPath": "static/comprehensive/tab/course-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/profile/index",
|
||||
"text": "我的",
|
||||
"iconPath": "static/comprehensive/tab/mine.png",
|
||||
"selectedIconPath": "static/comprehensive/tab/mine-active.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"globalStyle": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"backgroundColor": "#F8FAFC",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<view class="tab-page">
|
||||
<ComprehensiveCourses v-if="isComprehensive" ref="contentRef" />
|
||||
<IceCourses v-else ref="contentRef" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { getStoredVenue } from '@/utils/venue'
|
||||
import ComprehensiveCourses from '@/pages/comprehensive/courses/index.vue'
|
||||
import IceCourses from '@/pages/ice/courses/index.vue'
|
||||
|
||||
const isComprehensive = getStoredVenue() === 'comprehensive'
|
||||
const contentRef = ref()
|
||||
|
||||
onPullDownRefresh(async () => {
|
||||
await contentRef.value?.refresh?.()
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
contentRef.value?.loadMore?.()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tab-page {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<view class="tab-page">
|
||||
<ComprehensiveHome v-if="isComprehensive" ref="contentRef" />
|
||||
<IceHome v-else ref="contentRef" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import { getStoredVenue } from '@/utils/venue'
|
||||
import ComprehensiveHome from '@/pages/comprehensive/home/index.vue'
|
||||
import IceHome from '@/pages/ice/home/index.vue'
|
||||
|
||||
const venue = getStoredVenue()
|
||||
const isComprehensive = venue === 'comprehensive'
|
||||
const contentRef = ref()
|
||||
|
||||
onPullDownRefresh(async () => {
|
||||
await contentRef.value?.refresh?.()
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tab-page {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
@@ -107,7 +107,6 @@
|
||||
/>
|
||||
</view>
|
||||
</block>
|
||||
<VenueTabBar venue="ice" active="bookings" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -117,7 +116,6 @@ import { onPullDownRefresh, onReachBottom, onShow } from '@dcloudio/uni-app'
|
||||
import { bookingApi } from '@/modules/ice/api/booking'
|
||||
import { authStorage } from '@/modules/ice/api/member'
|
||||
import { errorMessage, getMemberSession, loginAndStoreToken, sessionStatusFromError, SESSION_STATUS } from '@/modules/ice/api/session'
|
||||
import VenueTabBar from '@/components/VenueTabBar.vue'
|
||||
import StatePanel from '@/components/ice/StatePanel.vue'
|
||||
import UnauthLoginPanel from '@/components/UnauthLoginPanel.vue'
|
||||
|
||||
@@ -297,7 +295,7 @@ const applySessionError = (err) => {
|
||||
}
|
||||
|
||||
const goProfile = () => {
|
||||
uni.reLaunch({ url: '/pages/ice/profile/index' })
|
||||
uni.switchTab({ url: '/pages/profile/index' })
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -90,16 +90,13 @@
|
||||
compact
|
||||
/>
|
||||
</view>
|
||||
<VenueTabBar venue="ice" active="courses" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { courseApi } from '@/modules/ice/api/course'
|
||||
import { errorMessage } from '@/modules/ice/api/session'
|
||||
import VenueTabBar from '@/components/VenueTabBar.vue'
|
||||
import StatePanel from '@/components/ice/StatePanel.vue'
|
||||
|
||||
const selectedDate = ref('')
|
||||
@@ -138,20 +135,6 @@ onMounted(() => {
|
||||
loadInitialData()
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
page.value = 1
|
||||
loadCourses().finally(() => {
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
if (hasMore.value && !isLoadingMore.value) {
|
||||
page.value++
|
||||
loadMoreCourses()
|
||||
}
|
||||
})
|
||||
|
||||
const loadInitialData = async () => {
|
||||
await Promise.all([loadCoaches(), loadCourses()])
|
||||
}
|
||||
@@ -242,6 +225,20 @@ const formatTimeRange = (startStr, endStr) => {
|
||||
const endHhMm = `${pad(end.getHours())}:${pad(end.getMinutes())}`
|
||||
return `${mm}-${dd} ${startHhMm} - ${endHhMm}`
|
||||
}
|
||||
|
||||
const refresh = async () => {
|
||||
page.value = 1
|
||||
await loadCourses()
|
||||
}
|
||||
|
||||
const loadMore = () => {
|
||||
if (hasMore.value && !isLoadingMore.value) {
|
||||
page.value++
|
||||
loadMoreCourses()
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ refresh, loadMore })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -10,63 +10,60 @@
|
||||
/>
|
||||
|
||||
<block v-else>
|
||||
<VenueSwitchHeader venue-name="冰场馆" />
|
||||
|
||||
<!-- 极简无感大图轮播 -->
|
||||
<!-- 全屏轮播 -->
|
||||
<view class="banner-wrapper">
|
||||
<swiper
|
||||
class="banner-swiper"
|
||||
circular
|
||||
autoplay
|
||||
interval="4000"
|
||||
<swiper
|
||||
class="banner-swiper"
|
||||
circular
|
||||
autoplay
|
||||
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, index) in banners" :key="index" @tap="onTapBanner(banner)">
|
||||
<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 class="activity-grid">
|
||||
<view
|
||||
v-for="activity in activities"
|
||||
:key="activity.id"
|
||||
class="activity-card"
|
||||
@tap="navigateToDetail('/pages/ice/activities/detail?id=' + activity.id)"
|
||||
>
|
||||
<image :src="activity.cover" mode="aspectFill" class="activity-cover" />
|
||||
<view class="activity-info">
|
||||
<text class="activity-title">{{ activity.title }}</text>
|
||||
<text class="activity-date">{{ formatDate(activity.created_at) }}</text>
|
||||
<view class="activity-grid">
|
||||
<view
|
||||
v-for="activity in activities"
|
||||
:key="activity.id"
|
||||
class="activity-card"
|
||||
@tap="navigateToDetail('/pages/ice/activities/detail?id=' + activity.id)"
|
||||
>
|
||||
<image :src="activity.cover" mode="aspectFill" class="activity-cover" />
|
||||
<view class="activity-info">
|
||||
<text class="activity-title">{{ activity.title }}</text>
|
||||
<text class="activity-date">{{ formatDate(activity.created_at) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<VenueSwitchHeader venue-name="冰场馆" />
|
||||
</view>
|
||||
</block>
|
||||
<VenueTabBar venue="ice" active="home" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import { homeApi } from '@/modules/ice/api/home'
|
||||
import { errorMessage } from '@/modules/ice/api/session'
|
||||
import VenueTabBar from '@/components/VenueTabBar.vue'
|
||||
import VenueSwitchHeader from '@/components/VenueSwitchHeader.vue'
|
||||
import StatePanel from '@/components/ice/StatePanel.vue'
|
||||
|
||||
@@ -83,12 +80,6 @@ onMounted(() => {
|
||||
loadHome()
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
loadHome().finally(() => {
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
})
|
||||
|
||||
const loadHome = async () => {
|
||||
try {
|
||||
const data = await homeApi.getHome({
|
||||
@@ -120,56 +111,24 @@ const formatDate = (dateStr) => {
|
||||
const date = new Date(dateStr)
|
||||
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
|
||||
}
|
||||
|
||||
defineExpose({ refresh: loadHome })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.home-container {
|
||||
padding: $spacing-lg $spacing-md;
|
||||
background-color: $bg-color-soft;
|
||||
min-height: 100vh;
|
||||
margin-top: calc(-1 * var(--status-bar-height, 0px));
|
||||
}
|
||||
|
||||
/* 顶部场馆标题 */
|
||||
.header-section {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
margin-bottom: $spacing-lg;
|
||||
padding: 0 4rpx;
|
||||
|
||||
.venue-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.venue-title {
|
||||
font-size: 38rpx;
|
||||
font-weight: 700;
|
||||
color: $text-color-main;
|
||||
letter-spacing: -0.5rpx;
|
||||
}
|
||||
|
||||
.venue-status-tag {
|
||||
font-size: 20rpx;
|
||||
color: $color-success;
|
||||
font-weight: 500;
|
||||
margin-top: $spacing-xs;
|
||||
}
|
||||
|
||||
.today-date {
|
||||
font-size: 24rpx;
|
||||
color: $text-color-muted;
|
||||
}
|
||||
}
|
||||
|
||||
/* 无圆角,极简轮播 */
|
||||
/* 全屏轮播 */
|
||||
.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 {
|
||||
@@ -183,99 +142,16 @@ const formatDate = (dateStr) => {
|
||||
height: 100%;
|
||||
background-color: $bg-color-hover;
|
||||
}
|
||||
|
||||
.banner-overlay {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: linear-gradient(to top, rgba(15, 23, 42, 0.6), transparent);
|
||||
padding: $spacing-md;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.banner-title {
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
/* 核心快捷卡片入口 */
|
||||
.quick-entry-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $spacing-md;
|
||||
margin-bottom: $spacing-xl;
|
||||
}
|
||||
|
||||
.entry-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $bg-color-main;
|
||||
border: 1rpx solid rgba(226, 232, 240, 0.8);
|
||||
border-radius: $border-radius-base;
|
||||
padding: $spacing-md $spacing-lg;
|
||||
position: relative;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:active {
|
||||
background-color: $bg-color-hover;
|
||||
}
|
||||
|
||||
&.primary-entry {
|
||||
border-color: rgba(14, 165, 233, 0.15);
|
||||
background: linear-gradient(135deg, $bg-color-main 0%, #F0F9FF 100%);
|
||||
|
||||
.entry-num {
|
||||
color: $color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.entry-icon-wrap {
|
||||
margin-right: $spacing-lg;
|
||||
}
|
||||
|
||||
.entry-num {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: $text-color-light;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.entry-text-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.entry-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: $text-color-main;
|
||||
}
|
||||
|
||||
.entry-desc {
|
||||
font-size: 22rpx;
|
||||
color: $text-color-muted;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.entry-arrow {
|
||||
font-size: 32rpx;
|
||||
color: $text-color-light;
|
||||
}
|
||||
/* 内容区域 */
|
||||
.content-wrapper {
|
||||
padding: $spacing-lg $spacing-md;
|
||||
}
|
||||
|
||||
/* 板块通用头部 */
|
||||
.section-container {
|
||||
margin-bottom: $spacing-xl;
|
||||
|
||||
&.last-section {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
margin-bottom: $spacing-lg;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
@@ -310,7 +186,7 @@ const formatDate = (dateStr) => {
|
||||
}
|
||||
}
|
||||
|
||||
/* 极简活动卡片(两列横向拼图排版) */
|
||||
/* 极简活动卡片 */
|
||||
.activity-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view class="dev-page">
|
||||
<view class="dev-content">
|
||||
<text class="dev-icon">🚧</text>
|
||||
<text class="dev-title">正在开发中</text>
|
||||
<text class="dev-desc">此功能即将上线,敬请期待</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dev-page {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: $bg-color-soft;
|
||||
}
|
||||
|
||||
.dev-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: $spacing-md;
|
||||
}
|
||||
|
||||
.dev-icon {
|
||||
font-size: 80rpx;
|
||||
}
|
||||
|
||||
.dev-title {
|
||||
color: $text-color-main;
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.dev-desc {
|
||||
color: $text-color-muted;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view class="dev-page">
|
||||
<view class="dev-content">
|
||||
<text class="dev-icon">🚧</text>
|
||||
<text class="dev-title">正在开发中</text>
|
||||
<text class="dev-desc">此功能即将上线,敬请期待</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dev-page {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: $bg-color-soft;
|
||||
}
|
||||
|
||||
.dev-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: $spacing-md;
|
||||
}
|
||||
|
||||
.dev-icon {
|
||||
font-size: 80rpx;
|
||||
}
|
||||
|
||||
.dev-title {
|
||||
color: $text-color-main;
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.dev-desc {
|
||||
color: $text-color-muted;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -176,6 +176,21 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 我的预约条目 -->
|
||||
<view class="menu-item" @tap="navigateTo('/pages/ice/bookings/index')">
|
||||
<view class="item-left">
|
||||
<view class="item-icon-container card-theme">
|
||||
<view class="svg-card-minimal">
|
||||
<view class="svg-card-chip" />
|
||||
</view>
|
||||
</view>
|
||||
<text class="item-title">我的预约</text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<view class="menu-arrow" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 切换场馆条目 -->
|
||||
<view class="menu-item" @tap="navigateTo('/pages/venue-select/index?mode=switch')">
|
||||
<view class="item-left">
|
||||
@@ -209,16 +224,13 @@
|
||||
</view>
|
||||
</block>
|
||||
<AgreementLinks v-if="isLoggedIn" class="profile-agreement-links" compact />
|
||||
<VenueTabBar venue="ice" active="profile" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { api, authStorage } from '@/modules/ice/api/member'
|
||||
import { errorMessage, getMemberSession, loginAndStoreToken, SESSION_STATUS } from '@/modules/ice/api/session'
|
||||
import VenueTabBar from '@/components/VenueTabBar.vue'
|
||||
import StatePanel from '@/components/ice/StatePanel.vue'
|
||||
import AgreementLinks from '@/components/AgreementLinks.vue'
|
||||
import UnauthLoginPanel from '@/components/UnauthLoginPanel.vue'
|
||||
@@ -271,10 +283,6 @@ const canSubmitBind = computed(() => {
|
||||
return Boolean(bindForm.value.name.trim()) && Boolean(bindForm.value.phoneCode)
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
refreshSession()
|
||||
})
|
||||
|
||||
const applySession = (session) => {
|
||||
sessionStatus.value = session.status
|
||||
sessionMessage.value = session.message || ''
|
||||
@@ -488,6 +496,8 @@ const formatDate = (dateStr) => {
|
||||
const date = new Date(dateStr)
|
||||
return `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日`
|
||||
}
|
||||
|
||||
defineExpose({ onPageShow: refreshSession })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<view class="tab-page">
|
||||
<ComprehensiveMall v-if="isComprehensive" ref="contentRef" />
|
||||
<IceMall v-else ref="contentRef" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import { getStoredVenue } from '@/utils/venue'
|
||||
import ComprehensiveMall from '@/pages/comprehensive/mall/index.vue'
|
||||
import IceMall from '@/pages/ice/mall/index.vue'
|
||||
|
||||
const isComprehensive = getStoredVenue() === 'comprehensive'
|
||||
const contentRef = ref()
|
||||
|
||||
onPullDownRefresh(async () => {
|
||||
await contentRef.value?.refresh?.()
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tab-page {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view class="tab-page">
|
||||
<ComprehensivePrivate v-if="isComprehensive" ref="contentRef" />
|
||||
<IcePrivate v-else ref="contentRef" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { getStoredVenue } from '@/utils/venue'
|
||||
import ComprehensivePrivate from '@/pages/comprehensive/private/index.vue'
|
||||
import IcePrivate from '@/pages/ice/private/index.vue'
|
||||
|
||||
const isComprehensive = getStoredVenue() === 'comprehensive'
|
||||
const contentRef = ref()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tab-page {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<view class="tab-page">
|
||||
<ComprehensiveProfile v-if="isComprehensive" ref="contentRef" />
|
||||
<IceProfile v-else ref="contentRef" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { getStoredVenue } from '@/utils/venue'
|
||||
import ComprehensiveProfile from '@/pages/comprehensive/profile/index.vue'
|
||||
import IceProfile from '@/pages/ice/profile/index.vue'
|
||||
|
||||
const isComprehensive = getStoredVenue() === 'comprehensive'
|
||||
const contentRef = ref()
|
||||
|
||||
onShow(() => {
|
||||
contentRef.value?.onPageShow?.()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tab-page {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 404 B |
|
After Width: | Height: | Size: 401 B |
|
After Width: | Height: | Size: 425 B |
|
After Width: | Height: | Size: 422 B |
|
After Width: | Height: | Size: 404 B |
|
After Width: | Height: | Size: 401 B |
|
After Width: | Height: | Size: 425 B |
|
After Width: | Height: | Size: 422 B |
@@ -6,27 +6,13 @@ export const VENUE_KEYS = Object.freeze({
|
||||
})
|
||||
|
||||
export const VENUE_OPTIONS = Object.freeze([
|
||||
{
|
||||
key: VENUE_KEYS.ICE,
|
||||
name: '冰场馆',
|
||||
description: '课程预约、会员卡与滑冰服务',
|
||||
homePath: '/pages/ice/home/index'
|
||||
},
|
||||
{
|
||||
key: VENUE_KEYS.COMPREHENSIVE,
|
||||
name: '综合场馆',
|
||||
description: '课程、包场、门票、订单与余额',
|
||||
homePath: '/pages/comprehensive/home/index'
|
||||
}
|
||||
{ key: VENUE_KEYS.ICE, name: '冰场馆', description: '课程预约、会员卡与滑冰服务' },
|
||||
{ key: VENUE_KEYS.COMPREHENSIVE, name: '综合场馆', description: '课程、包场、门票、订单与余额' }
|
||||
])
|
||||
|
||||
export const isVenueKey = (value) => {
|
||||
return value === VENUE_KEYS.ICE || value === VENUE_KEYS.COMPREHENSIVE
|
||||
}
|
||||
export const isVenueKey = (value) => value === VENUE_KEYS.ICE || value === VENUE_KEYS.COMPREHENSIVE
|
||||
|
||||
export const getVenueOption = (venueKey) => {
|
||||
return VENUE_OPTIONS.find((item) => item.key === venueKey) || null
|
||||
}
|
||||
export const getVenueOption = (venueKey) => VENUE_OPTIONS.find((item) => item.key === venueKey) || null
|
||||
|
||||
export const getStoredVenue = () => {
|
||||
const venue = uni.getStorageSync(CURRENT_VENUE_KEY)
|
||||
@@ -38,18 +24,14 @@ export const setStoredVenue = (venueKey) => {
|
||||
uni.removeStorageSync(CURRENT_VENUE_KEY)
|
||||
return ''
|
||||
}
|
||||
|
||||
uni.setStorageSync(CURRENT_VENUE_KEY, venueKey)
|
||||
return venueKey
|
||||
}
|
||||
|
||||
export const navigateToVenueHome = (venueKey, options = {}) => {
|
||||
const venue = getVenueOption(venueKey)
|
||||
if (!venue) {
|
||||
export const navigateToVenueHome = (venueKey) => {
|
||||
if (!isVenueKey(venueKey)) {
|
||||
uni.reLaunch({ url: '/pages/venue-select/index' })
|
||||
return
|
||||
}
|
||||
|
||||
const navigate = options.redirect === true ? uni.redirectTo : uni.reLaunch
|
||||
navigate({ url: venue.homePath })
|
||||
uni.reLaunch({ url: '/pages/home/index' })
|
||||
}
|
||||
|
||||