|
|
@@ -163,6 +163,7 @@ const ITEM_HEIGHT_BIG: number = 78; // 列表项大高度
|
|
|
@Preview
|
|
|
@Component
|
|
|
export struct LocalMusic {
|
|
|
+ @State offHeight: number = 75
|
|
|
@State currentSongList: Array<VideoItem> = []//当前歌单
|
|
|
@Consume currentSongListName:string //当前歌单名称
|
|
|
@Consume @Watch('onIDChange') currentSongListID:string //当前歌单ID
|
|
|
@@ -219,7 +220,7 @@ export struct LocalMusic {
|
|
|
@State sortType: number = 4 //默认排序方式
|
|
|
@State isShowSimi: boolean = false //是否显示私密音频
|
|
|
@State isShowFAV: boolean = true //是否显示我的收藏
|
|
|
- @State isShowTitleBar: boolean = true //是否显示分类导航条
|
|
|
+ @State @Watch('onTopBarhange')isShowTitleBar: boolean = true //是否显示分类导航条
|
|
|
@State isShowAllBar: boolean = true //是否显示播放全部条
|
|
|
@State isShowSingleLineLyric: boolean = false //是否显示单行歌词
|
|
|
@State isShowHistory: boolean = true //是否显示最近播放
|
|
|
@@ -250,6 +251,7 @@ export struct LocalMusic {
|
|
|
@State isFixMessy:boolean = false
|
|
|
@StorageProp('isLandscape') @Watch('onIsLandscapeChange') isLandscape: boolean = false;
|
|
|
@StorageProp('topRectHeight') topRectHeight: number = px2vp(AppUtil.getStatusBarHeight());
|
|
|
+ @StorageProp('bottomRectHeight') bottomRectHeight: number = 0;
|
|
|
@StorageProp('windowWidth') windowWidth: number = 0;
|
|
|
@StorageProp('windowHeight') windowHeight: number = 0;
|
|
|
@StorageProp('isHiCarStatus') isHiCarStatus: boolean = false;
|
|
|
@@ -301,11 +303,29 @@ export struct LocalMusic {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //bar导航条显示状态变化,不显示的话把topBarHeight=0
|
|
|
+ onTopBarhange(){
|
|
|
+ if(this.isShowTitleBar){
|
|
|
+ console.log('onecold 导航条显示')
|
|
|
+ this.topBarHeight = 50
|
|
|
+ this.offHeight = 75
|
|
|
+ }else{
|
|
|
+ console.log('onecold 导航条隐藏')
|
|
|
+ this.topBarHeight = 0
|
|
|
+ if(this.twoFingerType!=4){
|
|
|
+ this.offHeight = 30
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//点击某个歌单id发生变化的时候回调
|
|
|
onIDChange(){
|
|
|
console.log('onecold 歌单id发生变化this.currentSongListID='+this.currentSongListID)
|
|
|
console.log('onecold 歌单id发生变化this.currentSongListName='+this.currentSongListName)
|
|
|
if(this.modeType==4){
|
|
|
+ this.isShowTitleBar = false
|
|
|
this.titleBarModel.setTitleName(this.currentSongListName)
|
|
|
this.titleBarModel.setLeftIconMainNoAnimate($r('app.media.menu'))
|
|
|
//获取缓存
|
|
|
@@ -314,7 +334,6 @@ export struct LocalMusic {
|
|
|
if(StrUtil.isNotEmpty(cacheSongs)){
|
|
|
this.currentSongList = JSON.parse(cacheSongs) as VideoItem[]
|
|
|
this.updateListData(this.currentSongList, true)
|
|
|
- this.isShowTitleBar = false
|
|
|
}
|
|
|
this.doSongListTask()//获取歌单信息
|
|
|
}
|
|
|
@@ -478,6 +497,7 @@ export struct LocalMusic {
|
|
|
.setLeftIconWidth(26)
|
|
|
.setLeftIconHeight(26)
|
|
|
.setTitleName('首页')
|
|
|
+ .setTitleBarMinHeight(55)
|
|
|
.setTitleFontSize(18)
|
|
|
.setTitleFontColor(Color.White)
|
|
|
.setTitleBarBackground(this.isDarkMode ? $r('app.color.title_bar_bg') : this.themeColor)
|
|
|
@@ -2218,6 +2238,7 @@ export struct LocalMusic {
|
|
|
.id('pup_positon_music')
|
|
|
}
|
|
|
|
|
|
+
|
|
|
Stack() {
|
|
|
Column() {
|
|
|
|
|
|
@@ -2314,7 +2335,7 @@ export struct LocalMusic {
|
|
|
emptyView(this.themeColor)
|
|
|
|
|
|
}
|
|
|
- .position({ top: 180 })
|
|
|
+ .position({ top:this.isShowCoverHeader() ? 260 : 180 })
|
|
|
.transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 1.2, y: 1.2 })
|
|
|
.animation({ duration: 500 }),
|
|
|
TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
@@ -2332,7 +2353,6 @@ export struct LocalMusic {
|
|
|
}
|
|
|
.layoutWeight(1)
|
|
|
.height('100%')
|
|
|
-
|
|
|
}
|
|
|
|
|
|
.layoutWeight(1)
|
|
|
@@ -3140,6 +3160,7 @@ export struct LocalMusic {
|
|
|
.visibility(this.isCustomizeBg ? Visibility.Hidden : Visibility.Visible)
|
|
|
}
|
|
|
.width('100%')
|
|
|
+ .height(this.topBarHeight)
|
|
|
.visibility(this.isShowTitleBar ? Visibility.Visible : Visibility.None)
|
|
|
}
|
|
|
|
|
|
@@ -3232,6 +3253,7 @@ export struct LocalMusic {
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return (this.modeType == 2 || this.modeType == 3) && this.isCanBack
|
|
|
}
|
|
|
@Builder
|
|
|
@@ -3705,7 +3727,8 @@ export struct LocalMusic {
|
|
|
.width('100%')
|
|
|
.padding(10)
|
|
|
.height(50)
|
|
|
- .visibility(this.modeType === 0 || this.modeType === 1 || this.isCanBack ? Visibility.Visible : Visibility.None)
|
|
|
+ .visibility(this.modeType === 0 || this.modeType === 1||this.modeType === 4
|
|
|
+ || this.isCanBack ? Visibility.Visible : Visibility.None)
|
|
|
.border({
|
|
|
width: { bottom: 1 },
|
|
|
color: this.isCustomizeBg ? Color.Transparent : '#12ec5c87'
|
|
|
@@ -3877,11 +3900,15 @@ export struct LocalMusic {
|
|
|
.columnsGap(12) // 列间距
|
|
|
.rowsGap(16) // 行间距
|
|
|
.cachedCount(6)
|
|
|
- .margin(
|
|
|
- this.isHiCar()?{bottom:this.bottomBarHeight+90}:
|
|
|
- {bottom:this.isShowCoverHeader()? this.topBarHeight+35:
|
|
|
- this.isCoverOpacity()?this.topBarHeight+this.bottomBarHeight+78
|
|
|
- :this.topBarHeight+this.bottomBarHeight+108})
|
|
|
+ // .margin(
|
|
|
+ // this.isHiCar()?{bottom:this.bottomBarHeight+90}:
|
|
|
+ // {bottom:this.isShowCoverHeader()? this.topBarHeight+35:
|
|
|
+ // this.isCoverOpacity()?this.topBarHeight+this.bottomBarHeight+78
|
|
|
+ // :this.topBarHeight+this.bottomBarHeight+108})
|
|
|
+ .margin({
|
|
|
+ bottom:this.isShowCoverHeader() ? this.bottomBarHeight+30
|
|
|
+ : this.bottomBarHeight+this.topRectHeight+this.topBarHeight+this.offHeight
|
|
|
+ })
|
|
|
.transition(TransitionEffect.move(TransitionEdge.BOTTOM)
|
|
|
.animation({ duration: 500, curve: Curve.Ease }))
|
|
|
.scrollBar(BarState.Off)
|
|
|
@@ -5040,20 +5067,22 @@ export struct LocalMusic {
|
|
|
.onActionStart(e => {
|
|
|
|
|
|
}))
|
|
|
- // .divider({ strokeWidth: 1, color: this.isDarkMode? '#333333':'#ffe9f0f0' })
|
|
|
- .margin(
|
|
|
- this.isHiCar()&&(this.windowWidth>1800&&this.windowHeight>=1200)?{bottom:this.bottomBarHeight+98}:
|
|
|
- {
|
|
|
- bottom: this.isCoverOpacity() ? (this.isShowCoverHeader() ? this.topBarHeight+25 : this.topBarHeight+80)
|
|
|
- : (this.isShowCoverHeader() ? this.topBarHeight+35 : this.isHiCarSmall()?this.topBarHeight+90:this.topBarHeight+165)
|
|
|
- })
|
|
|
+ // .margin(
|
|
|
+ // this.isHiCar()&&(this.windowWidth>1800&&this.windowHeight>=1200)?{bottom:this.bottomBarHeight+98}:
|
|
|
+ // {
|
|
|
+ // bottom: this.isCoverOpacity() ? (this.isShowCoverHeader() ? this.topBarHeight+25 : this.topBarHeight+80)
|
|
|
+ // : (this.isShowCoverHeader() ? this.topBarHeight+35 :
|
|
|
+ // this.isHiCarSmall()||this.modeType==4?this.topBarHeight+90:this.topBarHeight+165)
|
|
|
+ // })
|
|
|
+ .margin({
|
|
|
+ bottom:this.isShowCoverHeader() ? this.bottomBarHeight+30
|
|
|
+ : this.bottomBarHeight+this.topRectHeight+this.topBarHeight+this.offHeight
|
|
|
+ })
|
|
|
.cachedCount(6)
|
|
|
.reuseId('list_item')
|
|
|
.borderRadius(20)
|
|
|
.transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 0.8, y: 0.8 }).animation({ duration: 500 }),
|
|
|
TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
- // .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
|
|
|
- // .animation({ duration: 500, curve: Curve.Ease }))
|
|
|
.layoutWeight(1)
|
|
|
.onScrollIndex((start) => {
|
|
|
this.selectedIndex = start
|
|
|
@@ -7555,9 +7584,11 @@ export struct LocalMusic {
|
|
|
@State barBottomOpacity: number = 1
|
|
|
private hideDone: boolean = false;
|
|
|
@State currentYOffset: number = 0;
|
|
|
- @State bottomBarHeight: number = 60;
|
|
|
+ @State bottomBarHeight: number = 55;
|
|
|
private isHiding: boolean = false;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//是否是Pura X外屏,或者小屏幕
|
|
|
isPuraWP() {
|
|
|
|