新增强迫症设置

pull/96/head
lyswhut 2019-09-07 12:46:47 +08:00
parent cafdad6f9f
commit c117e33d24
7 changed files with 45 additions and 13 deletions

View File

@ -1,3 +1,11 @@
### 新增
- 新增强迫症设置-离开搜索界面时是否清空搜索框
### 优化
- 略微优化最小化按钮字符
### 修复 ### 修复
- 修复下载管理的一些Bug - 修复下载管理的一些Bug

View File

@ -113,12 +113,6 @@ each(@themes, {
&:before { &:before {
display: block; display: block;
position: absolute; position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: 14px;
line-height: 1;
color: #fff;
opacity: 0; opacity: 0;
transition: opacity @transition-theme; transition: opacity @transition-theme;
} }
@ -147,13 +141,23 @@ each(@themes, {
} }
.min { .min {
&:before { &:before {
content: ''; content: ' ';
font-size: 15px; width: 8px;
height: 2px;
left: @height-toolbar / 2 - 4;
top: @height-toolbar / 2;
background-color: #fff;
} }
} }
.close { .close {
&:before { &:before {
content: '×'; content: '×';
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: 14px;
line-height: 1;
color: #fff;
} }
} }
</style> </style>

View File

@ -34,8 +34,11 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters(['source']), ...mapGetters(['source', 'route', 'setting']),
...mapGetters('search', ['info']), ...mapGetters('search', ['info']),
isAutoClearInput() {
return this.setting.odc.isAutoClearSearchInput
},
}, },
watch: { watch: {
list(n) { list(n) {
@ -46,6 +49,9 @@ export default {
'info.text'(n) { 'info.text'(n) {
if (n !== this.text) this.text = n if (n !== this.text) this.text = n
}, },
route(n) {
if (this.isAutoClearInput && n.name != 'search' && this.text) this.text = ''
},
}, },
methods: { methods: {
handleTemplistClick(index) { handleTemplistClick(index) {

View File

@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
// import { sync } from 'vuex-router-sync' import { sync } from 'vuex-router-sync'
// Components // Components
import './components' import './components'
@ -11,7 +11,7 @@ import App from './App'
import router from './route' import router from './route'
import store from './store' import store from './store'
// sync(store, router) sync(store, router)
if (!process.env.IS_WEB) { if (!process.env.IS_WEB) {

View File

@ -31,4 +31,7 @@ export default {
version(state) { version(state) {
return state.version return state.version
}, },
route(state) {
return state.route
},
} }

View File

@ -163,7 +163,7 @@ export const isChildren = (parent, children) => {
* @param {*} setting * @param {*} setting
*/ */
export const updateSetting = setting => { export const updateSetting = setting => {
const defaultVersion = '1.0.6' const defaultVersion = '1.0.7'
const defaultSetting = { const defaultSetting = {
version: defaultVersion, version: defaultVersion,
player: { player: {
@ -194,6 +194,9 @@ export const updateSetting = setting => {
id: null, id: null,
}, },
}, },
odc: {
isAutoClearSearchInput: false,
},
themeId: 0, themeId: 0,
sourceId: 'kw', sourceId: 'kw',
apiSource: 'test', apiSource: 'test',

View File

@ -62,6 +62,11 @@ div.scroll(:class="$style.setting")
h3 专辑栏 h3 专辑栏
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 强迫症设置
dd
h3 离开搜索界面时清空搜索框
div
material-checkbox(id="setting_odc_isAutoClearSearchInput" v-model="current_setting.odc.isAutoClearSearchInput" label="是否启用")
dt 备份与恢复 dt 备份与恢复
dd dd
h3 部分数据 h3 部分数据
@ -157,6 +162,9 @@ export default {
isDownloadLrc: false, isDownloadLrc: false,
isEmbedPic: true, isEmbedPic: true,
}, },
odc: {
isAutoClearSearchInput: false,
},
themeId: 0, themeId: 0,
sourceId: 0, sourceId: 0,
randomAnimate: true, randomAnimate: true,