feat: 竞赛主页中文

This commit is contained in:
2026-02-04 10:57:25 +08:00
parent 287825b4bf
commit ca782d0aff
13 changed files with 4016 additions and 3682 deletions

View File

@@ -95,11 +95,27 @@
</template>
<script setup lang="ts">
import { ref, computed, watch } from 'vue'
import { ref, computed, watch, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { getCookie } from '@/tool/cookie'
const route = useRoute()
const router = useRouter()
const { locale } = useI18n()
onMounted(() => {
// 初始化语言设置
const loginLanguage = localStorage.getItem('loginLanguage')
if (loginLanguage) {
locale.value = loginLanguage
} else {
const userLanguage = getCookie('language')
if (userLanguage) {
locale.value = userLanguage
}
}
})
const showQRcode = ref(false)
const handleCloseQRcode = () => {
@@ -110,10 +126,10 @@
const btnType = ref<BtnType>('index')
const btnText = computed(() => {
if (btnType.value === 'index') {
return 'Submit your Application'
return locale.value === 'CHINESE_SIMPLIFIED' ? '提交申请' : 'Submit your Application'
}
if (btnType.value === 'form') {
return 'Back to Introduction'
return locale.value === 'CHINESE_SIMPLIFIED' ? '赛事介绍' : 'Back to Introduction'
}
})