优化更新弹窗

pull/96/head
lyswhut 2019-09-26 00:06:02 +08:00
parent f3dd306f54
commit 6bd18e8078
10 changed files with 50 additions and 22 deletions

View File

@ -98,6 +98,14 @@ npm run pack
注意:**绿色版**的软件更新功能**不可用**,为了能及时地获取更新,建议使用安装版!!<br>
注意:**Mac版**、**Linux deb**版不支持自动更新!
#### 安装安装版失败
对于部分电脑出现安装失败的问题我也不懂什么原因,,可以尝试清理下安装文件,或者重启电脑试试。
#### 缺少`xxx.dll`
这个是电脑缺少某些dll导致的正常的系统是没有这个问题的解决办法需自行百度弹出的错误信息看下别人是怎么解决的。
### 致谢
感谢 [@messoer](https://github.com/messoer) 曾经提供的部分音乐API

View File

@ -6,3 +6,10 @@
### 优化
- 新增DNS解析缓存加快请求速度
- 优化代码逻辑,减少软件对系统资源的占用
- 优化新版本信息检测,尽量减少弹出版本获取失败弹窗弹出的概率
- 优化下拉列表动画效果
### 修复
- 修复一些小Bug

View File

@ -106,6 +106,11 @@ export default {
this.showUpdateModal()
})
})
this.setVersionModalVisible({ isError: true })
this.clearUpdateTimeout()
this.$nextTick(() => {
this.showUpdateModal()
})
rendererOn('update-downloaded', () => {
this.clearUpdateTimeout()
this.setVersionModalVisible({ isError: false })

View File

@ -622,7 +622,7 @@ export default {
height: 100%;
transform-origin: 0;
transition-property: transform;
transition-timing-function: ease;
transition-timing-function: ease-out;
border-radius: @radius-progress-border;
}
.progress-bar1 {

View File

@ -134,7 +134,7 @@ export default {
flex-flow: column nowrap;
> * {
background-color: @color-theme_2;
background-color: @color-theme_2-background_2;
}
}
@ -176,7 +176,7 @@ each(@themes, {
.content {
box-shadow: 0 0 3px rgba(0, 0, 0, .3);
> * {
background-color: ~'@{color-@{value}-theme_2}';
background-color: ~'@{color-@{value}-theme_2-background_2}';
}
}

View File

@ -99,7 +99,7 @@ export default {
border-bottom: 2px solid @color-tab-border-bottom;
border-left: 2px solid @color-tab-border-bottom;
border-bottom-left-radius: 4px;
background-color: @color-theme_2;
background-color: @color-theme_2-background_2;
opacity: 0;
transform: scaleY(0);
transform-origin: 0 0 0;
@ -144,6 +144,7 @@ each(@themes, {
.list {
border-bottom-color: ~'@{color-@{value}-tab-border-bottom}';
border-left-color: ~'@{color-@{value}-tab-border-bottom}';
background-color: ~'@{color-@{value}-theme_2-background_2}';
li {
// color: ~'@{color-@{value}-btn}';
background-color: ~'@{color-@{value}-btn-background}';

View File

@ -17,16 +17,19 @@ material-modal(:show="version.showModal" @close="handleClose")
div(:class="$style.footer" v-if="version.isError")
div(:class="$style.desc" v-if="!isUnknow")
p 发现有新版本啦但是自动更新功能出问题了
p 发现有新版本啦但是自动更新功能出问题了
p
| 你现在可以选择继续使用当前版本或
strong 去发布页下载新版本
| 推荐到
strong 网盘
| 下载
|
p
| 国内Windows/MAC用户推荐到
strong.hover.underline(@click="handleOpenUrl('https://www.lanzous.com/b906260/')") 网盘(点击打开)
| 下载密码
strong.hover(@click="handleCopy('glqw')" title="点击复制") glqw
div(:class="$style.btns")
material-btn(:class="$style.btn" @click.onec="handleIgnoreClick") 忽略该版本
material-btn(:class="$style.btn" @click.onec="handleOpenPageClick") 去下载新版本
material-btn(:class="$style.btn" @click.onec="handleOpenUrl('https://github.com/lyswhut/lx-music-desktop#readme')") 去软件发布页
div(:class="$style.footer" v-else)
div(:class="$style.desc")
p 新版本已下载完毕
@ -43,7 +46,7 @@ material-modal(:show="version.showModal" @close="handleClose")
<script>
import { mapGetters, mapMutations } from 'vuex'
import { rendererSend } from '../../../common/icp'
import { checkVersion, openUrl } from '../../utils'
import { checkVersion, openUrl, clipboardWriteText } from '../../utils'
export default {
computed: {
@ -74,14 +77,17 @@ export default {
// event.target.disabled = true
this.setSetting(Object.assign({}, this.setting, { ignoreVersion: this.version.newVersion.version }))
},
handleOpenPageClick() {
openUrl('https://github.com/lyswhut/lx-music-desktop#readme')
handleOpenUrl(url) {
openUrl(url)
},
handleRestartClick(event) {
this.handleClose()
event.target.disabled = true
rendererSend('quit-update')
},
handleCopy(text) {
clipboardWriteText(text)
},
},
}
</script>
@ -123,6 +129,7 @@ export default {
line-height: 1.5;
overflow-y: auto;
height: 100%;
padding-right: 5px;
}
.current {
> p {
@ -169,12 +176,9 @@ export default {
flex: 0 0 none;
.desc {
font-size: 12px;
padding: 10px 0;
padding-top: 10px;
color: @color-theme;
line-height: 1.2;
strong {
text-decoration: underline;
}
}
}
.btn {
@ -183,6 +187,7 @@ export default {
}
.btns {
display: grid;
padding-top: 10px;
grid-template-columns: 1fr 1fr;
grid-gap: 0 10px;
}

View File

@ -3,15 +3,17 @@ import { httpGet } from '../utils/request'
import { author, name } from '../../../package.json'
export default {
getVersionInfo() {
getVersionInfo(state, retryNum = 0) {
return new Promise((resolve, reject) => {
httpGet(`https://raw.githubusercontent.com/${author.name}/${name}/master/publish/version.json`, (err, resp, body) => {
httpGet(`https://raw.githubusercontent.com/${author.name}/${name}/master/publish/version.json`, {
timeout: 20000,
}, (err, resp, body) => {
if (err) {
return resolve({
return ++retryNum > 3 ? resolve({
version: '0.0.0',
desc: '<h3>版本信息获取失败</h3><ul><li>更新信息获取失败可能是无法访问Github导致的请手动检查更新</li><li>检查方法:去设置-关于洛雪音乐打开<strong>开源地址</strong>或<strong>网盘地址</strong>查看<strong>版本号</strong>与当前版本对比是否最新</li></ul>',
history: [],
})
}) : this.dispatch('getVersionInfo', retryNum).then(ver => resolve(ver))
}
resolve(body)
})

View File

@ -231,7 +231,7 @@ const getProxyInfo = () => window.globalObj.proxy.enable
const fetchData = (url, method, {
headers = {},
format = 'json',
timeout = 1000,
timeout = 15000,
...options
}, callback) => {
// console.log(url, options)

View File

@ -134,7 +134,7 @@ div.scroll(:class="$style.setting")
| 支持作者哦~~🍻
p
span 如果你资金充裕还可以
material-btn(@click="handleOpenUrl('https://cdn.stsky.cn/qrc.png')" min title="土豪,你好 🙂") 打赏下作者
material-btn(@click="handleOpenUrl('https://cdn.stsky.cn/qrc.png')" min title="土豪,你好 🙂") 捐赠下作者
span 以帮我分担点服务器费用~
p.small
| 本软件仅用于学习交流使用禁止将本软件用于