完成歌曲列表分离

pull/96/head
lyswhut 2019-09-01 19:24:38 +08:00
parent 78c0badd95
commit d48308d913
7 changed files with 47 additions and 105 deletions

View File

@ -48,6 +48,8 @@
软件下载请转到:[发布页面](https://github.com/lyswhut/lx-music-desktop/releases)<br>
或者到网盘下载网盘内有MAC、windows版`https://www.lanzous.com/b906260/` 密码:`glqw`
注意win7需要开启**透明效果**软件才可使用
#### 关于软件更新
软件启动时若发现新版本时会自动从本仓库下载安装包,下载完毕会弹窗提示更新。<br>

View File

@ -1,10 +1,11 @@
### 新增
- 在设置界面-关于洛雪音乐说明部分新增**最新版网盘下载地址**与**打赏地址**
- 新增酷我、酷狗、百度源**歌单**
- 在设置界面-关于洛雪音乐说明部分新增**最新版网盘下载地址**与**打赏地址**
- 新增酷狗 电音热歌榜、DJ热歌榜
### 优化
- 目前使用的测试接口与临时接口已趋于稳定
- 目前使用的测试接口与临时接口已逐渐趋于稳定
- 测试接口支持**酷我、酷狗、百度、网易云**源直接播放与下载
- 临时接口仅支持**酷我**源直接播放与下载

View File

@ -10,8 +10,8 @@ div(:class="$style.songList")
:indeterminate="isIndeterminate" :title="isSelectAll && !isIndeterminate ? '全不选' : '全选'")
th.nobreak(style="width: 25%;") 歌曲名
th.nobreak(style="width: 20%;") 歌手
th.nobreak(style="width: 25%;") 专辑
th.nobreak(style="width: 15%;") 操作
th.nobreak(style="width: 22%;") 专辑
th.nobreak(style="width: 18%;") 操作
th.nobreak(style="width: 10%;") 时长
div.scroll(:class="$style.tbody" ref="dom_scrollContent")
table
@ -24,15 +24,17 @@ div(:class="$style.songList")
span.badge.badge-info(v-if="item._types['320k']") 高品质
span.badge.badge-success(v-if="item._types.ape || item._types.flac") 无损
td.break(style="width: 20%;") {{item.singer}}
td.break(style="width: 25%;") {{item.albumName}}
td(style="width: 15%;")
material-list-buttons(:index="index" :search-btn="true" :remove-btn="false" @btn-click="handleListBtnClick"
:play-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :download-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')")
td(style="width: 10%;") {{item.interval}}
td.break(style="width: 22%;") {{item.albumName}}
td(style="width: 18%;")
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")
//- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)')
//- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)')
//- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)')
td(style="width: 10%;") {{item.interval || '--/--'}}
div(:class="$style.pagination")
material-pagination(:count="total" :limit="limit" :page="page" @btn-click="handleTogglePage")
div(v-else :class="$style.noitem")
p 搜我所想~~😉
p(v-html="noitem")
material-flow-btn(:show="isShowEditBtn && (source == 'kw' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick")
</template>
@ -70,6 +72,10 @@ export default {
source: {
type: String,
},
noitem: {
type: String,
default: '搜我所想~~😉',
},
},
computed: {
...mapGetters(['setting']),

View File

@ -5,12 +5,12 @@ export default {
list: [
{
id: 'kgtop500',
name: '酷狗TOP500',
name: 'TOP500',
bangid: '8888',
},
{
id: 'kgwlhgb',
name: '网络红歌榜',
name: '网络榜',
bangid: '23784',
},
{
@ -30,29 +30,29 @@ export default {
},
{
id: 'kggfjqb',
name: '古风金曲榜',
name: '古风榜',
bangid: '33161',
},
{
id: 'kgyyjqb',
name: '粤语金曲榜',
name: '粤语榜',
bangid: '33165',
},
{
id: 'kgomjqb',
name: '欧美金曲榜',
name: '欧美榜',
bangid: '33166',
},
// {
// id: 'kgdyrgb',
// name: '电音热歌榜',
// bangid: '33160',
// },
// {
// id: 'kgjdrgb',
// name: 'DJ热歌榜',
// bangid: '24971',
// },
{
id: 'kgdyrgb',
name: '电音热歌榜',
bangid: '33160',
},
{
id: 'kgjdrgb',
name: 'DJ热歌榜',
bangid: '24971',
},
// {
// id: 'kghyxgb',
// name: '华语新歌榜',

View File

@ -6,7 +6,6 @@
material-song-list(v-model="selectdData" @action="handleSongListAction" :source="source" :page="page" :limit="info.limit" :total="info.total" :list="list")
material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false")
material-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false")
material-flow-btn(:show="isShowEditBtn && (source == 'kw' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick")
</template>
<script>
@ -18,14 +17,9 @@ export default {
tabId: null,
source: null,
page: 1,
clickTime: 0,
clickIndex: -1,
isShowDownload: false,
musicInfo: null,
selectdData: [],
isSelectAll: false,
isIndeterminate: false,
isShowEditBtn: false,
isShowDownloadMultiple: false,
}
},
@ -52,20 +46,6 @@ export default {
this.setLeaderboard({ source: n })
if (o) this.tabId = this.types[0] && this.types[0].id
},
// selectdData(n) {
// const len = n.length
// if (len) {
// this.isSelectAll = true
// this.isIndeterminate = len !== this.list.length
// this.isShowEditBtn = true
// } else {
// this.isSelectAll = false
// this.isShowEditBtn = false
// }
// },
list() {
this.resetSelect()
},
},
mounted() {
this.source = this.setting.leaderboard.source
@ -78,19 +58,6 @@ export default {
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
...mapMutations('list', ['defaultListAdd', 'defaultListAddMultiple']),
...mapMutations('player', ['setList']),
handleDoubleClick(index) {
if (
window.performance.now() - this.clickTime > 400 ||
this.clickIndex !== index
) {
this.clickTime = window.performance.now()
this.clickIndex = index
return
}
(this.source == 'kw' || (!this.isAPITemp && this.list[index].source != 'tx')) ? this.testPlay(index) : this.handleSearch(index)
this.clickTime = 0
this.clickIndex = -1
},
handleListBtnClick(info) {
switch (info.action) {
case 'download':
@ -143,13 +110,6 @@ export default {
this.page = this.info.page
})
},
handleSelectAllData(isSelect) {
this.selectdData = isSelect ? [...this.list] : []
},
resetSelect() {
this.isSelectAll = false
this.selectdData = []
},
handleAddDownload(type) {
this.createDownload({ musicInfo: this.musicInfo, type })
this.isShowDownload = false
@ -161,7 +121,6 @@ export default {
type = '128k'
}
this.createDownloadMultiple({ list: [...this.selectdData], type })
this.resetSelect()
this.isShowDownloadMultiple = false
},
handleFlowBtnClick(action) {
@ -171,16 +130,25 @@ export default {
break
case 'play':
this.testPlay()
this.resetSelect()
break
case 'add':
this.defaultListAddMultiple(this.selectdData)
this.resetSelect()
break
}
},
handleSongListAction({ action, data }) {
console.log(action, data)
switch (action) {
case 'listBtnClick':
return this.handleListBtnClick(data)
case 'togglePage':
return this.handleTogglePage(data)
case 'flowBtnClick':
return this.handleFlowBtnClick(data)
case 'testPlay':
return this.testPlay(data)
case 'search':
return this.handleSearch(data)
}
},
},
}

View File

@ -184,7 +184,7 @@ export default {
// },
{
id: 'test',
label: '测试接口(软件的大部分功能可用,该接口访问速度慢)',
label: '测试接口(软件的大部分功能可用,该接口访问速度慢)',
disabled: false,
},
{

View File

@ -3,43 +3,8 @@
div(:class="$style.header")
//- material-tab(:class="$style.tab" :list="types" item-key="id" item-name="name" v-model="sortId")
//- material-select(:class="$style.select" :list="sourceInfo.sources" item-key="id" item-name="name" v-model="source")
//- div(:class="$style.content")
div(v-if="list.length" :class="$style.list")
div(:class="$style.thead")
table
thead
tr
th.nobreak.center(style="width: 37px;")
material-checkbox(id="search_select_all" v-model="isSelectAll" @change="handleSelectAllData"
:indeterminate="isIndeterminate" :title="isSelectAll && !isIndeterminate ? '全不选' : '全选'")
th.nobreak(style="width: 25%;") 歌曲名
th.nobreak(style="width: 20%;") 歌手
th.nobreak(style="width: 22%;") 专辑
th.nobreak(style="width: 18%;") 操作
th.nobreak(style="width: 10%;") 时长
div.scroll(:class="$style.tbody" ref="dom_scrollContent")
table
tbody
tr(v-for='(item, index) in list' :key='item.songmid' @click="handleDoubleClick(index)")
td.nobreak.center(style="width: 37px;" @click.stop)
material-checkbox(:id="index.toString()" v-model="selectdData" :value="item")
td.break(style="width: 25%;")
| {{item.name}}
//- span.badge.badge-info(v-if="item._types['320k']")
//- span.badge.badge-success(v-if="item._types.ape || item._types.flac")
td.break(style="width: 20%;") {{item.singer}}
td.break(style="width: 22%;") {{item.albumName}}
td(style="width: 18%;")
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")
//- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)')
//- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)')
//- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)')
td(style="width: 10%;") {{item.interval || '--/--'}}
div(:class="$style.pagination")
material-pagination(:count="info.total" :limit="info.limit" :page="info.page" @btn-click="handleTogglePage")
material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false")
material-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false")
material-flow-btn(:show="isShowEditBtn && (source == 'kw' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick")
</template>
<script>