|
@@ -81,6 +81,8 @@ import { KeyCode } from '@kit.InputKit';
|
|
|
import { KnockController } from '../controller/KnockController';
|
|
import { KnockController } from '../controller/KnockController';
|
|
|
import { DeleteComptent } from '../view/DeleteComptent'
|
|
import { DeleteComptent } from '../view/DeleteComptent'
|
|
|
import { ABLoopComptent } from '../view/ABLoopComptent';
|
|
import { ABLoopComptent } from '../view/ABLoopComptent';
|
|
|
|
|
+import { FixMessyView } from '../view/FixMessyView';
|
|
|
|
|
+
|
|
|
const TAG = 'LocalMusic';
|
|
const TAG = 'LocalMusic';
|
|
|
|
|
|
|
|
const DEFAULT_INDEX =
|
|
const DEFAULT_INDEX =
|
|
@@ -210,6 +212,7 @@ export struct LocalMusic {
|
|
|
private listScroller: ListScroller = new ListScroller()
|
|
private listScroller: ListScroller = new ListScroller()
|
|
|
private playListScroller: Scroller = new Scroller()
|
|
private playListScroller: Scroller = new Scroller()
|
|
|
@State isOneKeyTags:boolean = false
|
|
@State isOneKeyTags:boolean = false
|
|
|
|
|
+ @State isFixMessy:boolean = false
|
|
|
@StorageProp('isLandscape') @Watch('onIsLandscapeChange') isLandscape: boolean = false;
|
|
@StorageProp('isLandscape') @Watch('onIsLandscapeChange') isLandscape: boolean = false;
|
|
|
@StorageProp('topRectHeight') topRectHeight: number = px2vp(AppUtil.getStatusBarHeight());
|
|
@StorageProp('topRectHeight') topRectHeight: number = px2vp(AppUtil.getStatusBarHeight());
|
|
|
@StorageProp('windowWidth') windowWidth: number = 0;
|
|
@StorageProp('windowWidth') windowWidth: number = 0;
|
|
@@ -764,7 +767,7 @@ export struct LocalMusic {
|
|
|
PreferencesUtil.putSync('isFirstApp', false)
|
|
PreferencesUtil.putSync('isFirstApp', false)
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
- workerInstance.postMessage({ code: 2, data: this.context });
|
|
|
|
|
|
|
+ workerInstance.postMessage({ code: 2, data: this.context,data2:this.packName });
|
|
|
workerInstance.postMessage({ code: 3, data: this.context });
|
|
workerInstance.postMessage({ code: 3, data: this.context });
|
|
|
workerInstance.postMessage({ code: 4, data: this.context });
|
|
workerInstance.postMessage({ code: 4, data: this.context });
|
|
|
this.getHistoryList(false)
|
|
this.getHistoryList(false)
|
|
@@ -958,7 +961,7 @@ export struct LocalMusic {
|
|
|
this.isFavMusic = false
|
|
this.isFavMusic = false
|
|
|
console.info('onecold getSortedFiles 1 curPath '+curPath)
|
|
console.info('onecold getSortedFiles 1 curPath '+curPath)
|
|
|
if (isWorkerPost) {
|
|
if (isWorkerPost) {
|
|
|
- workerInstance.postMessage({ code: 2, data: this.context }); //刷新媒体库列表
|
|
|
|
|
|
|
+ workerInstance.postMessage({ code: 2, data: this.context,data2:this.packName });
|
|
|
}
|
|
}
|
|
|
if (this.modeType !== 0) {
|
|
if (this.modeType !== 0) {
|
|
|
|
|
|
|
@@ -1288,10 +1291,10 @@ export struct LocalMusic {
|
|
|
onAction: (index) => {
|
|
onAction: (index) => {
|
|
|
switch (index) {
|
|
switch (index) {
|
|
|
case 0:
|
|
case 0:
|
|
|
- Utility.doSortListAscending(this.videoLocalList)
|
|
|
|
|
|
|
+ Utility.doSortListAscending(this.videoLocalList,this.isShowFileName)
|
|
|
break;
|
|
break;
|
|
|
case 1:
|
|
case 1:
|
|
|
- Utility.doSortListDescending(this.videoLocalList)
|
|
|
|
|
|
|
+ Utility.doSortListDescending(this.videoLocalList,this.isShowFileName)
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
this.updateListData(this.videoLocalList)
|
|
this.updateListData(this.videoLocalList)
|
|
@@ -1387,10 +1390,10 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
case 4:
|
|
case 4:
|
|
|
- Utility.doSortListAscending(this.videoLocalList)
|
|
|
|
|
|
|
+ Utility.doSortListAscending(this.videoLocalList,this.isShowFileName)
|
|
|
break;
|
|
break;
|
|
|
case 5:
|
|
case 5:
|
|
|
- Utility.doSortListDescending(this.videoLocalList)
|
|
|
|
|
|
|
+ Utility.doSortListDescending(this.videoLocalList,this.isShowFileName)
|
|
|
break;
|
|
break;
|
|
|
case 6:
|
|
case 6:
|
|
|
this.videoLocalList.sort((a, b) => {
|
|
this.videoLocalList.sort((a, b) => {
|
|
@@ -2116,8 +2119,9 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
Row() {
|
|
Row() {
|
|
|
Button(this.isAllSelected ? '全不选' : '全选', { type: ButtonType.Circle, stateEffect: true })
|
|
Button(this.isAllSelected ? '全不选' : '全选', { type: ButtonType.Circle, stateEffect: true })
|
|
|
- .width('35%')
|
|
|
|
|
- .height(60)
|
|
|
|
|
|
|
+ .width(50)
|
|
|
|
|
+ .height(50)
|
|
|
|
|
+ .fontSize(13)
|
|
|
.margin({ top: 10, bottom: 10, right: 6 })
|
|
.margin({ top: 10, bottom: 10, right: 6 })
|
|
|
.backgroundColor(this.themeColor)
|
|
.backgroundColor(this.themeColor)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
@@ -2133,8 +2137,9 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
Button('内嵌标签', { type: ButtonType.Capsule, stateEffect: true })
|
|
Button('内嵌标签', { type: ButtonType.Capsule, stateEffect: true })
|
|
|
- .width(100)
|
|
|
|
|
- .height(60)
|
|
|
|
|
|
|
+ .width(90)
|
|
|
|
|
+ .height(50)
|
|
|
|
|
+ .fontSize(13)
|
|
|
.margin({ top: 10, bottom: 10, right: 6 })
|
|
.margin({ top: 10, bottom: 10, right: 6 })
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
.backgroundColor(this.themeColor)
|
|
.backgroundColor(this.themeColor)
|
|
@@ -2144,6 +2149,20 @@ export struct LocalMusic {
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.isOneKeyTags = !this.isOneKeyTags
|
|
this.isOneKeyTags = !this.isOneKeyTags
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ Button('乱码修复', { type: ButtonType.Capsule, stateEffect: true })
|
|
|
|
|
+ .width(90)
|
|
|
|
|
+ .height(50)
|
|
|
|
|
+ .fontSize(13)
|
|
|
|
|
+ .margin({ top: 10, bottom: 10, right: 6 })
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
|
|
+ .backgroundColor(this.themeColor)
|
|
|
|
|
+ .bindContentCover($$this.isFixMessy, this.FixMessyViewBuilder(), {
|
|
|
|
|
+ transition: TransitionEffect.translate({ x: 500 }).animation({ curve: curves.springMotion(0.6, 0.8) })
|
|
|
|
|
+ })
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ this.isFixMessy = !this.isFixMessy
|
|
|
|
|
+ })
|
|
|
// Button('剪切', { type: ButtonType.Circle, stateEffect: true })
|
|
// Button('剪切', { type: ButtonType.Circle, stateEffect: true })
|
|
|
// .width('35%')
|
|
// .width('35%')
|
|
|
// .height(60)
|
|
// .height(60)
|
|
@@ -2179,8 +2198,9 @@ export struct LocalMusic {
|
|
|
// })
|
|
// })
|
|
|
|
|
|
|
|
Button('删除', { type: ButtonType.Circle, stateEffect: true })
|
|
Button('删除', { type: ButtonType.Circle, stateEffect: true })
|
|
|
- .width('35%')
|
|
|
|
|
- .height(60)
|
|
|
|
|
|
|
+ .width(50)
|
|
|
|
|
+ .height(50)
|
|
|
|
|
+ .fontSize(13)
|
|
|
.margin({ top: 10, bottom: 10, right: 6 })
|
|
.margin({ top: 10, bottom: 10, right: 6 })
|
|
|
.visibility(this.isFavMusic ? Visibility.None : Visibility.Visible)
|
|
.visibility(this.isFavMusic ? Visibility.None : Visibility.Visible)
|
|
|
.backgroundColor(this.themeColor)
|
|
.backgroundColor(this.themeColor)
|
|
@@ -2189,8 +2209,9 @@ export struct LocalMusic {
|
|
|
this.showWarnIsDelete()
|
|
this.showWarnIsDelete()
|
|
|
})
|
|
})
|
|
|
Button('取消', { type: ButtonType.Circle, stateEffect: true })
|
|
Button('取消', { type: ButtonType.Circle, stateEffect: true })
|
|
|
- .width('35%')
|
|
|
|
|
- .height(60)
|
|
|
|
|
|
|
+ .width(50)
|
|
|
|
|
+ .height(50)
|
|
|
|
|
+ .fontSize(13)
|
|
|
.margin({ top: 10, bottom: 10, right: 6 })
|
|
.margin({ top: 10, bottom: 10, right: 6 })
|
|
|
.backgroundColor(this.themeColor)
|
|
.backgroundColor(this.themeColor)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
@@ -2210,7 +2231,7 @@ export struct LocalMusic {
|
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
|
})
|
|
})
|
|
|
.position(this.isShowCoverHeader() ? { bottom: 78 }
|
|
.position(this.isShowCoverHeader() ? { bottom: 78 }
|
|
|
- : { bottom: this.isPhoneLan() ? 130 : 168 }) // 将 Row 固定在底部
|
|
|
|
|
|
|
+ : { bottom: this.isPhoneLan() ? 130 : 170 }) // 将 Row 固定在底部
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2260,6 +2281,29 @@ export struct LocalMusic {
|
|
|
.height('100%')
|
|
.height('100%')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Builder
|
|
|
|
|
+ FixMessyViewBuilder() {
|
|
|
|
|
+ Scroll() {
|
|
|
|
|
+ Column() {
|
|
|
|
|
+ FixMessyView(
|
|
|
|
|
+ {
|
|
|
|
|
+ selectedFiles:this.selectedFiles,
|
|
|
|
|
+ isShowDrawer:this.isFixMessy,
|
|
|
|
|
+ onFixResult:(result: boolean)=>{
|
|
|
|
|
+ this.isMultiSelect = false
|
|
|
|
|
+ if(result){//如果嵌入成功,更新数据
|
|
|
|
|
+ this.doUpdateData()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .height('100%')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
asyncCurrentPathData() {
|
|
asyncCurrentPathData() {
|
|
|
if (this.modeType == 0) {
|
|
if (this.modeType == 0) {
|
|
|
workerInstance.postMessage({
|
|
workerInstance.postMessage({
|
|
@@ -2428,7 +2472,7 @@ export struct LocalMusic {
|
|
|
LogUtil.info('onecold doFav currentPath =' + this.currentPath)
|
|
LogUtil.info('onecold doFav currentPath =' + this.currentPath)
|
|
|
this.getSortedFiles(this.currentPath)
|
|
this.getSortedFiles(this.currentPath)
|
|
|
}
|
|
}
|
|
|
- workerInstance.postMessage({ code: 2, data: this.context });
|
|
|
|
|
|
|
+ workerInstance.postMessage({ code: 2, data: this.context,data2:this.packName });
|
|
|
workerInstance.postMessage({ code: 3, data: this.context });
|
|
workerInstance.postMessage({ code: 3, data: this.context });
|
|
|
workerInstance.postMessage({ code: 4, data: this.context });
|
|
workerInstance.postMessage({ code: 4, data: this.context });
|
|
|
}
|
|
}
|
|
@@ -3261,7 +3305,7 @@ export struct LocalMusic {
|
|
|
if(this.modeType == 0){
|
|
if(this.modeType == 0){
|
|
|
this.asyncCurrentPathData()
|
|
this.asyncCurrentPathData()
|
|
|
}else if(this.modeType ==1){
|
|
}else if(this.modeType ==1){
|
|
|
- workerInstance.postMessage({ code: 2, data: this.context });
|
|
|
|
|
|
|
+ workerInstance.postMessage({ code: 2, data: this.context,data2:this.packName });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -5317,7 +5361,7 @@ export struct LocalMusic {
|
|
|
this.deleteCache(this.currentPath)
|
|
this.deleteCache(this.currentPath)
|
|
|
this.getSortedFiles(this.currentPath)
|
|
this.getSortedFiles(this.currentPath)
|
|
|
}
|
|
}
|
|
|
- workerInstance.postMessage({ code: 2, data: this.context });
|
|
|
|
|
|
|
+ workerInstance.postMessage({ code: 2, data: this.context,data2:this.packName });
|
|
|
workerInstance.postMessage({ code: 3, data: this.context });
|
|
workerInstance.postMessage({ code: 3, data: this.context });
|
|
|
workerInstance.postMessage({ code: 4, data: this.context });
|
|
workerInstance.postMessage({ code: 4, data: this.context });
|
|
|
}, 999)
|
|
}, 999)
|