|
|
@@ -668,6 +668,10 @@ export struct LocalMusic {
|
|
|
this.albumMap = e.data.data1;
|
|
|
|
|
|
this.albumList = e.data.data2
|
|
|
+ //查询完毕在启动是否自动播放
|
|
|
+ if(this.isStartAutoPlay){
|
|
|
+ this.startPlayOrResumePlay()
|
|
|
+ }
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
@@ -734,9 +738,7 @@ export struct LocalMusic {
|
|
|
this.videoUrl = this.currentSong.filePath
|
|
|
this.name = this.currentSong.name
|
|
|
this.cover = this.currentSong.pixelMapPath
|
|
|
- if(this.isStartAutoPlay){
|
|
|
- this.startPlayOrResumePlay()
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
} else {
|
|
|
this.name = '空空如也'
|
|
|
@@ -1039,6 +1041,7 @@ export struct LocalMusic {
|
|
|
let dataBean = new BubbleBean()
|
|
|
dataBean.data = ["首页", "媒体库", "艺术家", "专辑", "同步数据"]
|
|
|
dataBean.color = this.themeColor
|
|
|
+ dataBean.modeType = this.modeType
|
|
|
dataBean.imageRes =
|
|
|
[$r('app.media.home_press'), $r('app.media.kp_music'), $r('app.media.music_menu'), $r('app.media.llq'),
|
|
|
$r('app.media.refresh')]
|
|
|
@@ -1089,13 +1092,7 @@ export struct LocalMusic {
|
|
|
this.titleBarModel.setTitleName(Utility.resourceToString(this.context, $r('app.string.album')))
|
|
|
break
|
|
|
case 4: //同步数据
|
|
|
- workerInstance.postMessage({
|
|
|
- code: 1,
|
|
|
- data1: this.context,
|
|
|
- data2: this.rootPath,
|
|
|
- data3: this.lockPath,
|
|
|
- data4: PreferencesUtil.getStringSync('COVER_API', ''),
|
|
|
- });
|
|
|
+ this.asyncCurrentPathData()
|
|
|
break
|
|
|
}
|
|
|
|
|
|
@@ -2046,27 +2043,30 @@ export struct LocalMusic {
|
|
|
})
|
|
|
.position({ bottom:this.isPhoneLan()?130: 168 }) // 将 Row 固定在底部
|
|
|
|
|
|
- // Column() {
|
|
|
- // Button('导入音乐', { type: ButtonType.Capsule, stateEffect: true })
|
|
|
- // .width('50%')
|
|
|
- // .height(55)
|
|
|
- // .margin({ top: 50, bottom: 40 })
|
|
|
- // .backgroundColor(this.themeColor)
|
|
|
- //
|
|
|
- // .onClick(() => {
|
|
|
- // this.showSheelDialog()
|
|
|
- // })
|
|
|
- //
|
|
|
- // }
|
|
|
- // .height('100%')
|
|
|
- // .justifyContent(FlexAlign.Center)
|
|
|
- // .opacity(this.isZero ? 1 : 0)
|
|
|
- // .visibility(this.isZero && this.modeType === 0 ? Visibility.None : Visibility.None)
|
|
|
- // .animation({
|
|
|
- // duration: 666,
|
|
|
- // curve: 'ease-in-out' // 可选动画曲线
|
|
|
- // })
|
|
|
- // .width('100%')
|
|
|
+ if(this.modeType==0){
|
|
|
+ Column() {
|
|
|
+ Button('同步数据', { type: ButtonType.Capsule, stateEffect: true })
|
|
|
+ .width(130)
|
|
|
+ .height(50)
|
|
|
+ .margin({ top: 50, bottom: 40 })
|
|
|
+ .backgroundColor(this.themeColor)
|
|
|
+
|
|
|
+ .onClick(() => {
|
|
|
+ this.asyncCurrentPathData()
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ .height('60%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .opacity(this.isZero ? 1 : 0)
|
|
|
+ .visibility(this.isZero&&!this.isFavMusic&&!this.isHistory
|
|
|
+ && this.modeType === 0 ? Visibility.Visible : Visibility.None)
|
|
|
+ .animation({
|
|
|
+ duration: 666,
|
|
|
+ curve: 'ease-in-out' // 可选动画曲线
|
|
|
+ })
|
|
|
+ .width('100%')
|
|
|
+ }
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('100%')
|
|
|
@@ -2092,6 +2092,18 @@ export struct LocalMusic {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ asyncCurrentPathData(){
|
|
|
+ if(this.modeType==0){
|
|
|
+ workerInstance.postMessage({
|
|
|
+ code: 1,
|
|
|
+ data1: this.context,
|
|
|
+ data2: this.currentPath,
|
|
|
+ data3: this.lockPath,
|
|
|
+ data4: PreferencesUtil.getStringSync('COVER_API', ''),
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 处理文件选择的函数
|
|
|
handleFileSelection(item: VideoItem, checked: boolean) {
|
|
|
if (checked) {
|
|
|
@@ -5187,6 +5199,15 @@ export struct LocalMusic {
|
|
|
//是不是手机横屏
|
|
|
|
|
|
isPhoneLan() {
|
|
|
+ // LogUtil.info('twocold this.currentHeightBreakpoint = '+this.currentHeightBreakpoint)
|
|
|
+ // LogUtil.info('twocold this.currentWidthBreakpoint = '+this.currentWidthBreakpoint)
|
|
|
+ if(DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
|
+ &&this.currentHeightBreakpoint == HeightBreakpoint.HEIGHT_SM
|
|
|
+ &&this.currentWidthBreakpoint==WidthBreakpoint.WIDTH_MD){//如果是手机横屏,返回false
|
|
|
+
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
|
&& this.currentBreakpoint !== BreakpointTypeEnum.SM) {
|
|
|
if (DisplayUtil.getFoldStatus() === 0 ) {
|
|
|
@@ -9919,6 +9940,7 @@ function customPopupBuilder(dataBu: BubbleBean) {
|
|
|
right: 10,
|
|
|
left: 10
|
|
|
})
|
|
|
+ .fontColor(dataBu.modeType ==index?dataBu.color:$r('app.color.index_tab_font_color'))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.width("100%")
|
|
|
}
|