瀏覽代碼

feat: save

gemercheung 6 月之前
父節點
當前提交
757f21ade4

+ 2 - 2
docker-compose.yml

@@ -22,8 +22,8 @@ services:
     build:
       dockerfile: docker/frontend/Dockerfile
       context: .
-    volumes:
-      - docker/html:/usr/share/nginx/html
+    # volumes:
+    #   - docker/html:/usr/share/nginx/html
     ports:
       - "19090:80"
     networks:

+ 3 - 1
packages/web/src/App.vue

@@ -1,8 +1,10 @@
 <template>
   <n-message-provider>
-    <RouterView />
+    <RouterView :class="locale"/>
   </n-message-provider>
 </template>
 <script lang="ts" setup>
 import { NMessageProvider } from 'naive-ui'
+const { locale } = useI18n()
+
 </script>

文件差異過大導致無法顯示
+ 46 - 48
packages/web/src/components/footer.vue


+ 3 - 1
packages/web/src/components/header.vue

@@ -15,7 +15,7 @@
       <n-h1 class="font-size-[48px] font-500">{{ $t('helperTip') }}</n-h1>
 
       <n-auto-complete v-model:value="keySearch" :options="searchOptions" class="max-w-[640px]" size="large" round
-        placeholder="输入关键字" blur-after-select @select="(index: number) => handleAutoSelect(index, searchOptions)"
+        :placeholder="$t('enter_key')" blur-after-select @select="(index: number) => handleAutoSelect(index, searchOptions)"
         @keydown.enter="handleSearch">
         <template #prefix>
           <n-icon :component="SearchOutline" />
@@ -71,10 +71,12 @@ const handleSelect = (key: string) => {
   locale.value = key
   localStorage.setItem('locale', key)
   location.reload();
+
 }
 onMounted(() => {
   const localeValue = localStorage.getItem('locale') || 'en'
   locale.value = String(localeValue)
+  document.title = t('web_title')
 
 })
 const handleAutoSelect = (index: number, list: any[]) => {

+ 2 - 1
packages/web/src/components/subHeader.vue

@@ -33,11 +33,12 @@ const handleSelect = (key: string) => {
   locale.value = key
   localStorage.setItem('locale', key)
   location.reload();
+
 }
 onMounted(() => {
   const localeValue = localStorage.getItem('locale') || 'en'
   locale.value = String(localeValue)
-
+  document.title = t('web_title')
 })
 </script>
 <style>

+ 25 - 3
packages/web/src/locales/json/en.json

@@ -1,6 +1,28 @@
 {
   "zh": "简体中文",
   "en": "English",
-  "test": "test英文",
-  "helperTip": "What Can I help you?"
-}
+  "helperTip": "What Can I help you?",
+  "enter_key":"Enter keywords",
+  "web_title": "Help Center",
+  "sell_cor": "Business Cooperation",
+  "pub_r": "Publicity",
+  "contact": "Hotline",
+  "products": "Products",
+  "4DKanKan_Meta": "4DKanKan Meta",
+  "4DKanKan_Mega": "4DKanKan Mega",
+  "4DKanKan_Minion": "4DKanKan Minion",
+  "4DKanKan_Pro": "4DKanKan Pro",
+  "solutions": "Solutions",
+  "smart_city": "Smart City",
+  "museums": "Museums",
+  "fire_sec": "Fire & Security",
+  "real_estate": "Real Estate",
+  "support": "Support",
+  "app_download": "App Download",
+  "help_center": "Help Center",
+  "post-sale": "Post-sale",
+  "about_us": "About Us",
+  "company_profile": "Company Profile",
+  "news_report": "News Report",
+  "distributor": "Be Our Distributor"
+}

+ 24 - 1
packages/web/src/locales/json/zh.json

@@ -2,5 +2,28 @@
   "zh": "简体中文",
   "en": "English",
   "test": "test中文",
-  "helperTip": "有什么可以帮助你?"
+  "helperTip": "有什么可以帮助你?",
+  "enter_key":"输入关键字",
+  "web_title": "帮助中心",
+  "sell_cor": "销售合作",
+  "pub_r": "媒体采访",
+  "contact": "联系我们",
+  "products": "核心产品",
+  "4DKanKan_Meta": "四维深光",
+  "4DKanKan_Mega": "四维深时",
+  "4DKanKan_Minion": "四维看见",
+  "4DKanKan_Pro": "四维看看",
+  "solutions": "解决方案",
+  "smart_city": "智慧城市",
+  "museums": "博物馆",
+  "fire_sec": "刑侦消防",
+  "real_estate": "房产营销",
+  "support": "服务支持",
+  "app_download": "App 下载",
+  "help_center": "使用帮助",
+  "post-sale": "售后服务",
+  "about_us": "关于我们",
+  "company_profile": "公司介绍",
+  "news_report": "新闻中心",
+  "distributor": "成为经销商"
 }