|
|
@@ -654,6 +654,7 @@ export struct LocalMusic {
|
|
|
|
|
|
case 104: //收到查询专辑列表
|
|
|
this.albumMap = e.data.data1;
|
|
|
+
|
|
|
this.albumList = e.data.data2
|
|
|
break;
|
|
|
|
|
|
@@ -2068,9 +2069,11 @@ export struct LocalMusic {
|
|
|
// 处理文件选择的函数
|
|
|
handleFileSelection(item: VideoItem, checked: boolean) {
|
|
|
if (checked) {
|
|
|
- this.selectedFiles.push(item);
|
|
|
+ if (!this.selectedFiles.some(x => x.filePath == item.filePath)) {
|
|
|
+ this.selectedFiles.push(item);
|
|
|
+ }
|
|
|
} else {
|
|
|
- const index = this.selectedFiles.indexOf(item);
|
|
|
+ const index = this.selectedFiles.findIndex(x => x.filePath == item.filePath);
|
|
|
if (index > -1) {
|
|
|
this.selectedFiles.splice(index, 1);
|
|
|
}
|
|
|
@@ -2339,7 +2342,7 @@ export struct LocalMusic {
|
|
|
Text(`${this.artistMap.get(item.name)?.length ?? 0}首`)
|
|
|
.fontSize(this.twoFingerType==1?11:this.twoFingerType==2?12:14)
|
|
|
.padding({ top: 8 })
|
|
|
- .visibility(this.modeType === 2 ? Visibility.Visible : Visibility.None)
|
|
|
+ .visibility(this.modeType === 2? Visibility.Visible : Visibility.None)
|
|
|
.fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 10 })
|
|
|
Text(`${this.albumMap.get(item.name)?.length ?? 0}首`)
|
|
|
@@ -3084,7 +3087,7 @@ export struct LocalMusic {
|
|
|
.cachedCount(3)
|
|
|
// .columnsTemplate('1fr '.repeat(this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_SM ? 2 : 5))
|
|
|
.columnsTemplate(this.twoFingerType==3?'repeat(auto-fit, 150)':this.twoFingerType==2?'repeat(auto-fit, 110)':'repeat(auto-fit, 80)')
|
|
|
- .rowsGap(this.twoFingerType==3?25:this.twoFingerType==2?20:10)
|
|
|
+ .rowsGap(this.twoFingerType==3?10:this.twoFingerType==2?5:1)
|
|
|
.visibility(this.isGridMusic?Visibility.Visible:Visibility.None)
|
|
|
.scale({x:this.scaleValue,y:this.scaleValue,z:1})
|
|
|
.gesture(PinchGesture({ fingers: 2 })
|
|
|
@@ -3160,8 +3163,8 @@ export struct LocalMusic {
|
|
|
.alt($r('app.media.ic_avatar6'))
|
|
|
.clip(true)
|
|
|
.borderRadius({
|
|
|
- topLeft: 20,
|
|
|
- topRight : 20,
|
|
|
+ topLeft: 12,
|
|
|
+ topRight : 12,
|
|
|
bottomLeft: 0,
|
|
|
bottomRight: 0
|
|
|
})
|
|
|
@@ -3252,7 +3255,7 @@ export struct LocalMusic {
|
|
|
|
|
|
}
|
|
|
.width(this.getGridWight())
|
|
|
- .borderRadius(20)
|
|
|
+ .borderRadius(12)
|
|
|
.backgroundImage(item.pixelMapPath)
|
|
|
.backgroundImageSize({ height: '100%',width:'100%' })
|
|
|
.backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
|
|
|
@@ -3260,7 +3263,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
|
Checkbox({ name: 'checkbox' + index })
|
|
|
- .select(this.selectedFiles.some(x => x.filePath === item.filePath))
|
|
|
+ .select(this.selectedFiles.some(x => x.filePath == item.filePath))
|
|
|
.selectedColor(this.themeColor)
|
|
|
.shape(CheckBoxShape.CIRCLE)
|
|
|
.opacity(this.isMultiSelect ? 1 : 0)
|
|
|
@@ -3277,10 +3280,12 @@ export struct LocalMusic {
|
|
|
}
|
|
|
.backgroundColor(Color.Transparent)
|
|
|
.width('100%')
|
|
|
+ .padding({top:15})
|
|
|
.height(this.getGridAllHeight())
|
|
|
.onClick(() => {
|
|
|
if(this.isMultiSelect&&item.type!==CommonConstants.TYPE_IS_DIR){
|
|
|
- this.handleFileSelection(item, !this.selectedFiles.some(x => x.filePath === item.filePath))
|
|
|
+ const isChecked = this.selectedFiles.some(x => x.filePath == item.filePath);
|
|
|
+ this.handleFileSelection(item, !isChecked);
|
|
|
}else{
|
|
|
this.doPlay(item, index)
|
|
|
}
|
|
|
@@ -3289,16 +3294,16 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
getGridAllHeight(){
|
|
|
- let heightG = 210
|
|
|
+ let heightG = 222
|
|
|
switch (this.twoFingerType){
|
|
|
case 1:
|
|
|
- heightG = 105
|
|
|
+ heightG = 118
|
|
|
break;
|
|
|
case 2:
|
|
|
- heightG = 155
|
|
|
+ heightG = 168
|
|
|
break;
|
|
|
case 3:
|
|
|
- heightG = 210
|
|
|
+ heightG = 222
|
|
|
break;
|
|
|
}
|
|
|
return heightG
|
|
|
@@ -3506,8 +3511,12 @@ export struct LocalMusic {
|
|
|
&& item.type !== CommonConstants.TYPE_IS_CSJAD &&
|
|
|
!this.isHistory) ? { end: this.DeleteButton(item, index, item.filePath) } : {}) //左滑
|
|
|
.onClick(() => {
|
|
|
-
|
|
|
- this.doPlay(item, index)
|
|
|
+ if(this.isMultiSelect&&item.type!==CommonConstants.TYPE_IS_DIR){
|
|
|
+ const isChecked = this.selectedFiles.some(x => x.filePath == item.filePath);
|
|
|
+ this.handleFileSelection(item, !isChecked);
|
|
|
+ }else{
|
|
|
+ this.doPlay(item, index)
|
|
|
+ }
|
|
|
|
|
|
})
|
|
|
|
|
|
@@ -6242,9 +6251,9 @@ export struct LocalMusic {
|
|
|
.visibility(this.isPuraWP()?Visibility.None:Visibility.Visible)
|
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
.clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
|
- // .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 1.2, y: 1.2 }).animation({ duration: 500 }),
|
|
|
- // TransitionEffect.scale({ x: 0, y: 0 }) ))
|
|
|
- .align(Alignment.Center)// .opacity(this.isCoverOpacity()||this.isCoverRectangle?0:1)
|
|
|
+ .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 1.2, y: 1.2 }).animation({ duration: 500 }),
|
|
|
+ TransitionEffect.scale({ x: 0, y: 0 }) ))
|
|
|
+ .align(Alignment.Center)//
|
|
|
.clip(true)
|
|
|
.rotate({
|
|
|
x: 0,
|