diff --git a/package.json b/package.json
index 378935fa..85f0e190 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "lx-music-desktop",
- "version": "1.5.0",
+ "version": "1.6.0",
"description": "一个免费的音乐下载助手",
"main": "./dist/electron/main.js",
"productName": "lx-music-desktop",
diff --git a/publish/changeLog.md b/publish/changeLog.md
index 085d884a..d758fc6e 100644
--- a/publish/changeLog.md
+++ b/publish/changeLog.md
@@ -1,14 +1,4 @@
### 新增
-- 直接从歌单详情收藏的列表新增同步功能。注意:这将会覆盖本地的目标列表,歌曲将被替换成最新的在线列表
+- 我的列表右键菜单新增列表排序功能,可调整单曲、多选后的歌曲的顺序
-### 优化
-
-- 优化软件启动时恢复上一次播放的歌曲进度功能
-
-### 修复
-
-- 修复MAC平台上下载歌曲封面嵌入无法显示的问题
-- 修复MAC平台首次运行软件最小化、关闭控制按钮默认在右边的问题
-- 修复酷狗源的某些歌曲没有专辑字段导致的列表加载失败问题
-- 修复某些酷狗源歌单链接无法打开的问题
diff --git a/src/renderer/components/material/Input.vue b/src/renderer/components/material/Input.vue
index 1f0bf89f..8b1ac781 100644
--- a/src/renderer/components/material/Input.vue
+++ b/src/renderer/components/material/Input.vue
@@ -1,6 +1,6 @@
- input(:class="$style.input" :type="type" :placeholder="placeholder" :value="value" :disabled="disabled"
- @focus="$emit('focus', $event)" @blur="$emit('blur', $event)" @input="$emit('input', $event.target.value.trim())" @change="$emit('change', $event.target.value.trim())"
+ input(:class="$style.input" ref="dom_input" :type="type" :placeholder="placeholder" :value="value" :disabled="disabled"
+ @focus="$emit('focus', $event)" @blur="$emit('blur', $event)" @input="handleInput" @change="$emit('change', $event.target.value.trim())"
@keyup.enter="$emit('submit', $event.target.value.trim())")
@@ -24,6 +24,16 @@ export default {
default: 'text',
},
},
+ methods: {
+ handleInput(event) {
+ let value = event.target.value.trim()
+ event.target.value = value
+ this.$emit('input', value)
+ },
+ focus() {
+ this.$refs.dom_input.focus()
+ },
+ },
}
@@ -41,6 +51,13 @@ export default {
transition: background-color 0.2s ease;
background-color: @color-btn-background;
font-size: 13.3px;
+
+ &::-webkit-outer-spin-button,
+ &::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+ }
+
&[disabled] {
opacity: .4;
}
diff --git a/src/renderer/components/material/ListAddModal.vue b/src/renderer/components/material/ListAddModal.vue
new file mode 100644
index 00000000..c42c8de3
--- /dev/null
+++ b/src/renderer/components/material/ListAddModal.vue
@@ -0,0 +1,201 @@
+
+material-modal(:show="show" :bg-close="bgClose" @close="handleClose")
+ main(:class="$style.main")
+ h2
+ | {{$t('material.list_add_modal.' + (isMove ? 'title_first_move' : 'title_first_add'))}}
+ span(:class="$style.name") {{this.musicInfo && `${musicInfo.name}`}}
+ | {{$t('material.list_add_modal.title_last')}}
+ div.scroll(:class="$style.btnContent")
+ material-btn(:class="$style.btn" :tips="$t('material.list_add_modal.btn_title', { name: item.name })" :key="item.id" @click="handleClick(index)" v-for="(item, index) in lists") {{item.name}}
+ material-btn(:class="[$style.btn, $style.newList, isEditing ? $style.editing : null]" @click="handleEditing($event)" :tips="$t('view.list.lists_new_list_btn')")
+ svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' viewBox='0 0 42 42' space='preserve')
+ use(xlink:href='#icon-addTo')
+ input.key-bind(:class="$style.newListInput" :value="newListName" type="text" :placeholder="$t('view.list.lists_new_list_input')" @keyup.enter="handleSaveList($event)" @blur="handleSaveList($event)")
+ span(:class="$style.btn" v-for="i in spaceNum")
+
+
+
+
+
+
diff --git a/src/renderer/components/material/ListAddMultipleModal.vue b/src/renderer/components/material/ListAddMultipleModal.vue
new file mode 100644
index 00000000..40a9e734
--- /dev/null
+++ b/src/renderer/components/material/ListAddMultipleModal.vue
@@ -0,0 +1,195 @@
+
+material-modal(:show="show" :bg-close="bgClose" @close="handleClose")
+ main(:class="$style.main")
+ h2 {{$t('material.list_add_multiple_modal.' + (isMove ? 'title_move' : 'title_add'), { num: musicList.length })}}
+ div.scroll(:class="$style.btnContent")
+ material-btn(:class="$style.btn" :tips="$t('material.list_add_multiple_modal.btn_title', { name: item.name })" :key="item.id" @click="handleClick(index)" v-for="(item, index) in lists") {{item.name}}
+ material-btn(:class="[$style.btn, $style.newList, isEditing ? $style.editing : null]" @click="handleEditing($event)" :tips="$t('view.list.lists_new_list_btn')")
+ svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' viewBox='0 0 42 42' space='preserve')
+ use(xlink:href='#icon-addTo')
+ input.key-bind(:class="$style.newListInput" :value="newListName" type="text" :placeholder="$t('view.list.lists_new_list_input')" @keyup.enter="handleSaveList($event)" @blur="handleSaveList($event)")
+ span(:class="$style.btn" v-for="i in spaceNum")
+
+
+
+
+
+
diff --git a/src/renderer/components/material/ListSortModal.vue b/src/renderer/components/material/ListSortModal.vue
new file mode 100644
index 00000000..79af530d
--- /dev/null
+++ b/src/renderer/components/material/ListSortModal.vue
@@ -0,0 +1,109 @@
+
+material-modal(:show="show" @close="handleClose")
+ main(:class="$style.main")
+ h2 {{selectedNum > 0 ? $t('material.list_sort_modal.title_multiple', { num: selectedNum }) : $t('material.list_sort_modal.title', { name: musicInfo ? musicInfo.name : '' })}}
+ material-input(:class="$style.input" type="number" v-model="sortNum" ref="input" :placeholder="$t('material.list_sort_modal.input_tip')" @keydown.native.enter="handleSubmit")
+ material-btn(:class="$style.btn" @click="handleSubmit") {{$t('material.list_sort_modal.btn_confirm')}}
+
+
+
+
+
+
diff --git a/src/renderer/components/material/Menu.vue b/src/renderer/components/material/Menu.vue
index 534cf82a..a48afd6e 100644
--- a/src/renderer/components/material/Menu.vue
+++ b/src/renderer/components/material/Menu.vue
@@ -138,10 +138,10 @@ export default {
// will-change: transform;
li {
cursor: pointer;
- min-width: 80px;
+ min-width: 90px;
line-height: 34px;
// color: @color-btn;
- padding: 0 5px;
+ padding: 0 10px;
text-align: center;
outline: none;
transition: @transition-theme;
diff --git a/src/renderer/components/material/XmVerifyModal.vue b/src/renderer/components/material/XmVerifyModal.vue
new file mode 100644
index 00000000..6a910c4c
--- /dev/null
+++ b/src/renderer/components/material/XmVerifyModal.vue
@@ -0,0 +1,50 @@
+
+material-modal(:show="show" :bg-close="bgClose" @close="handleClose")
+ main.ignore-to-rem(:class="$style.main")
+ h2 {{$t('material.xm_verify_modal.title')}}
+
+
+
+
+
+
diff --git a/src/renderer/lang/en-us/material/list_sort_modal.json b/src/renderer/lang/en-us/material/list_sort_modal.json
new file mode 100644
index 00000000..c767e46e
--- /dev/null
+++ b/src/renderer/lang/en-us/material/list_sort_modal.json
@@ -0,0 +1,6 @@
+{
+ "title": "Adjust the position of {name} to:",
+ "title_multiple": "Adjust the position of the selected {num} songs to:",
+ "input_tip": "Please input which position you want to adjust to",
+ "btn_confirm": "Confirm"
+}
diff --git a/src/renderer/lang/en-us/view/list.json b/src/renderer/lang/en-us/view/list.json
index 37809cf7..37d039d6 100644
--- a/src/renderer/lang/en-us/view/list.json
+++ b/src/renderer/lang/en-us/view/list.json
@@ -10,6 +10,7 @@
"list_copy_name": "Copy name",
"list_add_to": "Add to ...",
"list_move_to": "Move to ...",
+ "list_sort": "Adjust position",
"list_download": "Download",
"list_remove": "Remove",
"list_source_detail": "Song Page",
diff --git a/src/renderer/lang/zh-cn/material/list_sort_modal.json b/src/renderer/lang/zh-cn/material/list_sort_modal.json
new file mode 100644
index 00000000..457585b2
--- /dev/null
+++ b/src/renderer/lang/zh-cn/material/list_sort_modal.json
@@ -0,0 +1,6 @@
+{
+ "title": "将 {name} 的位置调整到:",
+ "title_multiple": "将已选的 {num} 首歌曲的位置调整到:",
+ "input_tip": "请输入要调整到第几个位置",
+ "btn_confirm": "确定"
+}
diff --git a/src/renderer/lang/zh-cn/view/list.json b/src/renderer/lang/zh-cn/view/list.json
index 87778d88..3fbbf6bb 100644
--- a/src/renderer/lang/zh-cn/view/list.json
+++ b/src/renderer/lang/zh-cn/view/list.json
@@ -11,6 +11,7 @@
"list_source_detail": "歌曲详情页",
"list_add_to": "添加到...",
"list_move_to": "移动到...",
+ "list_sort": "调整位置",
"list_download": "下载",
"list_remove": "删除",
"default_list": "试听列表",
diff --git a/src/renderer/lang/zh-tw/material/list_sort_modal.json b/src/renderer/lang/zh-tw/material/list_sort_modal.json
new file mode 100644
index 00000000..7e3ddd66
--- /dev/null
+++ b/src/renderer/lang/zh-tw/material/list_sort_modal.json
@@ -0,0 +1,6 @@
+{
+ "title": "將 {name} 的位置調整到:",
+ "title_multiple": "將已選的 {num} 首歌曲的位置調整到:",
+ "input_tip": "請輸入要調整到第幾個位置",
+ "btn_confirm": "確定"
+}
diff --git a/src/renderer/lang/zh-tw/view/list.json b/src/renderer/lang/zh-tw/view/list.json
index 1f218c54..68b7f9fe 100644
--- a/src/renderer/lang/zh-tw/view/list.json
+++ b/src/renderer/lang/zh-tw/view/list.json
@@ -10,6 +10,7 @@
"list_copy_name": "複製歌曲名",
"list_add_to": "添加到...",
"list_move_to": "移動到...",
+ "list_sort": "調整位置",
"list_download": "下載",
"list_remove": "刪除",
"list_source_detail": "歌曲詳情頁",
diff --git a/src/renderer/store/modules/list.js b/src/renderer/store/modules/list.js
index 9df804c3..ce6ce500 100644
--- a/src/renderer/store/modules/list.js
+++ b/src/renderer/store/modules/list.js
@@ -185,6 +185,12 @@ const mutations = {
setListScroll(state, { id, location }) {
if (allList[id]) allList[id].location = location
},
+ sortList(state, { id, sortNum, musicInfos }) {
+ let targetList = allList[id]
+ this.commit('list/listRemoveMultiple', { id, list: musicInfos })
+
+ targetList.list.splice(sortNum - 1, 0, ...musicInfos)
+ },
}
export default {
diff --git a/src/renderer/views/List.vue b/src/renderer/views/List.vue
index df5a82e6..445b69e6 100644
--- a/src/renderer/views/List.vue
+++ b/src/renderer/views/List.vue
@@ -69,6 +69,7 @@
material-menu(:menus="listsItemMenu" :location="listsData.menuLocation" item-name="name" :isShow="listsData.isShowItemMenu" @menu-click="handleListsItemMenuClick")
material-menu(:menus="listItemMenu" :location="listMenu.menuLocation" item-name="name" :isShow="listMenu.isShowItemMenu" @menu-click="handleListItemMenuClick")
material-search-list(:list="list" @action="handleMusicSearchAction" :visible="isVisibleMusicSearch")
+ material-list-sort-modal(:show="isShowListSortModal" :music-info="musicInfo" :selected-num="selectdListDetailData.length" @close="isShowListSortModal = false" @confirm="handleSortMusicInfo")