5c97e8b1f8
- pages.json 全局设置 navigationStyle: custom 移除原生导航栏 - App.vue 全局 page 添加状态栏安全区 padding-top - 综合场馆/冰场馆首页轮播图改为全屏模式(无圆角无边距、去除标题) - 轮播图高度改为 33.33vh 占屏幕三分之一 - VenueSwitchHeader 从轮播图上方移至公告活动板块下方 - 合并 tabBar 页面路由、清理废弃组件 VenueTabBar
88 lines
2.5 KiB
JavaScript
88 lines
2.5 KiB
JavaScript
import { existsSync, readFileSync } from 'node:fs'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { dirname, resolve } from 'node:path'
|
|
|
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
const srcRoot = resolve(root, 'src')
|
|
|
|
const tabPages = [
|
|
{ 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 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 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}`)
|
|
}
|
|
}
|
|
}
|
|
|
|
for (const { file } of tabPages) {
|
|
const path = resolve(srcRoot, file)
|
|
if (!existsSync(path)) {
|
|
failures.push(`Missing tab page: ${file}`)
|
|
}
|
|
}
|
|
|
|
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(`TabBar verification failed with ${failures.length} issue(s):`)
|
|
for (const failure of failures) console.error(`- ${failure}`)
|
|
process.exit(1)
|
|
}
|
|
|
|
console.log('TabBar verification passed.')
|