新增开关下载功能控制

pull/277/head
lyswhut 2020-07-01 17:04:43 +08:00
parent 9fd181ee06
commit 9f72a51458
10 changed files with 20 additions and 7 deletions

View File

@ -3,7 +3,7 @@ const os = require('os')
const { isMac } = require('./utils')
const defaultSetting = {
version: '1.0.32',
version: '1.0.33',
player: {
togglePlayMethod: 'listLoop',
highQuality: false,
@ -35,6 +35,7 @@ const defaultSetting = {
isSaveScrollLocation: true,
},
download: {
enable: false,
savePath: path.join(os.homedir(), 'Desktop'),
fileName: '歌名 - 歌手',
maxDownloadNum: 3,

View File

@ -21,7 +21,7 @@ div(:class="$style.player")
div(:class="$style.column2")
div(:class="$style.progress" v-if="!isShowPlayerDetail")
//- div(:class="[$style.progressBar, $style.progressBar1]" :style="{ transform: `scaleX(${progress || 0})` }")
div(:class="[$style.progressBar, $style.progressBar2, isActiveTransition ? $style.barTransition : '']" @transitionend="handleTransitionEnd" :style="{ transform: `scaleX(${progress || 0})` }")
div(:class="[$style.progressBar, $style.progressBar2, isActiveTransition ? $style.barTransition : '']" @transitionend="handleTransitionEnd" :style="{ transform: `scaleX(${progress || 0})`, willChange: isPlay || isActiveTransition ? 'transform' : 'auto' }")
div(:class="$style.progressMask" @click='handleSetProgress' ref="dom_progress")
div(:class="$style.column3")
span(:class="$style.statusText") {{statusText}}

View File

@ -39,7 +39,7 @@
div(:class="$style.progressContent")
div(:class="$style.progress")
//- div(:class="[$style.progressBar, $style.progressBar1]" :style="{ transform: `scaleX(${progress || 0})` }")
div(:class="[$style.progressBar, $style.progressBar2, isActiveTransition ? $style.barTransition : '']" @transitionend="handleTransitionEnd" :style="{ transform: `scaleX(${playInfo.progress || 0})` }")
div(:class="[$style.progressBar, $style.progressBar2, isActiveTransition ? $style.barTransition : '']" @transitionend="handleTransitionEnd" :style="{ transform: `scaleX(${playInfo.progress || 0})`, willChange: isPlay || isActiveTransition ? 'transform' : 'auto' }")
div(:class="$style.progressMask" @click='setProgress' ref="dom_progress")
div(:class="$style.timeLabel")
span(style="margin-left: 15px") {{playInfo.status}}

View File

@ -6,7 +6,7 @@ div(:class="$style.btns")
button(type="button" v-if="listAddBtn" @contextmenu.capture.stop :title="$t('material.list_buttons.add_to')" @click.stop="handleClick('listAdd')")
svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' height='100%' viewBox='0 0 42 42' space='preserve')
use(xlink:href='#icon-addTo')
button(type="button" v-if="downloadBtn" @contextmenu.capture.stop :title="$t('material.list_buttons.download')" @click.stop="handleClick('download')")
button(type="button" v-if="downloadBtn && setting.download.enable" @contextmenu.capture.stop :title="$t('material.list_buttons.download')" @click.stop="handleClick('download')")
svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' height='100%' viewBox='0 0 475.078 475.077' space='preserve')
use(xlink:href='#icon-download')
//- button(type="button" :title="$t('material.list_buttons.add')" v-if="userInfo" @click.stop="handleClick('add')")
@ -31,7 +31,7 @@ div(:class="$style.btns")
</template>
<script>
// import { mapGetters } from 'vuex'
import { mapGetters } from 'vuex'
export default {
props: {
@ -73,7 +73,7 @@ export default {
},
},
computed: {
// ...mapGetters(['userInfo']),
...mapGetters(['setting']),
},
methods: {
handleClick(action) {

View File

@ -1,9 +1,10 @@
<template lang="pug">
ul(:class="$style.list" :style="listStyles" ref="dom_list")
li(v-for="item in menus" @click="handleClick(item)" v-if="!item.hide" :disabled="item.disabled") {{item[itemName]}}
li(v-for="item in menus" @click="handleClick(item)" v-if="!item.hide && (item.action == 'download' ? setting.download.enable : true)" :disabled="item.disabled") {{item[itemName]}}
</template>
<script>
import { mapGetters } from 'vuex'
export default {
props: {
@ -28,6 +29,9 @@ export default {
},
},
},
computed: {
...mapGetters(['setting']),
},
watch: {
isShow: {
handler(n) {
@ -131,6 +135,7 @@ export default {
box-shadow: 0 1px 8px 0 rgba(0,0,0,.2);
z-index: 10;
overflow: hidden;
// will-change: transform;
li {
cursor: pointer;
min-width: 80px;

View File

@ -132,6 +132,7 @@ export default {
align-items: center;
justify-items: center;
z-index: 99;
// will-change: transform;
}
.content {

View File

@ -64,6 +64,7 @@
"list_scroll": "Remember playlist scrolling position (for Your library only)",
"download": "Download",
"download_enable": "Whether to enable download function",
"download_path_title": "Define the path to downloading",
"download_path": "Download path",
"download_path_label": "Current: ",

View File

@ -64,6 +64,7 @@
"list_scroll": "记住列表滚动位置(仅对我的音乐分类有效)",
"download": "下载设置",
"download_enable": "是否启用下载功能",
"download_path_title": "下载歌曲保存的路径",
"download_path": "下载路径",
"download_path_label": "当前下载路径:",

View File

@ -59,6 +59,7 @@
"list_scroll_title": "是否記住播放列表滾動條位置",
"list_scroll": "記住列表滾動位置(僅對我的音樂分類有效)",
"download": "下載設置",
"download_enable": "是否啟用下載功能",
"download_path_title": "下載歌曲保存的路徑",
"download_path": "下載路徑",
"download_path_label": "當前下載路徑:",

View File

@ -110,6 +110,8 @@ div.scroll(:class="$style.setting")
div
material-checkbox(id="setting_list_showalbum" v-model="current_setting.list.isShowAlbumName" label="是否显示专辑栏")
dt {{$t('view.setting.download')}}
dd
material-checkbox(id="setting_download_enable" v-model="current_setting.download.enable" :label="$t('view.setting.download_enable')")
dd(:title="$t('view.setting.download_path_title')")
h3 {{$t('view.setting.download_path')}}
div
@ -414,6 +416,7 @@ export default {
isFocusSearchBox: false,
},
download: {
enable: false,
savePath: '',
fileName: '歌名 - 歌手',
isDownloadLrc: false,