恢复QQ音乐源128k音质试听

pull/166/head
lyswhut 2020-01-11 17:45:22 +08:00
parent 54354518d0
commit e4c19c0f2a
7 changed files with 18 additions and 17 deletions

View File

@ -1,6 +1,7 @@
### 新增 ### 新增
- 新增各大平台歌单热门标签显示(显示在歌单界面的第一个下拉标签菜单中) - 新增各大平台歌单热门标签显示(显示在歌单界面的第一个下拉标签菜单中)
- 恢复QQ音乐源128k音质试听
### 优化 ### 优化

View File

@ -339,7 +339,7 @@ export default {
} else if (this.isAPITemp) { } else if (this.isAPITemp) {
list = this.list.filter(s => s.source == 'kw') list = this.list.filter(s => s.source == 'kw')
} else { } else {
list = this.list.filter(s => s.source != 'tx') list = [...this.list]
} }
if (!list.length) return this.setPlayIndex(-1) if (!list.length) return this.setPlayIndex(-1)
let playIndex = this.list === list ? this.playIndex : list.indexOf(this.list[this.playIndex]) let playIndex = this.list === list ? this.playIndex : list.indexOf(this.list[this.playIndex])

View File

@ -30,8 +30,8 @@ div(:class="$style.songList")
material-list-buttons(:index="index" :search-btn="true" material-list-buttons(:index="index" :search-btn="true"
:remove-btn="false" @btn-click="handleListBtnClick" :remove-btn="false" @btn-click="handleListBtnClick"
:listAdd-btn="item.source == 'kw' || !isAPITemp" :listAdd-btn="item.source == 'kw' || !isAPITemp"
:play-btn="item.source != 'tx' && (item.source == 'kw' || !isAPITemp)" :play-btn="item.source == 'kw' || !isAPITemp"
:download-btn="item.source != 'tx' && (item.source == 'kw' || !isAPITemp)") :download-btn="item.source == 'kw' || !isAPITemp")
//- 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-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-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)') //- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)')
@ -40,7 +40,7 @@ div(:class="$style.songList")
material-pagination(:count="total" :limit="limit" :page="page" @btn-click="handleTogglePage") material-pagination(:count="total" :limit="limit" :page="page" @btn-click="handleTogglePage")
div(v-else :class="$style.noitem") div(v-else :class="$style.noitem")
p(v-html="noItem") p(v-html="noItem")
material-flow-btn(:show="isShowEditBtn && source != 'tx' && (source == 'kw' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick") material-flow-btn(:show="isShowEditBtn && (source == 'kw' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick")
</template> </template>
<script> <script>
@ -140,7 +140,7 @@ export default {
this.clickIndex = index this.clickIndex = index
return return
} }
this.emitEvent((this.source != 'tx' && (this.source == 'kw' || !this.isAPITemp)) ? 'testPlay' : 'search', index) this.emitEvent((this.source == 'kw' || !this.isAPITemp) ? 'testPlay' : 'search', index)
this.clickTime = 0 this.clickTime = 0
this.clickIndex = -1 this.clickIndex = -1
}, },

View File

