Merge branch 'main' into xingyy

# Conflicts:
#	app/components/AppFooter.vue
This commit is contained in:
xingyy 2025-01-08 15:48:05 +08:00
commit ef5fe41848
11 changed files with 153 additions and 29 deletions

21
LICENSE
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2024 Charlie Wang ✨
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,10 +1,14 @@
<script setup lang="ts">
import type { ConfigProviderTheme } from 'vant'
import useKeepalive from '~/composables/keepalive'
import { appName } from '~/constants'
import { appName, appDescription } from '~/constants'
import { useI18n } from 'vue-i18n'
useHead({
title: appName,
title: useI18n().t('appSetting.appName'),
meta: [
{ name: 'description', content: useI18n().t('appSetting.appDescription') },
],
})
const color = useColorMode()
@ -20,9 +24,23 @@ const keepAliveRouteNames = computed(() => {
<template>
<VanConfigProvider :theme="mode">
<NuxtLoadingIndicator color="repeating-linear-gradient(to right,var(--c-primary) 0%,var(--c-primary-active) 100%)" />
<NuxtLoadingIndicator
color="repeating-linear-gradient(to right,var(--c-primary) 0%,var(--c-primary-active) 100%)" />
<NuxtLayout>
<NuxtPage :keepalive="{ include: keepAliveRouteNames }" />
</NuxtLayout>
</VanConfigProvider>
</template>
<style>
.page-enter-active,
.page-leave-active {
transition: all 0.2s;
}
.page-enter-from,
.page-leave-to {
opacity: 0;
filter: blur(1rem);
}
</style>

View File

@ -23,7 +23,7 @@ const show = computed(() => {
<van-tabbar-item replace to="/profile">
<span>{{ $t('tabbar.profile') }}</span>
<template #icon>
<div class="i-carbon:user" />12asdfasdfasdf
<div class="i-carbon:user" />
</template>
</van-tabbar-item>
</van-tabbar>

View File

@ -1,2 +1,2 @@
export const appName = 'nuxt-vant-mobile'
export const appDescription = 'Nuxt H5 Starter Template'
export const appName = '豐和'
export const appDescription = '泰丰国际京都拍卖会'

View File

@ -2,11 +2,15 @@ import type { Locale as TypeLocale } from '#i18n'
import { Locale } from 'vant'
import enUS from 'vant/es/locale/lang/en-US'
import zhCN from 'vant/es/locale/lang/zh-CN'
import jaJP from 'vant/es/locale/lang/ja-JP'
import zhTW from 'vant/es/locale/lang/zh-TW'
export default defineNuxtPlugin(() => {
// 载入 vant 语言包
Locale.use('zh-CN', zhCN)
Locale.use('en-US', enUS)
Locale.use('ja-JP', jaJP)
Locale.use('zh-TW', zhTW)
if (import.meta.client) {
const i18n = useNuxtApp().$i18n

View File

@ -6,11 +6,21 @@ const locales: LocaleObject[] = [
file: 'zh-CN.json',
name: '简体中文',
},
{
code: 'zh-TW',
file: 'zh-TW.json',
name: '繁体中文',
},
{
code: 'en-US',
file: 'en-US.json',
name: 'English',
},
{
code: 'ja-JP',
file: 'ja-JP.json',
name: '日本语',
},
]
function buildLocales() {

View File

@ -1,4 +1,8 @@
{
"appSetting":{
"appName": "FENGHE",
"appDescription": "TAIFENG INTERNATIONAL KYOTO AUCTION"
},
"menu": {
"home": "Home",
"profile": "Profile",

46
i18n/locales/ja-JP.json Normal file
View File

@ -0,0 +1,46 @@
{
"appSetting": {
"appName": "豊和",
"appDescription": "泰豊国際京都オークション"
},
"menu": {
"home": "ホーム",
"profile": "マイページ",
"darkMode": "🌗 ダークモード",
"language": "📚 言語",
"404Demo": "🙅 404ページ デモ",
"unocssExample": "🎨 Unocss 例",
"keepAlive": "🧡 KeepAlive デモ",
"persistPiniaState": "💾 Pinia 状態の永続化",
"fetch": "🏄 ネットワークリクエスト"
},
"tabbar": {
"home": "ホーム",
"profile": "マイページ"
},
"unocss_page": {
"hello": "こんにちは {0}",
"desc": "これは unocss の簡単な例です。",
"btn_txt": "ボタン"
},
"error_page": {
"back_btn": "戻る",
"txt": "ページが見つかりません"
},
"profile_page": {
"txt": "未完成"
},
"keepalive_page": {
"label": "このコンポーネントはキャッシュされます"
},
"counter_page": {
"label": "これは Pinia の状態永続化の簡単な例です。有効性を確認するには、ページを更新して観察してください。",
"label_num": "数字",
"btn_add": "増加"
},
"prose_page": {
"btn_fetch": "取得",
"btn_clear": "クリア",
"btn_empty_desc": "データなし"
}
}

View File

@ -1,4 +1,8 @@
{
"appSetting":{
"appName": "豐和",
"appDescription": "泰丰国际京都拍卖会"
},
"menu": {
"home": "主页",
"profile": "我的",

46
i18n/locales/zh-TW.json Normal file
View File

@ -0,0 +1,46 @@
{
"appSetting": {
"appName": "豐和",
"appDescription": "泰豐國際京都拍賣會"
},
"menu": {
"home": "首頁",
"profile": "我的",
"darkMode": "🌗 暗黑模式",
"language": "📚 語言",
"404Demo": "🙅 404頁面 演示",
"unocssExample": "🎨 Unocss 示例",
"keepAlive": "🧡 KeepAlive 演示",
"persistPiniaState": "💾 持久化 Pinia 狀態",
"fetch": "🏄 網路請求"
},
"tabbar": {
"home": "首頁",
"profile": "我的"
},
"unocss_page": {
"hello": "你好 {0}",
"desc": "這是 unocss 一個簡單例子。",
"btn_txt": "按鈕"
},
"error_page": {
"back_btn": "返回",
"txt": "沒有找到"
},
"profile_page": {
"txt": "未完成"
},
"keepalive_page": {
"label": "當前元件將會被快取"
},
"counter_page": {
"label": "這是一個簡單的持久化 Pinia 狀態的例子。為了驗證其有效性,你可以重新整理介面並觀察它。",
"label_num": "數字",
"btn_add": "增加"
},
"prose_page": {
"btn_fetch": "拉取",
"btn_clear": "清空",
"btn_empty_desc": "暫無數據"
}
}

View File

@ -60,6 +60,10 @@ export default defineNuxtConfig({
strategy: 'no_prefix',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
redirectOn: 'root',
alwaysRedirect: true,
fallbackLocale: 'zh-CN'
},
langDir: 'locales',
defaultLocale: 'zh-CN',
@ -67,6 +71,10 @@ export default defineNuxtConfig({
},
app: {
pageTransition: {
name: 'page',
mode: 'out-in',
},
head: {
viewport: 'width=device-width,initial-scale=1,viewport-fit=cover',
link: [
@ -74,7 +82,6 @@ export default defineNuxtConfig({
],
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1, viewport-fit=cover' },
{ name: 'description', content: appDescription },
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
{ name: 'theme-color', media: '(prefers-color-scheme: light)', content: '#ffffff' },
{ name: 'theme-color', media: '(prefers-color-scheme: dark)', content: '#222222' },
@ -125,5 +132,11 @@ export default defineNuxtConfig({
compatibilityVersion: 4,
},
compatibilityDate: '2024-09-24',
// 指定 Nuxt 应用程序的兼容性日期,确保应用程序在未来的 Nuxt 版本中保持稳定性
compatibilityDate: '2025-01-07',
devServer: {
host: '0.0.0.0',
port: 3000,
},
})