feat: 去掉导航栏、首页轮播全屏占屏1/3、场馆切换移至公告活动下方
- pages.json 全局设置 navigationStyle: custom 移除原生导航栏 - App.vue 全局 page 添加状态栏安全区 padding-top - 综合场馆/冰场馆首页轮播图改为全屏模式(无圆角无边距、去除标题) - 轮播图高度改为 33.33vh 占屏幕三分之一 - VenueSwitchHeader 从轮播图上方移至公告活动板块下方 - 合并 tabBar 页面路由、清理废弃组件 VenueTabBar
This commit is contained in:
@@ -6,57 +6,82 @@ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const srcRoot = resolve(root, 'src')
|
||||
|
||||
const tabPages = [
|
||||
{ file: 'pages/ice/home/index.vue', venue: 'ice', active: 'home' },
|
||||
{ file: 'pages/ice/courses/index.vue', venue: 'ice', active: 'courses' },
|
||||
{ file: 'pages/ice/bookings/index.vue', venue: 'ice', active: 'bookings' },
|
||||
{ file: 'pages/ice/profile/index.vue', venue: 'ice', active: 'profile' },
|
||||
{ file: 'pages/comprehensive/home/index.vue', venue: 'comprehensive', active: 'home' },
|
||||
{ file: 'pages/comprehensive/courses/index.vue', venue: 'comprehensive', active: 'courses' },
|
||||
{ file: 'pages/comprehensive/bookings/index.vue', venue: 'comprehensive', active: 'bookings' },
|
||||
{ file: 'pages/comprehensive/profile/index.vue', venue: 'comprehensive', active: 'profile' }
|
||||
{ file: 'pages/home/index.vue' },
|
||||
{ file: 'pages/private/index.vue' },
|
||||
{ file: 'pages/mall/index.vue' },
|
||||
{ file: 'pages/courses/index.vue' },
|
||||
{ file: 'pages/profile/index.vue' }
|
||||
]
|
||||
|
||||
const icons = ['home', 'course', 'booking', 'mine']
|
||||
const venues = ['ice', 'comprehensive']
|
||||
const tabBarPages = [
|
||||
'pages/home/index',
|
||||
'pages/private/index',
|
||||
'pages/mall/index',
|
||||
'pages/courses/index',
|
||||
'pages/profile/index'
|
||||
]
|
||||
|
||||
const icons = ['home', 'course', 'mine', 'mall', 'private']
|
||||
const failures = []
|
||||
|
||||
const assertFile = (path) => {
|
||||
if (!existsSync(path)) failures.push(`Missing file: ${path}`)
|
||||
const pagesJson = JSON.parse(readFileSync(resolve(srcRoot, 'pages.json'), 'utf8'))
|
||||
|
||||
if (!pagesJson.tabBar) {
|
||||
failures.push('pages.json missing tabBar configuration')
|
||||
} else {
|
||||
const tabPaths = pagesJson.tabBar.list.map(item => item.pagePath)
|
||||
for (const page of tabBarPages) {
|
||||
if (!tabPaths.includes(page)) {
|
||||
failures.push(`tabBar missing page: ${page}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assertFile(resolve(srcRoot, 'components/VenueTabBar.vue'))
|
||||
|
||||
for (const { file, venue, active } of tabPages) {
|
||||
for (const { file } of tabPages) {
|
||||
const path = resolve(srcRoot, file)
|
||||
assertFile(path)
|
||||
if (!existsSync(path)) continue
|
||||
|
||||
const content = readFileSync(path, 'utf8')
|
||||
if (!content.includes('<VenueTabBar')) {
|
||||
failures.push(`${file} does not render <VenueTabBar>`)
|
||||
}
|
||||
if (!content.includes(`venue="${venue}"`)) {
|
||||
failures.push(`${file} does not pass venue="${venue}"`)
|
||||
}
|
||||
if (!content.includes(`active="${active}"`)) {
|
||||
failures.push(`${file} does not pass active="${active}"`)
|
||||
}
|
||||
if (!content.includes("import VenueTabBar from '@/components/VenueTabBar.vue'")) {
|
||||
failures.push(`${file} does not import VenueTabBar`)
|
||||
if (!existsSync(path)) {
|
||||
failures.push(`Missing tab page: ${file}`)
|
||||
}
|
||||
}
|
||||
|
||||
for (const venue of venues) {
|
||||
for (const icon of icons) {
|
||||
assertFile(resolve(srcRoot, `static/${venue}/tab/${icon}.png`))
|
||||
assertFile(resolve(srcRoot, `static/${venue}/tab/${icon}-active.png`))
|
||||
for (const icon of icons) {
|
||||
const iconPath = resolve(srcRoot, `static/comprehensive/tab/${icon}.png`)
|
||||
const activeIconPath = resolve(srcRoot, `static/comprehensive/tab/${icon}-active.png`)
|
||||
if (!existsSync(iconPath)) failures.push(`Missing icon: static/comprehensive/tab/${icon}.png`)
|
||||
if (!existsSync(activeIconPath)) failures.push(`Missing icon: static/comprehensive/tab/${icon}-active.png`)
|
||||
}
|
||||
|
||||
const venuePages = [
|
||||
'pages/comprehensive/home/index.vue',
|
||||
'pages/comprehensive/courses/index.vue',
|
||||
'pages/comprehensive/profile/index.vue',
|
||||
'pages/ice/home/index.vue',
|
||||
'pages/ice/courses/index.vue',
|
||||
'pages/ice/profile/index.vue',
|
||||
'pages/ice/private/index.vue',
|
||||
'pages/ice/mall/index.vue'
|
||||
]
|
||||
|
||||
for (const file of venuePages) {
|
||||
const path = resolve(srcRoot, file)
|
||||
if (!existsSync(path)) {
|
||||
failures.push(`Missing venue page: ${file}`)
|
||||
continue
|
||||
}
|
||||
const content = readFileSync(path, 'utf8')
|
||||
if (content.includes('VenueTabBar')) {
|
||||
failures.push(`${file} still references VenueTabBar`)
|
||||
}
|
||||
}
|
||||
|
||||
if (existsSync(resolve(srcRoot, 'components/VenueTabBar.vue'))) {
|
||||
failures.push('VenueTabBar.vue should be deleted')
|
||||
}
|
||||
|
||||
if (failures.length) {
|
||||
console.error(`Venue tabbar verification failed with ${failures.length} issue(s):`)
|
||||
console.error(`TabBar verification failed with ${failures.length} issue(s):`)
|
||||
for (const failure of failures) console.error(`- ${failure}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log('Venue tabbar verification passed.')
|
||||
console.log('TabBar verification passed.')
|
||||
|
||||
Reference in New Issue
Block a user