首页更新

This commit is contained in:
hrx 2026-07-03 14:40:21 +08:00
parent 982c5b809d
commit 64893f1a49

View File

@ -28,20 +28,15 @@
</nav>
<div class="user-actions">
<el-dropdown class="lang-switch" trigger="click">
<button type="button" class="lang-switch-btn">
{{ currentLocaleLabel }}
<i class="el-icon-arrow-down"></i>
</button>
<el-dropdown-menu slot="dropdown" class="lang-switch-menu">
<el-dropdown-item :class="{ 'is-active': activeLocale === 'zh-CN' }" @click.native="switchLocale('zh-CN')">
中文
</el-dropdown-item>
<el-dropdown-item :class="{ 'is-active': activeLocale === 'en-US' }" @click.native="switchLocale('en-US')">
English
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<span
class="nav-lang-text"
:class="{ 'is-en': activeLocale === 'en-US' }"
id="lang-toggle"
:title="langToggleTitle"
@click="toggleLanguage"
>
<span id="lang-text">{{ langToggleText }}</span>
</span>
<i v-if="loginState" class="iconfont icon-xiaoxi functions" @click="handleMessageClick"></i>
<button v-if="loginState" type="button" class="console-link" @click="goB">{{ $t('topbar.console') }}</button>
@ -415,8 +410,11 @@ export default Vue.extend({
return this.$route.path === '/tokenMarket' ||
(this.$route.path === '/product' && ['TOKEN市集', 'Token市集', 'token市集'].includes(category))
},
currentLocaleLabel() {
return this.activeLocale === 'en-US' ? 'English' : '中文'
langToggleText() {
return this.activeLocale === 'en-US' ? 'EN/中' : '中/EN'
},
langToggleTitle() {
return this.activeLocale === 'en-US' ? 'Switch to Chinese' : '切换到英文'
},
aiPanelStyle() {
if (this.aiPanelPosition.left === null || this.aiPanelPosition.top === null) {
@ -942,8 +940,8 @@ export default Vue.extend({
this.$router.push('/homePage/index');
}
},
switchLocale(locale) {
if (!locale || locale === this.activeLocale) return
toggleLanguage() {
const locale = this.activeLocale === 'en-US' ? 'zh-CN' : 'en-US'
setLocale(locale)
this.activeLocale = locale
this.$message.success(
@ -1058,26 +1056,27 @@ export default Vue.extend({
font-size: 15px !important;
}
.lang-switch-btn {
height: 32px;
padding: 0 10px;
border: 1px solid rgba(110, 118, 140, 0.35);
border-radius: 8px;
background: rgba(255, 255, 255, 0.65);
color: #333;
.nav-lang-text {
color: #111827;
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 13px !important;
justify-content: center;
font-size: 16px !important;
font-weight: 600;
//line-height: 1;
cursor: pointer;
transition: all 0.2s ease;
user-select: none;
transition: color 0.2s ease;
&:hover {
color: #1E6FFF;
border-color: rgba(30, 111, 255, 0.45);
color: #1e6fff;
}
}
.nav-lang-text.is-en {
color: #1e6fff;
}
.user-actions {
display: flex;
align-items: center;
@ -1120,7 +1119,7 @@ export default Vue.extend({
background: transparent;
color: #333;
cursor: pointer;
font-size: 17px !important;
font-size: 16px !important;
font-weight: 700;
// line-height: 36px
transition: color 0.2s ease;