@ -4,7 +4,7 @@ import { headers, timeout } from '../options'
const api_messoer = { const api_messoer = {
getMusicUrl(songInfo, type) { getMusicUrl(songInfo, type) {
const requestObj = httpFetch(`http://ts.tempmusic.tk/url/tx/${songInfo.strMediaMid}/${type}`, { const requestObj = httpFetch(`http://ts.tempmusic.tk/url/tx/${songInfo.songmid}/${type}`, {
method: 'get', method: 'get',
timeout, timeout,
headers, headers,

View File

@ -18,7 +18,7 @@
table table
tbody tbody
tr(v-for='(item, index) in list' :key='item.songmid' :id="'mid_' + item.songmid" tr(v-for='(item, index) in list' :key='item.songmid' :id="'mid_' + item.songmid"
@click="handleDoubleClick(index)" :class="[isPlayList && playIndex === index ? $style.active : '', (isAPITemp && item.source != 'kw') || item.source == 'tx' ? $style.disabled : '']") @click="handleDoubleClick(index)" :class="[isPlayList && playIndex === index ? $style.active : '', (isAPITemp && item.source != 'kw') ? $style.disabled : '']")
td.nobreak.center(style="width: 37px;" @click.stop) td.nobreak.center(style="width: 37px;" @click.stop)
material-checkbox(:id="index.toString()" v-model="selectdData" :value="item") material-checkbox(:id="index.toString()" v-model="selectdData" :value="item")
td.break(style="width: 25%;") td.break(style="width: 25%;")
@ -243,7 +243,7 @@ export default {
this.clickIndex = -1 this.clickIndex = -1
}, },
testPlay(index) { testPlay(index) {
if (this.list[index].source == 'tx' || (this.isAPITemp && this.list[index].source != 'kw')) return if (this.isAPITemp && this.list[index].source != 'kw') return
this.setPlayList({ list: this.list, listId: this.listId, index }) this.setPlayList({ list: this.list, listId: this.listId, index })
}, },
handleRemove(index) { handleRemove(index) {
@ -253,7 +253,7 @@ export default {
switch (info.action) { switch (info.action) {
case 'download': { case 'download': {
const minfo = this.list[info.index] const minfo = this.list[info.index]
if ((this.isAPITemp && minfo.source != 'kw') || minfo.source == 'tx') return if (this.isAPITemp && minfo.source != 'kw') return
this.musicInfo = minfo this.musicInfo = minfo
this.$nextTick(() => { this.$nextTick(() => {
this.isShowDownload = true this.isShowDownload = true
@ -286,7 +286,7 @@ export default {
this.selectdData = [] this.selectdData = []
}, },
handleAddDownloadMultiple(type) { handleAddDownloadMultiple(type) {
const list = this.setting.apiSource == 'temp' ? this.selectdData.filter(s => s.source == 'kw') : this.selectdData.filter(s => s.source != 'tx') const list = this.setting.apiSource == 'temp' ? this.selectdData.filter(s => s.source == 'kw') : [...this.selectdData]
this.createDownloadMultiple({ list, type }) this.createDownloadMultiple({ list, type })
this.resetSelect() this.resetSelect()
this.isShowDownloadMultiple = false this.isShowDownloadMultiple = false

View File

@ -31,8 +31,8 @@
td.break(style="width: 25%;") {{item.albumName}} td.break(style="width: 25%;") {{item.albumName}}
td(style="width: 15%; padding-left: 0; padding-right: 0;") td(style="width: 15%; padding-left: 0; padding-right: 0;")
material-list-buttons(:index="index" :remove-btn="false" :class="$style.listBtn" material-list-buttons(:index="index" :remove-btn="false" :class="$style.listBtn"
:play-btn="item.source != 'tx' && (item.source == 'kw' || !isAPITemp)" :play-btn="item.source == 'kw' || !isAPITemp"
:download-btn="item.source != 'tx' && (item.source == 'kw' || !isAPITemp)" :download-btn="item.source == 'kw' || !isAPITemp"
@btn-click="handleListBtnClick") @btn-click="handleListBtnClick")
td(style="width: 10%;") {{item.interval || '--/--'}} td(style="width: 10%;") {{item.interval || '--/--'}}
div(:class="$style.pagination") div(:class="$style.pagination")
@ -41,7 +41,7 @@
p 搜我所想~~😉 p 搜我所想~~😉
material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false") 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-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false")
material-flow-btn(:show="isShowEditBtn && searchSourceId != 'tx' && (searchSourceId == 'kw' || searchSourceId == 'all' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick") material-flow-btn(:show="isShowEditBtn && (searchSourceId == 'kw' || searchSourceId == 'all' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick")
material-list-add-modal(:show="isShowListAdd" :musicInfo="musicInfo" @close="isShowListAdd = false") material-list-add-modal(:show="isShowListAdd" :musicInfo="musicInfo" @close="isShowListAdd = false")
material-list-add-multiple-modal(:show="isShowListAddMultiple" :musicList="selectdData" @close="handleListAddModalClose") material-list-add-multiple-modal(:show="isShowListAddMultiple" :musicList="selectdData" @close="handleListAddModalClose")
</template> </template>
@ -190,7 +190,7 @@ export default {
targetSong = this.selectdData[0] targetSong = this.selectdData[0]
this.listAddMultiple({ id: 'default', list: this.filterList(this.selectdData) }) this.listAddMultiple({ id: 'default', list: this.filterList(this.selectdData) })
} else { } else {
if (this.listInfo.list[index].source == 'tx' || (this.isAPITemp && this.listInfo.list[index].source != 'kw')) return if (this.isAPITemp && this.listInfo.list[index].source != 'kw') return
targetSong = this.listInfo.list[index] targetSong = this.listInfo.list[index]
this.listAdd({ id: 'default', musicInfo: targetSong }) this.listAdd({ id: 'default', musicInfo: targetSong })
} }
@ -239,7 +239,7 @@ export default {
} }
}, },
filterList(list) { filterList(list) {
return this.setting.apiSource == 'temp' ? list.filter(s => s.source == 'kw') : list.filter(s => s.source != 'tx') return this.setting.apiSource == 'temp' ? list.filter(s => s.source == 'kw') : [...list]
}, },
handleListAddModalClose(isSelect) { handleListAddModalClose(isSelect) {
if (isSelect) this.resetSelect() if (isSelect) this.resetSelect()

View File

@ -188,7 +188,7 @@ export default {
this.resetSelect() this.resetSelect()
} else { } else {
targetSong = this.listDetail.list[index] targetSong = this.listDetail.list[index]
if (targetSong.source == 'tx' || (this.isAPITemp && targetSong.source != 'kw')) return if (this.isAPITemp && targetSong.source != 'kw') return
this.listAdd({ id: 'default', musicInfo: targetSong }) this.listAdd({ id: 'default', musicInfo: targetSong })
} }
let targetIndex = this.defaultList.list.findIndex( let targetIndex = this.defaultList.list.findIndex(
@ -348,7 +348,7 @@ export default {
this.importSongListText = text.replace(regx, '$1') this.importSongListText = text.replace(regx, '$1')
}, },
filterList(list) { filterList(list) {
return this.setting.apiSource == 'temp' ? list.filter(s => s.source == 'kw') : list.filter(s => s.source != 'tx') return this.setting.apiSource == 'temp' ? list.filter(s => s.source == 'kw') : [...list]
}, },
/* addSongListDetail() { /* addSongListDetail() {
// this.detailLoading = true // this.detailLoading = true