From 3205ecd547f81f953675c0d1936d99e2ec04db5b Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:17:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20=E4=BC=98=E5=8C=96=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=85=8D=E7=BD=AE=E5=B9=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=AF=AD=E8=A8=80=E4=B8=BA=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 app.vue 中设置 locale 为 'en-US' - 更新协议签署页面的国际化使用方式- 修改首页物品列表的显示逻辑 - 禁用浏览器语言检测,设置默认语言为中文 --- app/app.vue | 3 ++- .../collectCode/signature/protocol/index.vue | 18 ++++++++++-------- app/pages/home/components/ItemList/index.vue | 2 +- nuxt.config.js | 8 +------- public/pdfs/jmxz.pdf | Bin 284955 -> 250755 bytes 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/app/app.vue b/app/app.vue index 1ba75a4..51f89db 100644 --- a/app/app.vue +++ b/app/app.vue @@ -15,7 +15,8 @@ useHead({ const router = useRouter() const route = useRoute() const slideDirection = ref('slide-left') - +const { locale } = useI18n() +locale.value = 'en-US' // 记录路由历史 const routeHistory = ref([]) diff --git a/app/pages/collectCode/signature/protocol/index.vue b/app/pages/collectCode/signature/protocol/index.vue index ea707bd..cb43883 100644 --- a/app/pages/collectCode/signature/protocol/index.vue +++ b/app/pages/collectCode/signature/protocol/index.vue @@ -3,10 +3,12 @@ import pdfView from './pdfView' import { contractView } from "~/api/goods/index.js" import {codeAuthStore} from "~/stores-collect-code/auth/index.js"; import {signOffline} from "~/api/goods/index.js"; +import {useI18n} from "vue-i18n"; definePageMeta({ title:'签署' }) +const {t} =useI18n() const {formData,number,qrData}=codeAuthStore() const activeNames = ref([]) const router = useRouter() @@ -16,15 +18,15 @@ const pmblUrl = ref('') // 存储拍卖笔录的URL const protocolList = computed(() => { if(number.value==1){ return [ - { id: '4', title: $t('signature.agreement.buyerAgreement'), pdfName: 'jmxy', type: 'local' }, - { id: '3', title: $t('signature.agreement.buyerGuide'), pdfName: 'jmxz', type: 'local' }, - { id: '1', title: $t('signature.agreement.notice'), pdfName: 'pmgg', type: 'local' }, - { id: '2', title: $t('signature.agreement.rules'), pdfName: 'pmgz', type: 'local' }, + { id: '4', title: t('signature.agreement.buyerAgreement'), pdfName: 'jmxy', type: 'local' }, + { id: '3', title: t('signature.agreement.buyerGuide'), pdfName: 'jmxz', type: 'local' }, + { id: '1', title: t('signature.agreement.notice'), pdfName: 'pmgg', type: 'local' }, + { id: '2', title: t('signature.agreement.rules'), pdfName: 'pmgz', type: 'local' }, ] }else if(number.value==2) { return [ - { id: '6', title: $t('signature.agreement.transfer'), pdfName: 'pmyjqrs', type: 'local' }, - { id: '5', title: $t('signature.agreement.record'), pdfName: pmblUrl.value, type: 'remote' } + { id: '6', title: t('signature.agreement.transfer'), pdfName: 'pmyjqrs', type: 'local' }, + { id: '5', title: t('signature.agreement.record'), pdfName: pmblUrl.value, type: 'remote' } ] } }) @@ -77,7 +79,7 @@ const goSignature = () => {