77} </route >
88
99<script lang="ts" setup>
10+ import { changeLanguage , getCurrentLanguage , getSupportedLanguages , t } from ' @/i18n'
11+ import type { Language } from ' @/store/lang'
1012import { clearServerBaseUrlOverride , getEnvBaseUrl , getServerBaseUrlOverride , setServerBaseUrlOverride } from ' @/utils'
1113import { isMp } from ' @/utils/platform'
1214import { computed , onMounted , reactive , ref } from ' vue'
1315import { useToast } from ' wot-design-uni'
14- import { t , changeLanguage , getSupportedLanguages , getCurrentLanguage } from ' @/i18n'
15- import type { Language } from ' @/store/lang'
1616
1717defineOptions ({
1818 name: ' SettingsPage' ,
@@ -233,9 +233,9 @@ async function clearCache() {
233233function showAbout() {
234234 uni .showModal ({
235235 title: t (' settings.aboutApp' , { appName: import .meta .env .VITE_APP_TITLE }),
236- content: t (' settings.aboutContent' , {
236+ content: t (' settings.aboutContent' , {
237237 appName: import .meta .env .VITE_APP_TITLE ,
238- version: ' 0.8.5 '
238+ version: ' 0.8.6 '
239239 }),
240240 showCancel: false ,
241241 confirmText: t (' common.confirm' ),
@@ -248,7 +248,7 @@ onMounted(async () => {
248248 loadServerBaseUrl ()
249249 }
250250 getCacheInfo ()
251-
251+
252252 // 动态设置导航栏标题为国际化文本
253253 uni .setNavigationBarTitle ({
254254 title: t (' settings.title' )
@@ -283,9 +283,9 @@ onMounted(async () => {
283283 <view class =" mb-[24rpx]" >
284284 <view class =" w-full rounded-[16rpx] border border-[#eeeeee] bg-[#f5f7fb] overflow-hidden" >
285285 <wd-input v-model =" baseUrlInput" type =" text" clearable :maxlength =" 200"
286- :placeholder =" t('settings.enterServerUrl')"
287- custom-class =" !border-none !bg-transparent h-[64rpx] px-[24rpx] items-center"
288- input-class =" text-[28rpx] text-[#232338]" @input =" validateUrl" @blur =" validateUrl" />
286+ :placeholder =" t('settings.enterServerUrl')"
287+ custom-class =" !border-none !bg-transparent h-[64rpx] px-[24rpx] items-center"
288+ input-class =" text-[28rpx] text-[#232338]" @input =" validateUrl" @blur =" validateUrl" />
289289 </view >
290290 <text v-if =" urlError" class =" mt-[8rpx] block text-[24rpx] text-[#ff4d4f]" >
291291 {{ urlError }}
@@ -323,11 +323,11 @@ onMounted(async () => {
323323 class =" flex items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx] transition-all active:bg-[#eef3ff]" >
324324 <view >
325325 <text class =" text-[28rpx] text-[#232338] font-medium" >
326- {{ t('settings.totalCacheSize') }}
327- </text >
328- <text class =" mt-[4rpx] block text-[24rpx] text-[#9d9ea3]" >
329- {{ t('settings.appDataSize') }}
330- </text >
326+ {{ t('settings.totalCacheSize') }}
327+ </text >
328+ <text class =" mt-[4rpx] block text-[24rpx] text-[#9d9ea3]" >
329+ {{ t('settings.appDataSize') }}
330+ </text >
331331 </view >
332332 <text class =" text-[28rpx] text-[#65686f] font-semibold" >
333333 {{ cacheInfo.storageSize }}
@@ -339,11 +339,11 @@ onMounted(async () => {
339339 class =" flex items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx]" >
340340 <view >
341341 <text class =" text-[28rpx] text-[#232338] font-medium" >
342- {{ t('settings.cacheClear') }}
343- </text >
344- <text class =" mt-[4rpx] block text-[24rpx] text-[#9d9ea3]" >
345- {{ t('settings.clearAllCache') }}
346- </text >
342+ {{ t('settings.cacheClear') }}
343+ </text >
344+ <text class =" mt-[4rpx] block text-[24rpx] text-[#9d9ea3]" >
345+ {{ t('settings.clearAllCache') }}
346+ </text >
347347 </view >
348348 <view
349349 class =" cursor-pointer rounded-[24rpx] bg-[rgba(255,107,107,0.1)] px-[28rpx] py-[16rpx] text-[24rpx] text-[#ff6b6b] font-semibold transition-all duration-300 active:scale-95 active:bg-[#ff6b6b] active:text-white"
@@ -359,8 +359,8 @@ onMounted(async () => {
359359 <view class =" mb-[32rpx]" >
360360 <view class =" mb-[24rpx] flex items-center" >
361361 <text class =" text-[32rpx] text-[#232338] font-bold" >
362- {{ t('settings.appInfo') }}
363- </text >
362+ {{ t('settings.appInfo') }}
363+ </text >
364364 </view >
365365
366366 <view class =" border border-[#eeeeee] rounded-[24rpx] bg-[#fbfbfb] p-[32rpx]"
@@ -370,11 +370,11 @@ onMounted(async () => {
370370 @click =" showAbout" >
371371 <view >
372372 <text class =" text-[28rpx] text-[#232338] font-medium" >
373- {{ t('settings.aboutUs') }}
374- </text >
375- <text class =" mt-[4rpx] block text-[24rpx] text-[#9d9ea3]" >
376- {{ t('settings.appVersion') }}
377- </text >
373+ {{ t('settings.aboutUs') }}
374+ </text >
375+ <text class =" mt-[4rpx] block text-[24rpx] text-[#9d9ea3]" >
376+ {{ t('settings.appVersion') }}
377+ </text >
378378 </view >
379379 <wd-icon name =" arrow-right" custom-class =" text-[32rpx] text-[#9d9ea3]" />
380380 </view >
@@ -385,24 +385,26 @@ onMounted(async () => {
385385 <view class =" mb-[32rpx]" >
386386 <view class =" mb-[24rpx] flex items-center" >
387387 <text class =" text-[32rpx] text-[#232338] font-bold" >
388- {{ t('settings.languageSettings') }}
389- </text >
388+ {{ t('settings.languageSettings') }}
389+ </text >
390390 </view >
391391
392392 <view class =" border border-[#eeeeee] rounded-[24rpx] bg-[#fbfbfb] p-[32rpx]"
393393 style =" box-shadow : 0 4 rpx 20 rpx rgba (0 , 0 , 0 , 0.06 );" >
394- <view class =" flex cursor-pointer items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx] transition-all active:bg-[#eef3ff]" @click =" showLanguageSheet = true" >
394+ <view
395+ class =" flex cursor-pointer items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx] transition-all active:bg-[#eef3ff]"
396+ @click =" showLanguageSheet = true" >
395397 <view >
396398 <text class =" text-[32rpx] text-[#232338] font-medium" >
397- {{ t('settings.language') }}
398- </text >
399- <text class =" mt-[4rpx] block text-[24rpx] text-[#9d9ea3]" >
400- {{ t('settings.selectLanguage') }}
401- </text >
399+ {{ t('settings.language') }}
400+ </text >
401+ <text class =" mt-[4rpx] block text-[24rpx] text-[#9d9ea3]" >
402+ {{ t('settings.selectLanguage') }}
403+ </text >
402404 </view >
403405 <view class =" flex items-center" >
404406 <text class =" text-[32rpx] text-[#9d9ea3] font-semibold mr-[16rpx]" >
405- {{ supportedLanguages.find(lang => lang.code === currentLanguage)?.name }}
407+ {{supportedLanguages.find(lang => lang.code === currentLanguage)?.name}}
406408 </text >
407409 <wd-icon name =" arrow-right" custom-class =" text-[32rpx] text-[#9d9ea3]" />
408410 </view >
@@ -411,19 +413,11 @@ onMounted(async () => {
411413 </view >
412414
413415 <!-- 语言选择弹窗 -->
414- <wd-action-sheet
415- v-model =" showLanguageSheet"
416- :title =" t('settings.selectLanguage')"
417- :close-on-click-modal =" true"
418- >
416+ <wd-action-sheet v-model =" showLanguageSheet" :title =" t('settings.selectLanguage')" :close-on-click-modal =" true" >
419417 <view class =" language-sheet" >
420418 <scroll-view scroll-y class =" language-list" >
421- <view
422- v-for =" lang in supportedLanguages"
423- :key =" lang.code"
424- class =" language-item"
425- @click =" handleLanguageChange(lang.code)"
426- >
419+ <view v-for =" lang in supportedLanguages" :key =" lang.code" class =" language-item"
420+ @click =" handleLanguageChange(lang.code)" >
427421 <text class =" language-name" >
428422 {{ lang.name }}
429423 </text >
@@ -446,17 +440,21 @@ onMounted(async () => {
446440.language-sheet {
447441 .language-list {
448442 max-height : 50vh ;
443+
449444 .language-item {
450445 padding : 30 rpx 0 ;
451446 text-align : center ;
452447 border-bottom : 1 rpx solid #f0f0f0 ;
448+
453449 .language-name {
454450 font-size : 28 rpx;
455451 color : #333 ;
456452 }
453+
457454 & :last-child {
458455 border-bottom : none ;
459456 }
457+
460458 & :active {
461459 background-color : #f5f7fb ;
462460 }
0 commit comments