新增开关下载功能控制
parent
9fd181ee06
commit
9f72a51458
|
@ -3,7 +3,7 @@ const os = require('os')
|
||||||
const { isMac } = require('./utils')
|
const { isMac } = require('./utils')
|
||||||
|
|
||||||
const defaultSetting = {
|
const defaultSetting = {
|
||||||
version: '1.0.32',
|
version: '1.0.33',
|
||||||
player: {
|
player: {
|
||||||
togglePlayMethod: 'listLoop',
|
togglePlayMethod: 'listLoop',
|
||||||
highQuality: false,
|
highQuality: false,
|
||||||
|
@ -35,6 +35,7 @@ const defaultSetting = {
|
||||||
isSaveScrollLocation: true,
|
isSaveScrollLocation: true,
|
||||||
},
|
},
|
||||||
download: {
|
download: {
|
||||||
|
enable: false,
|
||||||
savePath: path.join(os.homedir(), 'Desktop'),
|
savePath: path.join(os.homedir(), 'Desktop'),
|
||||||
fileName: '歌名 - 歌手',
|
fileName: '歌名 - 歌手',
|
||||||
maxDownloadNum: 3,
|
maxDownloadNum: 3,
|
||||||
|
|
|
@ -21,7 +21,7 @@ div(:class="$style.player")
|
||||||
div(:class="$style.column2")
|
div(:class="$style.column2")
|
||||||
div(:class="$style.progress" v-if="!isShowPlayerDetail")
|
div(:class="$style.progress" v-if="!isShowPlayerDetail")
|
||||||
//- div(:class="[$style.progressBar, $style.progressBar1]" :style="{ transform: `scaleX(${progress || 0})` }")
|
//- 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.progressMask" @click='handleSetProgress' ref="dom_progress")
|
||||||
div(:class="$style.column3")
|
div(:class="$style.column3")
|
||||||
span(:class="$style.statusText") {{statusText}}
|
span(:class="$style.statusText") {{statusText}}
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
div(:class="$style.progressContent")
|
div(:class="$style.progressContent")
|
||||||
div(:class="$style.progress")
|
div(:class="$style.progress")
|
||||||
//- div(:class="[$style.progressBar, $style.progressBar1]" :style="{ transform: `scaleX(${progress || 0})` }")
|
//- 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.progressMask" @click='setProgress' ref="dom_progress")
|
||||||
div(:class="$style.timeLabel")
|
div(:class="$style.timeLabel")
|
||||||
span(style="margin-left: 15px") {{playInfo.status}}
|
span(style="margin-left: 15px") {{playInfo.status}}
|
||||||
|
|
|
@ -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')")
|
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')
|
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')
|
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')
|
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')
|
use(xlink:href='#icon-download')
|
||||||
//- button(type="button" :title="$t('material.list_buttons.add')" v-if="userInfo" @click.stop="handleClick('add')")
|
//- 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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
@ -73,7 +73,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// ...mapGetters(['userInfo']),
|
...mapGetters(['setting']),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick(action) {
|
handleClick(action) {
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
ul(:class="$style.list" :style="listStyles" ref="dom_list")
|
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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
@ -28,6 +29,9 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['setting']),
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isShow: {
|
isShow: {
|
||||||
handler(n) {
|
handler(n) {
|
||||||
|
@ -131,6 +135,7 @@ export default {
|
||||||
box-shadow: 0 1px 8px 0 rgba(0,0,0,.2);
|
box-shadow: 0 1px 8px 0 rgba(0,0,0,.2);
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
// will-change: transform;
|
||||||
li {
|
li {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
min-width: 80px;
|
min-width: 80px;
|
||||||
|
|
|
@ -132,6 +132,7 @@ export default {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-items: center;
|
justify-items: center;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
|
// will-change: transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
"list_scroll": "Remember playlist scrolling position (for Your library only)",
|
"list_scroll": "Remember playlist scrolling position (for Your library only)",
|
||||||
|
|
||||||
"download": "Download",
|
"download": "Download",
|
||||||
|
"download_enable": "Whether to enable download function",
|
||||||
"download_path_title": "Define the path to downloading",
|
"download_path_title": "Define the path to downloading",
|
||||||
"download_path": "Download path",
|
"download_path": "Download path",
|
||||||
"download_path_label": "Current: ",
|
"download_path_label": "Current: ",
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
"list_scroll": "记住列表滚动位置(仅对我的音乐分类有效)",
|
"list_scroll": "记住列表滚动位置(仅对我的音乐分类有效)",
|
||||||
|
|
||||||
"download": "下载设置",
|
"download": "下载设置",
|
||||||
|
"download_enable": "是否启用下载功能",
|
||||||
"download_path_title": "下载歌曲保存的路径",
|
"download_path_title": "下载歌曲保存的路径",
|
||||||
"download_path": "下载路径",
|
"download_path": "下载路径",
|
||||||
"download_path_label": "当前下载路径:",
|
"download_path_label": "当前下载路径:",
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
"list_scroll_title": "是否記住播放列表滾動條位置",
|
"list_scroll_title": "是否記住播放列表滾動條位置",
|
||||||
"list_scroll": "記住列表滾動位置(僅對我的音樂分類有效)",
|
"list_scroll": "記住列表滾動位置(僅對我的音樂分類有效)",
|
||||||
"download": "下載設置",
|
"download": "下載設置",
|
||||||
|
"download_enable": "是否啟用下載功能",
|
||||||
"download_path_title": "下載歌曲保存的路徑",
|
"download_path_title": "下載歌曲保存的路徑",
|
||||||
"download_path": "下載路徑",
|
"download_path": "下載路徑",
|
||||||
"download_path_label": "當前下載路徑:",
|
"download_path_label": "當前下載路徑:",
|
||||||
|
|
|
@ -110,6 +110,8 @@ div.scroll(:class="$style.setting")
|
||||||
div
|
div
|
||||||
material-checkbox(id="setting_list_showalbum" v-model="current_setting.list.isShowAlbumName" label="是否显示专辑栏")
|
material-checkbox(id="setting_list_showalbum" v-model="current_setting.list.isShowAlbumName" label="是否显示专辑栏")
|
||||||
dt {{$t('view.setting.download')}}
|
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')")
|
dd(:title="$t('view.setting.download_path_title')")
|
||||||
h3 {{$t('view.setting.download_path')}}
|
h3 {{$t('view.setting.download_path')}}
|
||||||
div
|
div
|
||||||
|
@ -414,6 +416,7 @@ export default {
|
||||||
isFocusSearchBox: false,
|
isFocusSearchBox: false,
|
||||||
},
|
},
|
||||||
download: {
|
download: {
|
||||||
|
enable: false,
|
||||||
savePath: '',
|
savePath: '',
|
||||||
fileName: '歌名 - 歌手',
|
fileName: '歌名 - 歌手',
|
||||||
isDownloadLrc: false,
|
isDownloadLrc: false,
|
||||||
|
|
Loading…
Reference in New Issue