Skip to content

Commit 67ff5e5

Browse files
committed
优化列表加载体验,移除失效源
1 parent 22d56d3 commit 67ff5e5

9 files changed

Lines changed: 50 additions & 25 deletions

File tree

publish/changeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
### 优化
88

99
- 略微优化最小化按钮字符
10+
- 优化试听列表的加载体验,当歌曲数过多时列表将延迟加载
1011

1112
### 修复
1213

1314
- 修复下载管理的一些Bug
1415

16+
### 移除
17+
18+
- 因接口失效,移除网易云音源,酷狗音源仅支持播放128k音质

src/renderer/components/core/Toolbar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ each(@themes, {
105105
content: ' ';
106106
display: block;
107107
border-radius: 50%;
108-
width: 13px;
109-
height: 13px;
108+
width: 14px;
109+
height: 14px;
110110
transition: background-color 0.2s ease-in-out;
111111
}
112112
@@ -145,7 +145,7 @@ each(@themes, {
145145
width: 8px;
146146
height: 2px;
147147
left: @height-toolbar / 2 - 4;
148-
top: @height-toolbar / 2;
148+
top: @height-toolbar / 2 - 1;
149149
background-color: #fff;
150150
}
151151
}

src/renderer/components/material/DownloadModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ material-modal(:show="show" :bg-close="bgClose" @close="handleClose")
55
| {{ info.name }}
66
br
77
| {{ info.singer }}
8-
material-btn(:class="$style.btn" :title="!checkSource(type.type) && '目前网易云音源仅支持下载128k音质'" :disabled="!checkSource(type.type)" :key="type.type" @click="handleClick(type.type)" v-for="type in info.types") {{getTypeName(type.type)}} {{ type.type.toUpperCase() }}{{ type.size && ` - ${type.size.toUpperCase()}` }}
8+
material-btn(:class="$style.btn" :title="!checkSource(type.type) && '目前酷狗音源仅支持下载128k音质'" :disabled="!checkSource(type.type)" :key="type.type" @click="handleClick(type.type)" v-for="type in info.types") {{getTypeName(type.type)}} {{ type.type.toUpperCase() }}{{ type.size && ` - ${type.size.toUpperCase()}` }}
99

1010
</template>
1111

@@ -52,7 +52,7 @@ export default {
5252
checkSource(type) {
5353
switch (this.musicInfo.source) {
5454
case 'wy':
55-
// case 'kg':
55+
case 'kg':
5656
return type == '128k'
5757
5858
default:

src/renderer/components/material/SongList.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ div(:class="$style.songList")
2727
td.break(style="width: 20%;") {{item.singer}}
2828
td.break(style="width: 22%;") {{item.albumName}}
2929
td(style="width: 18%;")
30-
material-list-buttons(:index="index" :search-btn="true" :play-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :download-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :remove-btn="false" @btn-click="handleListBtnClick")
30+
material-list-buttons(:index="index" :search-btn="true" :play-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx' && item.source != 'wy')" :download-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx' && item.source != 'wy')" :remove-btn="false" @btn-click="handleListBtnClick")
3131
//- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)') 下载
3232
//- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)') 试听
3333
//- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)') +
@@ -136,7 +136,7 @@ export default {
136136
this.clickIndex = index
137137
return
138138
}
139-
this.emitEvent((this.source == 'kw' || (!this.isAPITemp && this.list[index].source != 'tx')) ? 'testPlay' : 'search', index)
139+
this.emitEvent((this.source == 'kw' || (!this.isAPITemp && this.list[index].source != 'tx' && this.list[index].source != 'wy')) ? 'testPlay' : 'search', index)
140140
this.clickTime = 0
141141
this.clickIndex = -1
142142
},

src/renderer/utils/music/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
const types = ['flac', 'ape', '320k', '192k', '128k']
88
export const getMusicType = (info, type) => {
99
switch (window.globalObj.apiSource) {
10-
// case 'kg':
10+
case 'kg':
1111
case 'wy':
1212
return '128k'
1313
}

src/renderer/views/Leaderboard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default {
117117
},
118118
handleAddDownloadMultiple(type) {
119119
switch (this.source) {
120-
// case 'kg':
120+
case 'kg':
121121
case 'wy':
122122
type = '128k'
123123
}

src/renderer/views/List.vue

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template lang="pug">
22
div(:class="$style.list")
33
//- transition
4-
div(v-if="list.length" :class="$style.content")
4+
div(v-if="delayShow && list.length" :class="$style.content")
55
div(:class="$style.thead")
66
table
77
thead
@@ -18,7 +18,7 @@
1818
table
1919
tbody
2020
tr(v-for='(item, index) in list' :key='item.songmid'
21-
@click="handleDoubleClick(index)" :class="[isPlayList && playIndex === index ? $style.active : '', (isAPITemp && item.source != 'kw') || item.source == 'tx' ? $style.disabled : '']")
21+
@click="handleDoubleClick(index)" :class="[isPlayList && playIndex === index ? $style.active : '', (isAPITemp && item.source != 'kw') || item.source == 'tx' || item.source == 'wy' ? $style.disabled : '']")
2222
td.nobreak.center(style="width: 37px;" @click.stop)
2323
material-checkbox(:id="index.toString()" v-model="selectdData" :value="item")
2424
td.break(style="width: 25%;") {{item.name}}
@@ -37,6 +37,7 @@
3737
//- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)') +
3838
td(style="width: 10%;") {{item.interval || '--/--'}}
3939
div(:class="$style.noItem" v-else)
40+
p 加载中...
4041
material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false")
4142
material-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false")
4243
material-flow-btn(:show="isShowEditBtn" :add-btn="false" :play-btn="false" @btn-click="handleFlowBtnClick")
@@ -57,6 +58,7 @@ export default {
5758
isIndeterminate: false,
5859
isShowEditBtn: false,
5960
isShowDownloadMultiple: false,
61+
delayShow: false,
6062
}
6163
},
6264
computed: {
@@ -119,6 +121,11 @@ export default {
119121
// this.handleSearch(this.text, this.page)
120122
// }
121123
// },
124+
mounted() {
125+
if (this.list.length > 150) {
126+
setTimeout(() => this.delayShow = true, 200)
127+
} else this.delayShow = true
128+
},
122129
methods: {
123130
...mapMutations('list', ['defaultListRemove', 'defaultListRemoveMultiple']),
124131
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
@@ -137,7 +144,7 @@ export default {
137144
this.clickIndex = -1
138145
},
139146
testPlay(index) {
140-
if ((this.isAPITemp && this.list[index].source != 'kw') || this.list[index].source == 'tx') return
147+
if ((this.isAPITemp && this.list[index].source != 'kw') || this.list[index].source == 'tx' || this.list[index].source == 'wy') return
141148
this.setList({ list: this.list, listId: 'test', index })
142149
},
143150
handleRemove(index) {
@@ -147,7 +154,7 @@ export default {
147154
switch (info.action) {
148155
case 'download':
149156
const minfo = this.list[info.index]
150-
if ((this.isAPITemp && minfo.source != 'kw') || minfo.source == 'tx') return
157+
if ((this.isAPITemp && minfo.source != 'kw') || minfo.source == 'tx' || minfo.source == 'wy') return
151158
this.musicInfo = minfo
152159
this.$nextTick(() => {
153160
this.isShowDownload = true
@@ -173,7 +180,7 @@ export default {
173180
this.selectdData = []
174181
},
175182
handleAddDownloadMultiple(type) {
176-
const list = this.setting.apiSource == 'temp' ? this.selectdData.filter(s => s.source == 'kw') : this.selectdData.filter(s => s.source != 'tx')
183+
const list = this.setting.apiSource == 'temp' ? this.selectdData.filter(s => s.source == 'kw') : this.selectdData.filter(s => s.source != 'tx' && s.source != 'wy')
177184
this.createDownloadMultiple({ list, type })
178185
this.resetSelect()
179186
this.isShowDownloadMultiple = false
@@ -239,6 +246,20 @@ export default {
239246
opacity: .5;
240247
}
241248
249+
.no-item {
250+
position: relative;
251+
height: 100%;
252+
display: flex;
253+
flex-flow: column nowrap;
254+
justify-content: center;
255+
align-items: center;
256+
257+
p {
258+
font-size: 24px;
259+
color: #ccc;
260+
}
261+
}
262+
242263
each(@themes, {
243264
:global(#container.@{value}) {
244265
.tbody {

src/renderer/views/Setting.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,6 @@ div.scroll(:class="$style.setting")
103103
p.small
104104
| 软件的常见问题可转至:
105105
span.hover.underline(title="点击打开" @click="handleOpenUrl('https://github.com/lyswhut/lx-music-desktop#常见问题')") 常见问题
106-
p.small
107-
| 本软件仅用于学习交流使用,禁止将本软件用于
108-
strong 非法用途
109-
| 或
110-
strong 商业用途
111-
| 。
112-
p.small
113-
| 使用本软件造成的一切后果由
114-
strong 使用者
115-
| 承担!
116106
//- p.small
117107
| 怀念曾经的
118108
strong @messoer
@@ -130,6 +120,16 @@ div.scroll(:class="$style.setting")
130120
span 如果你资金充裕,还可以
131121
material-btn(@click="handleOpenUrl('https://cdn.stsky.cn/qrc.png')" min title="土豪,你好 🙂") 打赏下作者
132122
span ,以帮我分担点服务器费用~❤️
123+
p.small
124+
| 本软件仅用于学习交流使用,禁止将本软件用于
125+
strong 非法用途
126+
| 或
127+
strong 商业用途
128+
| 。
129+
p.small
130+
| 使用本软件造成的一切后果由
131+
strong 使用者
132+
| 承担!
133133
p
134134
small By:
135135
| 落雪无痕

src/renderer/views/SongList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export default {
191191
},
192192
handleAddDownloadMultiple(type) {
193193
switch (this.source) {
194-
// case 'kg':
194+
case 'kg':
195195
case 'wy':
196196
type = '128k'
197197
}

0 commit comments

Comments
 (0)