From 100a6bc552c47e206ab7a658ca7222c8a630b111 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 29 Apr 2023 13:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en-us.json | 7 ++- src/lang/zh-cn.json | 7 ++- src/lang/zh-tw.json | 7 ++- .../components/MusicComment/CommentFloor.vue | 45 ++++++++----------- src/renderer/store/songList/state.ts | 10 ++--- .../songList/List/components/SongList.vue | 2 +- 6 files changed, 31 insertions(+), 47 deletions(-) diff --git a/src/lang/en-us.json b/src/lang/en-us.json index c8a7a639..50e03e92 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -9,7 +9,7 @@ "btn_save": "Save", "cancel_button_text": "Cancel", "close": "Close", - "comment__location": "From {location}", + "comment__location": "From{location}", "comment__hot_load_error": "Hot comments failed to load, click to try to reload", "comment__hot_loading": "Hot comments are loading", "comment__hot_title": "Hot Comment", @@ -191,9 +191,8 @@ "pagination__next": "Next page", "pagination__page": "Page {num}", "pagination__prev": "Previous page", - "play_count_million": "{count} Million", - "play_count_billion": "{count} Billion", - "play_count_none": "{count}", + "count_million": "{count} Million", + "count_billion": "{count} Billion", "play_timeout": "Timed pause", "play_timeout_close": "Close", "play_timeout_confirm": "Confirm", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index c93a50d2..deefd014 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -9,7 +9,7 @@ "btn_save": "保存", "cancel_button_text": "我不", "close": "关闭", - "comment__location": "来自 {location}", + "comment__location": "来自{location}", "comment__hot_load_error": "热门评论加载失败,点击尝试重新加载", "comment__hot_loading": "热门评论加载中", "comment__hot_title": "热门评论", @@ -191,9 +191,8 @@ "pagination__next": "下一页", "pagination__page": "第 {num} 页", "pagination__prev": "上一页", - "play_count_million": "{count} 万", - "play_count_billion": "{count} 亿", - "play_count_none": "{count}", + "count_million": "{count} 万", + "count_billion": "{count} 亿", "play_timeout": "定时暂停", "play_timeout_close": "关闭", "play_timeout_confirm": "确认", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 2e277682..83006d1b 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -9,7 +9,7 @@ "btn_save": "保存", "cancel_button_text": "取消", "close": "關閉", - "comment__location": "來自 {location}", + "comment__location": "來自{location}", "comment__hot_load_error": "熱門評論加載失敗,點擊嘗試重新加載", "comment__hot_loading": "熱門評論加載中", "comment__hot_title": "熱門評論", @@ -191,9 +191,8 @@ "pagination__next": "下一頁", "pagination__page": "第 {num} 頁", "pagination__prev": "上一頁", - "play_count_million": "{count} 萬", - "play_count_billion": "{count} 億", - "play_count_none": "{count}", + "count_million": "{count} 萬", + "count_billion": "{count} 億", "play_timeout": "定時暫停", "play_timeout_close": "關閉", "play_timeout_confirm": "確認", diff --git a/src/renderer/components/layout/PlayDetail/components/MusicComment/CommentFloor.vue b/src/renderer/components/layout/PlayDetail/components/MusicComment/CommentFloor.vue index 104f2485..9cae8e3e 100644 --- a/src/renderer/components/layout/PlayDetail/components/MusicComment/CommentFloor.vue +++ b/src/renderer/components/layout/PlayDetail/components/MusicComment/CommentFloor.vue @@ -11,7 +11,7 @@ div(:class="$style.container") div.select(:class="$style.name") {{item.userName}} div(:class="$style.metaInfo") time(:class="$style.label" v-if="item.timeStr") {{timeFormat(item.timeStr)}} - div(:class="[$style.label, $style.location]" v-if="item.location") {{$t('comment__location', { location: item.location })}} + div(:class="$style.label" v-if="item.location") {{$t('comment__location', { location: item.location })}} div(:class="$style.likes" v-if="item.likedCount != null") svg(:class="$style.likesIcon" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' viewBox='0 0 512 512' space='preserve') use(xlink:href='#icon-thumbs-up') @@ -88,34 +88,26 @@ export default { .info { display: flex; flex-flow: row nowrap; - align-items: flex-end; - min-width: 0; - font-size: inherit; - vertical-align: baseline; + gap: 15px; + width: 100%; + height: 40px; + line-height: 1.3; color: var(--color-450); } .baseInfo { - display: table-cell; - height: 40px; - overflow: hidden; - text-overflow: ellipsis; - word-wrap: break-word; - word-break: break-all; - white-space: normal !important; - text-align: justify; + height: 100%; + flex: auto; + display: flex; min-width: 0; - line-height: 1.6; - color: var(--color-450); + flex-flow: column nowrap; + justify-content: space-evenly; } .metaInfo { - position: relative; - display: inline-block; - .label { - float: left; - } - .location{ - margin-left: 10px; - } + display: flex; + flex-flow: row nowrap; + min-width: 0; + gap: 10px; + overflow: hidden; } .name { flex: 0 1 auto; @@ -129,11 +121,11 @@ export default { // margin-left: 5px; } .likes { - flex: 1 0 auto; - margin-left: 10px; + flex: none; font-size: 11px; - align-self: flex-end; text-align: right; + padding-top: 3px; + align-self: flex-start; } .likesIcon { width: 12px; @@ -144,7 +136,6 @@ export default { .comment_text { text-align: justify; font-size: 14px; - padding-top: 5px; line-height: 1.5; word-break: break-all; overflow-wrap: break-word; diff --git a/src/renderer/store/songList/state.ts b/src/renderer/store/songList/state.ts index cbea3e2a..061fa720 100644 --- a/src/renderer/store/songList/state.ts +++ b/src/renderer/store/songList/state.ts @@ -37,13 +37,9 @@ type Tags = Partial> export const tags = shallowReactive({}) -interface PlayCount { - count: number - lang: 'play_count_none' | 'play_count_million' | 'play_count_billion' -} export declare interface ListInfoItem { - play_count: PlayCount + play_count: string id: string author: string name: string @@ -80,7 +76,7 @@ export declare interface ListDetailInfo { img?: string desc?: string author?: string - play_count?: PlayCount + play_count?: string } noItemLabel: string } @@ -111,7 +107,7 @@ export const listDetailInfo = reactive({ }) export const selectListInfo = markRaw({ - play_count: { lang: 'play_count_none', count: 0 }, + play_count: '', id: '', author: '', name: '', diff --git a/src/renderer/views/songList/List/components/SongList.vue b/src/renderer/views/songList/List/components/SongList.vue index fb0c98d9..b2b826aa 100644 --- a/src/renderer/views/songList/List/components/SongList.vue +++ b/src/renderer/views/songList/List/components/SongList.vue @@ -13,7 +13,7 @@

{{ item.time }}

{{ item.total }} - {{ $t(item.play_count.lang, { count: item.play_count.count }) }} + {{ item.play_count }} {{ item.source }}