Skip to content

Commit f7fad09

Browse files
committed
发吧V2.0.0
1 parent 1a82e0e commit f7fad09

File tree

9 files changed

+102
-37
lines changed

9 files changed

+102
-37
lines changed

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"scripts": {
99
"build": "node .electron-vue/build.js && electron-builder",
1010
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
11+
"build:linux": "node .electron-vue/build.js && electron-builder -l dir deb AppImage pacman",
12+
"build:mac": "node .electron-vue/build.js && electron-builder -m",
13+
"build:win": "node .electron-vue/build.js && electron-builder -w",
1114
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
1215
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
1316
"dev": "node .electron-vue/dev-runner.js",
@@ -55,7 +58,14 @@
5558
},
5659
"linux": {
5760
"icon": "build/icons",
58-
"category": "AudioVideo;Player;Music;"
61+
"category": "AudioVideo;Audio;Player;Music;"
62+
},
63+
"pacman": {
64+
"depends": ["gconf", "libnotify", "nss", "libxss", "libappindicator-gtk3", "libxtst"]
65+
},
66+
"nsis": {
67+
"oneClick": false,
68+
"allowToChangeInstallationDirectory": true
5969
}
6070
},
6171
"dependencies": {

src/main/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function createWindow () {
2525
* Initial window options
2626
*/
2727
mainWindow = new BrowserWindow({
28-
height: 610,
28+
height: 630, // 尤其是 有着1T 显存的 gt630 战术核显卡,只要一发就能摧毁一个航母战斗群。
2929
useContentSize: true,
3030
width: 1020,
3131
autoHideMenuBar: false,

src/renderer/App.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ export default {
2727

2828
<style>
2929
a:hover,a:active,a:visited,a:focus {
30-
outline: none;
31-
box-shadow: none;
32-
text-decoration: none;
30+
outline: none !important;
31+
box-shadow: none !important;
32+
text-decoration: none !important;
33+
}
34+
.tab {
35+
border-bottom: none !important;
3336
}
3437
#app {
3538
user-select: none;

src/renderer/components/Search.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<button class="btn btn-block" v-show="!isEnd" :class="{'loading': loading}"
1212
@click="!isEnd && search(page + 1)">更多</button>
13-
<div class="divider text-center" data-content="没有了" v-show="isEnd" ></div>
13+
<div class="divider text-center" data-content="没有了" v-show="isEnd && songList.length" ></div>
1414
</div>
1515
</template>
1616
<script>
@@ -70,5 +70,7 @@ export default {
7070
position: relative;
7171
top: 20px;
7272
}
73-
73+
.btn-block {
74+
margin-bottom: 30px;
75+
}
7476
</style>

src/renderer/components/SingerList.vue

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,49 @@
11
<template>
22
<div class="singer-list">
33
<div class="singer-type-list">
4-
<div class="singer-country">
54

5+
<div class="singer-type-item">
66
<button class="btn btn-link"
7-
@click="selectCountry = code, getTheSingeList(1)"
8-
v-for="(code, country) in singertypeList"
9-
:key="code"
10-
:disabled="code !== selectCountry && loading"
11-
:class="{'active': code === selectCountry, 'loading': code === selectCountry && loading}" >
12-
{{country}}
7+
@click="selectTag.index = tag.id, getTheSingeList(1)"
8+
v-for="tag in tagList.index"
9+
:key="tag.id"
10+
:disabled="tag.id !== selectTag.index && loading"
11+
:class="{'active': tag.id === selectTag.index, 'loading': tag.id === selectTag.index && loading}" >
12+
{{tag.name}}
1313
</button>
14+
</div>
1415

16+
<div class="singer-type-item d-inline-block">
17+
<button class="btn btn-link"
18+
@click="selectTag.area = tag.id, getTheSingeList(1)"
19+
v-for="tag in tagList.area"
20+
:key="tag.id"
21+
:disabled="tag.id !== selectTag.area && loading"
22+
:class="{'active': tag.id === selectTag.area, 'loading': tag.id === selectTag.area && loading}">
23+
{{tag.name}}
24+
</button>
1525
</div>
16-
<div class="singer-firstname">
1726

27+
<div class="singer-type-item d-inline-block">
1828
<button class="btn btn-link"
19-
@click="selectName = code, getTheSingeList(1)"
20-
v-for="(code, name) in singerNameList"
21-
:key="code"
22-
:disabled="code !== selectName && loading"
23-
:class="{'active': code === selectName, 'loading': code === selectName && loading}">
24-
{{name}}
29+
@click="selectTag.sex = tag.id, getTheSingeList(1)"
30+
v-for="tag in tagList.sex"
31+
:key="tag.id"
32+
:disabled="tag.id !== selectTag.sex && loading"
33+
:class="{'active': tag.id === selectTag.sex, 'loading': tag.id === selectTag.sex && loading}">
34+
{{tag.name}}
2535
</button>
36+
</div>
2637

38+
<div class="singer-type-item">
39+
<button class="btn btn-link"
40+
@click="selectTag.genre = tag.id, getTheSingeList(1)"
41+
v-for="tag in tagList.genre"
42+
:key="tag.id"
43+
:disabled="tag.id !== selectTag.genre && loading"
44+
:class="{'active': tag.id === selectTag.genre, 'loading': tag.id === selectTag.genre && loading}">
45+
{{tag.name}}
46+
</button>
2747
</div>
2848
</div>
2949

@@ -48,8 +68,8 @@
4868
</template>
4969
<script>
5070
import singerAvatar from './SingerAvatar'
51-
import { singertypeList, singerNameList } from './common/SingerList.js'
52-
import {getSingerList} from '../../spider'
71+
import {tag} from './common/SingerList.js'
72+
import {getNewSingerList} from '../../spider'
5373
import fPagination from './Pagination'
5474
5575
export default {
@@ -60,10 +80,10 @@ export default {
6080
totalPage: 0,
6181
page: 0,
6282
loading: false,
63-
singertypeList,
64-
singerNameList,
65-
selectCountry: 'all_all',
66-
selectName: 'all'
83+
tagList: tag,
84+
selectTag: {
85+
area: -100, sex: -100, genre: -100, index: -100
86+
}
6787
}
6888
},
6989
components: {
@@ -72,9 +92,8 @@ export default {
7292
methods: {
7393
async getTheSingeList (newPage) {
7494
this.loading = true
75-
let data = await getSingerList({
76-
country: this.selectCountry,
77-
name: this.selectName,
95+
let data = await getNewSingerList({
96+
...this.selectTag,
7897
page: newPage
7998
})
8099
this.page = newPage
@@ -97,10 +116,10 @@ export default {
97116
border-radius: 10%;
98117
box-shadow: 4px 5px 7px 1px rgba(112,128,151,0.35);
99118
}
100-
.singer-type-list>.singer-country{
119+
.singer-type-list:first-child{
101120
margin-bottom: 3px;
102121
}
103-
.singer-type-list>.singer-firstname{
122+
.singer-type-list>.singer-type-item{
104123
margin-bottom: 5px;
105124
}
106125
.singer-type-list button{

src/renderer/components/SongList.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
</div>
4646
</transition-group>
4747

48-
4948
<div class="music-location">
5049
<transition name="right-show" mode="out-in">
5150
<input class="form-input input-sm" v-model="musicFilter" v-show="showSearch" type="text" placeholder="过滤">
@@ -97,7 +96,7 @@ export default {
9796
},
9897
musicListFilter () {
9998
return this.musicList.filter(music => {
100-
this.musicFilter === 'miku' && (this.musicFilter = `初音`)
99+
this.musicFilter === 'miku' && (this.musicFilter = `miku|初音`)
101100
let reg = new RegExp(`${this.musicFilter}`)
102101
const singerName = music.singerList.reduce((acc, singer) => acc + singer.singerName, '')
103102
return reg.test(music.songName) || reg.test(singerName) || reg.test(music.album.albumName)

src/renderer/router/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ export default new Router({
103103
name: 'PlayList',
104104
component: PlayList
105105
},
106+
{
107+
path: '/',
108+
name: 'default',
109+
component: SingerList
110+
},
106111
{
107112
path: '*',
108113
name: 'default',

src/spider/index.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ const cancelMap = {
3434
getSingerAlbumList: null,
3535
getSingerMvList: null,
3636
getAlbum: null,
37-
getPlayListInfo: null
37+
getPlayListInfo: null,
38+
getPlayList: null
3839
}
3940
/**
4041
* c++ 天下第一,客户端,嵌入式,服务器都能做,老子这辈子就学他了。
@@ -68,7 +69,17 @@ export async function getSingerList ({page, country, name}) {
6869
}
6970
/* eslint-disable */
7071
}
71-
72+
// 新列表 page >= 1
73+
export async function getNewSingerList ({page, area, sex, genre, index}) {
74+
let url = `https://u.y.qq.com/cgi-bin/musicu.fcg?g_tk=5381&loginUin=0&hostUin=0&format=jsonp&inCharset=utf8&outCharset=utf-8&notice=0&platform=yqq&needNewCode=0&data=${encodeURIComponent(`{"comm":{"ct":24,"cv":10000},"singerList":{"module":"Music.SingerListServer","method":"get_singer_list","param":{"area":${area},"sex":${sex},"genre":${genre},"index":${index},"sin":${(page - 1) * 80},"cur_page":${page}}}}`)}`
75+
/* eslint-disable */
76+
let {data: {singerlist, total}} = (await baseRequest(url)).data.singerList
77+
return {
78+
totalPage: Math.floor(total / 80),
79+
singerList: singerlist.map(({singer_name, singer_mid}) => new Singer(singer_name, singer_mid))
80+
}
81+
/* eslint-disable */
82+
}
7283
// page 从 0 开始
7384
export async function getSingerMusicList ({page, singerMid}) {
7485
let source = cancelRequest('getSingerMusicList')
@@ -203,8 +214,9 @@ export async function getCategory () {
203214
}
204215

205216
export async function getPlayList ({categoryId, page}) {
217+
let source = cancelRequest('getPlayList')
206218
let url = `https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_by_tag.fcg?picmid=1&g_tk=5381&loginUin=0&hostUin=0&format=jsonp&inCharset=utf8&outCharset=utf-8&notice=0&categoryId=${categoryId}&sortId=5&sin=${(page - 1) * 30}&ein=${page * 30 - 1}`
207-
let {list, sum} = JSON.parse((await baseRequest(url)).data.slice(18, -1)).data
219+
let {list, sum} = JSON.parse((await baseRequest(url, {cancelToken: source.token})).data.slice(18, -1)).data
208220
return {
209221
list: list.map(({dissname, imgurl, dissid}) => new PlayList(dissid, dissname, imgurl)),
210222
totalPage: Math.ceil(sum / 40)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const assert = require('assert')
2+
const {getNewSingerList} = require('../../../src/spider/index')
3+
4+
describe('歌词', function () {
5+
it('getNewSingerList', async function () {
6+
let data = await getNewSingerList({
7+
page: 1,
8+
area: -100,
9+
sex: -100,
10+
genre: -100,
11+
index: -100
12+
})
13+
assert(data.singerList.length === 80)
14+
})
15+
})

0 commit comments

Comments
 (0)