refactor(app): 重构应用配置和页面组件

- 更新 AppFooter 组件中的路由名称引用
- 重命名 config 文件夹下的 index.ts 为 index.js
- 删除 NationalMap 组件
- 新增 login 页面组件
- 更新 home 页面组件,移除 masonry 样式
- 更新 nuxt 配置,启用 pages:extend钩子
- 移除 package.json 中的 vue-masonry-wall依赖
This commit is contained in:
xingyy 2025-01-09 19:57:50 +08:00
parent a8e2faae0f
commit 9092b59027
11 changed files with 44 additions and 116 deletions

View File

@ -1,5 +1,5 @@
<script setup>
import { useAppFooterRouteNames as names } from '~/config'
import { useAppFooterRouteNames as names } from '~/config/index.js'
import MyIcon from "~/components/icons/MyIcon.vue";
import HomeIcon from "~/components/icons/HomeIcon.vue";
const route = useRoute()

View File

@ -0,0 +1,11 @@
<script setup lang="ts">
</script>
<template>
</template>
<style scoped>
</style>

2
app/config/index.js Normal file
View File

@ -0,0 +1,2 @@
export const useAppFooterRouteNames= ['home', 'profile']

View File

@ -1,6 +0,0 @@
import type { RouteRecordName } from 'vue-router'
/**
* Use the AppFooter routing whitelist
*/
export const useAppFooterRouteNames: RouteRecordName[] = ['index', 'profile']

View File

@ -170,77 +170,4 @@ const rightColumn = computed(() => {
</van-tabs>
</template>
<style scoped>
.masonry-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16px;
width: 100%;
}
.masonry-item {
width: 100%;
break-inside: avoid;
margin-bottom: 20px;
}
/* 偶数项向上偏移 */
.masonry-item.odd {
margin-top: 32px;
}
/* 图片样式 */
:deep(.product-image) {
width: 100%;
height: auto;
aspect-ratio: 1/1;
}
/* LOT标签样式 */
.lot-tag {
position: absolute;
left: 8px;
top: 8px;
height: 17px;
width: 45px;
display: flex;
justify-content: center;
align-items: center;
background-color: #2b53ac;
color: #fff;
font-size: 12px;
}
/* 商品信息样式 */
.product-info {
padding-top: 8px;
}
.title {
font-size: 14px;
color: #000;
line-height: 1.4;
}
.starting-price {
font-size: 12px;
color: #575757;
margin-top: 4px;
}
.transaction-price {
font-size: 12px;
color: #b58047;
margin-top: 4px;
}
/* 确保图片容器响应式 */
:deep(.van-image) {
width: 100% !important;
}
:deep(.van-image__img) {
width: 100% !important;
height: auto !important;
}
</style>

16
app/pages/login/index.vue Normal file
View File

@ -0,0 +1,16 @@
<script setup>
</script>
<template>
<div class="bg-[url('@/static/images/asdfsdd.png')] w-[100vw] h-[100vh] bg-cover pt-[86px]">
<div class="w-full flex justify-center">
<img class="w-[189px] h-[105px]" src="@/static/images/ghfggff.png" alt="">
</div>
</div>
</template>
<style scoped>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -4,20 +4,20 @@ import preload from './app/utils/preload'
import { currentLocales } from './i18n/i18n'
export default defineNuxtConfig({
//
// hooks: {
// 'pages:extend'(pages) {
// const indexPage = pages.findIndex(page => page.path === '/')
// if (indexPage !== -1) {
// pages.splice(indexPage, 1)
// }
// pages.push({
// name: 'home',
// path: '/',
// file: '~/pages/home/index.vue'
// })
// }
// },
hooks: {
'pages:extend'(pages) {
const indexPage = pages.findIndex(page => page.path === '/')
if (indexPage !== -1) {
pages.splice(indexPage, 1)
}
pages.push({
name: 'home',
path: '/',
file: '~/pages/home/index.vue'
})
}
},
modules: [
'@vant/nuxt',
'@unocss/nuxt',

View File

@ -18,7 +18,6 @@
"nuxt": "^3.15.0",
"pinia-plugin-persistedstate": "^4.2.0",
"vue": "^3.5.13",
"vue-masonry-wall": "^0.3.2",
"vue-router": "^4.5.0"
},
"devDependencies": {

View File

@ -26,9 +26,6 @@ importers:
vue:
specifier: ^3.5.13
version: 3.5.13(typescript@5.7.2)
vue-masonry-wall:
specifier: ^0.3.2
version: 0.3.2(lodash@4.17.21)(vue@3.5.13(typescript@5.7.2))
vue-router:
specifier: ^4.5.0
version: 4.5.0(vue@3.5.13(typescript@5.7.2))
@ -4800,16 +4797,6 @@ packages:
peerDependencies:
vue: ^3.0.0
vue-masonry-wall@0.3.2:
resolution: {integrity: sha512-uy/tY9Lz6zVZCXmS78sv5u1yf70gAC+ElFXdV8miJfLiNnzXXt2i03I8sccx2YXDKk1IOZv6wDbKTUL8ethvfw==}
engines: {node: '>=10'}
peerDependencies:
lodash: ^4.17.15
vue: ^2.6.10
vue-observe-visibility@0.4.6:
resolution: {integrity: sha512-xo0CEVdkjSjhJoDdLSvoZoQrw/H2BlzB5jrCBKGZNXN2zdZgMuZ9BKrxXDjNP2AxlcCoKc8OahI3F3r3JGLv2Q==}
vue-router@4.5.0:
resolution: {integrity: sha512-HDuk+PuH5monfNuY+ct49mNmkCRK4xJAV9Ts4z9UFc4rzdDnxQLyCMGGc8pKhZhHTVzfanpNwB/lwqevcBwI4w==}
peerDependencies:
@ -10455,14 +10442,6 @@ snapshots:
'@vue/devtools-api': 6.6.4
vue: 3.5.13(typescript@5.7.2)
vue-masonry-wall@0.3.2(lodash@4.17.21)(vue@3.5.13(typescript@5.7.2)):
dependencies:
lodash: 4.17.21
vue: 3.5.13(typescript@5.7.2)
vue-observe-visibility: 0.4.6
vue-observe-visibility@0.4.6: {}
vue-router@4.5.0(vue@3.5.13(typescript@5.7.2)):
dependencies:
'@vue/devtools-api': 6.6.4