Merge branch 'dev' into md

pull/166/head
lyswhut 2020-03-03 12:31:40 +08:00
commit f30cb9da59
6 changed files with 59 additions and 21 deletions

View File

@ -70,6 +70,13 @@ npm run pack
<p><a href="https://github.com/lyswhut/lx-music-desktop"><img width="100%" src="https://github.com/lyswhut/lx-music-desktop/blob/master/doc/images/app.png" alt="lx-music UI"></a></p> <p><a href="https://github.com/lyswhut/lx-music-desktop"><img width="100%" src="https://github.com/lyswhut/lx-music-desktop/blob/master/doc/images/app.png" alt="lx-music UI"></a></p>
### 启动参数
目前软件已支持的启动参数如下:
- `-search` 启动软件时自动在搜索框搜索指定的内容,例如:`-search="突然的自我 - 伍佰"`
- `-nt` 以非透明模式启动对于未开启AERO效果的win7系统可加此参数启动以确保界面正常显示
### 常见问题 ### 常见问题
常见问题已移至:<https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md> 常见问题已移至:<https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md>

View File

@ -2,7 +2,9 @@
- 新增多语言设置目前软件内置了简体中文、繁体中文、英语三种语言欢迎提交PR翻译更多语言 - 新增多语言设置目前软件内置了简体中文、繁体中文、英语三种语言欢迎提交PR翻译更多语言
- 新增无法打开外部歌单FAQ - 新增无法打开外部歌单FAQ
- 新增启动参数`search`,使用例子:`.\lx-music-desktop.exe -search="突然的自我 - 伍佰"`
### 优化 ### 优化
- 优化月里嫦娥皮肤侧栏鼠标悬浮颜色 - 优化月里嫦娥皮肤侧栏鼠标悬浮颜色
- 优化播放进度条的动画效果

View File

@ -0,0 +1,13 @@
module.exports = mainWindow => {
mainWindow.on('close', () => {
mainWindow.setProgressBar(-1)
})
mainWindow.on('closed', () => {
mainWindow = global.mainWindow = null
})
mainWindow.on('restore', () => {
mainWindow.webContents.send('restore')
})
}

View File

@ -26,6 +26,7 @@ global.envParams = parseEnv()
require('../common/error') require('../common/error')
require('./events') require('./events')
const winEvent = require('./events/winEvent')
const autoUpdate = require('./utils/autoUpdate') const autoUpdate = require('./utils/autoUpdate')
const { isLinux, isMac } = require('../common/utils') const { isLinux, isMac } = require('../common/utils')
@ -67,13 +68,7 @@ function createWindow() {
mainWindow.loadURL(winURL) mainWindow.loadURL(winURL)
mainWindow.on('close', () => { winEvent(mainWindow)
mainWindow.setProgressBar(-1)
})
mainWindow.on('closed', () => {
mainWindow = global.mainWindow = null
})
// mainWindow.webContents.openDevTools() // mainWindow.webContents.openDevTools()
if (!isDev) { if (!isDev) {

View File

@ -112,18 +112,8 @@ export default {
...mapMutations('download', ['updateDownloadList']), ...mapMutations('download', ['updateDownloadList']),
...mapMutations(['setSetting']), ...mapMutations(['setSetting']),
init() { init() {
rendererInvoke('getEnvParams').then(envParams => { rendererInvoke('getEnvParams').then(this.handleEnvParamsInit)
this.envParams = envParams
this.isNt = isLinux || this.envParams.nt
if (this.isNt) {
document.body.classList.remove('transparent')
document.body.classList.add('noTransparent')
}
if (this.isProd && !this.isNt) {
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
}
})
document.body.addEventListener('click', this.handleBodyClick, true) document.body.addEventListener('click', this.handleBodyClick, true)
rendererOn('update-available', (e, info) => { rendererOn('update-available', (e, info) => {
// this.showUpdateModal(true) // this.showUpdateModal(true)
@ -259,6 +249,27 @@ export default {
event.preventDefault() event.preventDefault()
if (/^https?:\/\//.test(event.target.href)) openUrl(event.target.href) if (/^https?:\/\//.test(event.target.href)) openUrl(event.target.href)
}, },
handleEnvParamsInit(envParams) {
this.envParams = envParams
this.isNt = isLinux || this.envParams.nt
if (this.isNt) {
document.body.classList.remove('transparent')
document.body.classList.add('noTransparent')
}
if (this.isProd && !this.isNt) {
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
}
if (this.envParams.search != null) {
this.$router.push({
path: 'search',
query: {
text: this.envParams.search,
},
})
}
},
}, },
beforeDestroy() { beforeDestroy() {
this.clearUpdateTimeout() this.clearUpdateTimeout()

View File

@ -48,7 +48,7 @@ div(:class="$style.player")
<script> <script>
import Lyric from 'lrc-file-parser' import Lyric from 'lrc-file-parser'
import { rendererSend } from '../../../common/ipc' import { rendererSend, rendererOn } from '../../../common/ipc'
import { formatPlayTime2, getRandom, checkPath, setTitle, clipboardWriteText, debounce } from '../../utils' import { formatPlayTime2, getRandom, checkPath, setTitle, clipboardWriteText, debounce } from '../../utils'
import { mapGetters, mapActions, mapMutations } from 'vuex' import { mapGetters, mapActions, mapMutations } from 'vuex'
import { requestMsg } from '../../utils/message' import { requestMsg } from '../../utils/message'
@ -128,6 +128,9 @@ export default {
this.setVolume(volume) this.setVolume(volume)
}, 300) }, 300)
rendererOn('restore', () => {
this.handleSetTransition()
})
document.addEventListener('mousemove', this.handleVolumeMsMove) document.addEventListener('mousemove', this.handleVolumeMsMove)
document.addEventListener('mouseup', this.handleVolumeMsUp) document.addEventListener('mouseup', this.handleVolumeMsUp)
window.addEventListener('resize', this.handleResize) window.addEventListener('resize', this.handleResize)
@ -179,6 +182,9 @@ export default {
volume(n) { volume(n) {
this.handleSaveVolume(n) this.handleSaveVolume(n)
}, },
nowPlayTime(n, o) {
if (Math.abs(n - o) > 1) this.handleSetTransition()
},
}, },
methods: { methods: {
...mapActions('player', ['getUrl', 'getPic', 'getLrc']), ...mapActions('player', ['getUrl', 'getPic', 'getLrc']),
@ -390,7 +396,7 @@ export default {
}, },
setProgess(e) { setProgess(e) {
if (!this.audio.src) return if (!this.audio.src) return
this.isActiveTransition = true // this.isActiveTransition = true
this.$nextTick(() => { this.$nextTick(() => {
const time = (e.offsetX / this.pregessWidth) * this.maxPlayTime const time = (e.offsetX / this.pregessWidth) * this.maxPlayTime
if (this.audioErrorTime) this.audioErrorTime = time if (this.audioErrorTime) this.audioErrorTime = time
@ -583,6 +589,10 @@ export default {
this.setMediaDeviceId(null) this.setMediaDeviceId(null)
}) })
}, },
handleSetTransition() {
this.isActiveTransition = true
// console.log('active transition')
},
}, },
} }
</script> </script>