集中配置四端品牌展示名称
This commit is contained in:
@@ -21,6 +21,7 @@ import { computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ChevronLeft } from 'lucide-vue-next'
|
||||
import TabBar from '@/components/TabBar.vue'
|
||||
import { BRAND_CONFIG } from '@/config/brand'
|
||||
|
||||
const props = defineProps<{
|
||||
title?: string
|
||||
@@ -33,7 +34,7 @@ const router = useRouter()
|
||||
|
||||
const showTab = computed(() => Boolean(route.meta.tab))
|
||||
const showHeader = computed(() => !props.hideHeader && !showTab.value)
|
||||
const title = computed(() => props.title || String(route.meta.title || 'Jayu Salon'))
|
||||
const title = computed(() => props.title || String(route.meta.title || BRAND_CONFIG.appName))
|
||||
|
||||
const goBack = (): void => {
|
||||
if (window.history.length > 1) {
|
||||
|
||||
@@ -8,5 +8,3 @@ const DEFAULT_ADMIN_API_BASE_URL = import.meta.env.DEV ? '/admin/api' : 'https:/
|
||||
|
||||
export const API_BASE_URL = normalizeBaseUrl(import.meta.env.VITE_API_BASE_URL, DEFAULT_API_BASE_URL)
|
||||
export const ADMIN_API_BASE_URL = normalizeBaseUrl(import.meta.env.VITE_ADMIN_API_BASE_URL, DEFAULT_ADMIN_API_BASE_URL)
|
||||
export const APP_NAME = String(import.meta.env.VITE_APP_NAME || 'Jayu Salon')
|
||||
export const APP_SHORT_NAME = String(import.meta.env.VITE_APP_SHORT_NAME || '指')
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
function normalizeBrandValue(value: string | undefined, fallbackValue: string): string {
|
||||
const target = String(value || fallbackValue).trim()
|
||||
return target || fallbackValue
|
||||
}
|
||||
|
||||
const DEFAULT_APP_NAME = 'Jayu Salon'
|
||||
const DEFAULT_APP_SHORT_NAME = '指'
|
||||
const DEFAULT_APP_TAGLINE = '美甲店预约排班管理'
|
||||
const DEFAULT_ABOUT_NAME = '甲屿云'
|
||||
const DEFAULT_ABOUT_DESCRIPTION = '专为美甲店店长设计的预约排班日历子系统'
|
||||
const DEFAULT_SHOP_NAME = '甲屿店务'
|
||||
const DEFAULT_REGISTER_SHOP_PLACEHOLDER = '例如:Jayu Artist'
|
||||
|
||||
export const BRAND_CONFIG = {
|
||||
appName: normalizeBrandValue(import.meta.env.VITE_APP_NAME, DEFAULT_APP_NAME),
|
||||
appShortName: normalizeBrandValue(import.meta.env.VITE_APP_SHORT_NAME, DEFAULT_APP_SHORT_NAME),
|
||||
appTagline: normalizeBrandValue(import.meta.env.VITE_APP_TAGLINE, DEFAULT_APP_TAGLINE),
|
||||
aboutName: normalizeBrandValue(import.meta.env.VITE_ABOUT_NAME, DEFAULT_ABOUT_NAME),
|
||||
aboutDescription: normalizeBrandValue(import.meta.env.VITE_ABOUT_DESCRIPTION, DEFAULT_ABOUT_DESCRIPTION),
|
||||
defaultShopName: normalizeBrandValue(import.meta.env.VITE_DEFAULT_SHOP_NAME, DEFAULT_SHOP_NAME),
|
||||
registerShopPlaceholder: normalizeBrandValue(import.meta.env.VITE_REGISTER_SHOP_PLACEHOLDER, DEFAULT_REGISTER_SHOP_PLACEHOLDER)
|
||||
}
|
||||
@@ -2,9 +2,12 @@ import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import { BRAND_CONFIG } from './config/brand'
|
||||
import { installKeyboardInset } from './utils/keyboard-inset'
|
||||
import './styles/base.css'
|
||||
|
||||
document.title = BRAND_CONFIG.appName
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
installKeyboardInset()
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<MobileShell title="关于">
|
||||
<div class="about-page">
|
||||
<section class="card brand-card">
|
||||
<img class="logo" :src="appIconUrl" alt="甲屿云" />
|
||||
<strong>甲屿云</strong>
|
||||
<span>专为美甲店店长设计的预约排班日历子系统</span>
|
||||
<img class="logo" :src="appIconUrl" :alt="BRAND_CONFIG.aboutName" />
|
||||
<strong>{{ BRAND_CONFIG.aboutName }}</strong>
|
||||
<span>{{ BRAND_CONFIG.aboutDescription }}</span>
|
||||
</section>
|
||||
|
||||
<section class="card about-list section">
|
||||
@@ -50,6 +50,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import MobileShell from '@/components/MobileShell.vue'
|
||||
import { BRAND_CONFIG } from '@/config/brand'
|
||||
|
||||
const appIconUrl = `${import.meta.env.BASE_URL}assets/images/app-icon.png`
|
||||
const versionRecords: Array<{ version: string; date: string; title: string; items: string[] }> = [
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<MobileShell plain hide-header>
|
||||
<div class="auth-page">
|
||||
<section class="brand-block">
|
||||
<img class="brand-block__logo" :src="appIconUrl" alt="Jayu Salon" />
|
||||
<h1>{{ APP_NAME }}</h1>
|
||||
<p>美甲店预约排班管理</p>
|
||||
<img class="brand-block__logo" :src="appIconUrl" :alt="BRAND_CONFIG.appName" />
|
||||
<h1>{{ BRAND_CONFIG.appName }}</h1>
|
||||
<p>{{ BRAND_CONFIG.appTagline }}</p>
|
||||
</section>
|
||||
|
||||
<section class="card auth-card">
|
||||
@@ -93,7 +93,7 @@ import { onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import BaseModal from '@/components/BaseModal.vue'
|
||||
import MobileShell from '@/components/MobileShell.vue'
|
||||
import { APP_NAME } from '@/config/api'
|
||||
import { BRAND_CONFIG } from '@/config/brand'
|
||||
import { authApi, type PasswordLoginRequest, type PhoneLoginRequest } from '@/api/auth'
|
||||
import type { IdType, LegalAgreement, LoginResponse, LoginShop } from '@/types/common'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
|
||||
@@ -90,6 +90,7 @@ import MobileShell from '@/components/MobileShell.vue'
|
||||
import { authApi } from '@/api/auth'
|
||||
import { fileApi } from '@/api/file'
|
||||
import { userApi } from '@/api/user'
|
||||
import { BRAND_CONFIG } from '@/config/brand'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
import { useToastStore } from '@/stores/toast'
|
||||
import type { UserInfo } from '@/types/common'
|
||||
@@ -217,8 +218,8 @@ const roleText = computed(() => {
|
||||
if (role === 4) return '管理员'
|
||||
return '管理端'
|
||||
})
|
||||
const shopName = computed(() => userInfo.value?.shopName || '甲屿云')
|
||||
const phoneText = computed(() => userInfo.value?.contactPhone || userInfo.value?.phone || userInfo.value?.account || '店长端')
|
||||
const shopName = computed(() => userInfo.value?.shopName || BRAND_CONFIG.aboutName)
|
||||
const phoneText = computed(() => userInfo.value?.contactPhone || userInfo.value?.phone || userInfo.value?.account || BRAND_CONFIG.appTagline)
|
||||
|
||||
const syncProfileToSession = (profile: UserInfo): void => {
|
||||
const currentUserInfo: Partial<UserInfo> = session.userInfo || {}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="required">店铺名称</label>
|
||||
<input v-model.trim="form.shopName" placeholder="例如:Jayu Artist" />
|
||||
<input v-model.trim="form.shopName" :placeholder="BRAND_CONFIG.registerShopPlaceholder" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="required">昵称</label>
|
||||
@@ -54,6 +54,7 @@ import { onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import MobileShell from '@/components/MobileShell.vue'
|
||||
import { authApi } from '@/api/auth'
|
||||
import { BRAND_CONFIG } from '@/config/brand'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
import { useToastStore } from '@/stores/toast'
|
||||
import type { LegalAgreement } from '@/types/common'
|
||||
|
||||
@@ -141,6 +141,7 @@ import MobileShell from '@/components/MobileShell.vue'
|
||||
import PageSection from '@/components/PageSection.vue'
|
||||
import TimePickerField from '@/components/TimePickerField.vue'
|
||||
import { managerShopApi } from '@/api/managerShop'
|
||||
import { BRAND_CONFIG } from '@/config/brand'
|
||||
import type { ShopScheduleException } from '@/types/manager'
|
||||
import { formatDate } from '@/utils/date'
|
||||
import { useToastStore } from '@/stores/toast'
|
||||
@@ -173,7 +174,7 @@ const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const exceptions = ref<ShopScheduleException[]>([])
|
||||
const form = reactive({
|
||||
shopName: '甲屿店务',
|
||||
shopName: BRAND_CONFIG.defaultShopName,
|
||||
startTime: '10:00',
|
||||
endTime: '22:00',
|
||||
defaultDuration: '60',
|
||||
|
||||
Reference in New Issue
Block a user