Explorar el Código

grid点击item进去也有封面header

onecold hace 1 año
padre
commit
6f52bfe324

+ 1 - 0
entry/src/main/ets/pages/NewIndex.ets

@@ -388,6 +388,7 @@ struct NewIndex {
             Text('VIP')
               .fontSize(9)
               .padding(2)
+              .textAlign(TextAlign.Center)
               .fontWeight(FontWeight.Bolder)
               .fontColor(Color.White)
               .visibility(Utility.isNoble()?Visibility.Visible:Visibility.None)

+ 1 - 1
entry/src/main/ets/pages/SettingPage.ets

@@ -661,7 +661,7 @@ export struct SettingPage {
 
             // 网格布局
             Row() {
-              Text('网格列表模式')
+              Text('网格模式')
                 .margin({ left: 18 })
                 .fontSize(15)
                 .fontColor(Color.Gray)

+ 1 - 0
entry/src/main/ets/pages/UserCenter.ets

@@ -478,6 +478,7 @@ export struct UserCenter {
             Text('VIP')
               .fontSize(9)
               .padding(2)
+              .textAlign(TextAlign.Center)
               .fontWeight(FontWeight.Bolder)
               .fontColor(Color.White)
               .visibility(Utility.isNoble()?Visibility.Visible:Visibility.None)

+ 27 - 16
entry/src/main/ets/view/LocalMusic.ets

@@ -1916,7 +1916,7 @@ export struct LocalMusic {
 
     Scroll() {
       Column() {
-        if(!this.isShowCoverTitle()){
+        if(!this.isShowCoverHeader()){
           Column(){
             Line().width('100%').height('100%')
           }
@@ -2000,15 +2000,25 @@ export struct LocalMusic {
 
             Column() {
 
-              if(this.isShowCoverTitle()){
-                // this.coverTitle()
-              }else{
+              if(!this.isShowCoverHeader()){
                 this.tabTitle()
                 this.listViewTitle()
               }
 
               if(this.isGridMusic){
-                this.getGridView()
+                if(this.isShowCoverHeader()){
+                  Scroll(){
+                    Column(){
+                      this.coverHeader()
+                      this.getGridView()
+                    }
+
+                  }
+                  // .height(px2vp(DisplayUtil.getHeight()-AppUtil.getStatusBarHeight()-AppUtil.getNavigationIndicatorHeight()))
+                }else{
+                  this.getGridView()
+                }
+
               }else {
                 this.getListView()
               }
@@ -2134,7 +2144,7 @@ export struct LocalMusic {
             duration: 666,
             curve: 'ease-in-out' // 可选动画曲线
           })
-          .position(this.isShowCoverTitle()?{ bottom:78}
+          .position(this.isShowCoverHeader()?{ bottom:78}
             :{ bottom:this.isPhoneLan()?130: 168 }) // 将 Row 固定在底部
 
 
@@ -2675,8 +2685,8 @@ export struct LocalMusic {
   @State currentTitleName:string = ''//点击歌单,艺术家,专辑进去后的标题
   @State currentTitleCover:string|ResourceStr = ''//点击歌单,艺术家,专辑进去后的封面
 
-  isShowCoverTitle(){
-    if(this.modeType==0&&!this.isGridMusic){
+  isShowCoverHeader(){
+    if(this.modeType==0){
       if(this.isHistory||this.isFavMusic){
         return true
       }
@@ -2684,12 +2694,12 @@ export struct LocalMusic {
         return true
       }
     }
-    return (this.modeType==2||this.modeType==3)&&this.isCanBack&&!this.isGridMusic
+    return (this.modeType==2||this.modeType==3)&&this.isCanBack
   }
 
   @Builder
-  coverTitle() {
-    if(this.isShowCoverTitle()){
+  coverHeader() {
+    if(this.isShowCoverHeader()){
       Column(){
 
         Stack() {
@@ -3255,7 +3265,6 @@ export struct LocalMusic {
         GridItem() {
           Stack({ alignContent: Alignment.Center }) {
             this.MusicItemGrid(item,index)
-
           }
         }
         // .transition(TransitionEffect.scale({ x: 0.8, y: 0.8 }).animation({ duration: 500 }))
@@ -3336,7 +3345,9 @@ export struct LocalMusic {
     .editMode(true)
     .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
       .animation({ duration: 500, curve: Curve.Ease }))
-    .margin({ bottom: this.isCoverOpacity() ? 80 : 175 })
+    // .margin({ bottom: this.isCoverOpacity() ? 80 : 175 })
+    .margin({ bottom: this.isCoverOpacity() ? (this.isShowCoverHeader()? 40:80)
+      :(this.isShowCoverHeader()? 90:175) })
     .layoutWeight(1)
     .scrollBar(BarState.Off)
     .supportAnimation(true)
@@ -3705,7 +3716,7 @@ export struct LocalMusic {
   getListView() {
 
     List({ scroller: this.listScroller }) {
-      ListItemGroup({ header: this.coverTitle() }) {
+      ListItemGroup({ header: this.coverHeader() }) {
       LazyForEach(this.dataSource, (item: VideoItem, index: number) => {
         ListItem() {
           Column() {
@@ -3872,8 +3883,8 @@ export struct LocalMusic {
 
       }))
     // .divider({ strokeWidth: 1, color: this.isDarkMode? '#333333':'#ffe9f0f0' })
-    .margin({ bottom: this.isCoverOpacity() ? (this.isShowCoverTitle()? 20:80)
-      :(this.isShowCoverTitle()? 70:166) })
+    .margin({ bottom: this.isCoverOpacity() ? (this.isShowCoverHeader()? 20:80)
+      :(this.isShowCoverHeader()? 70:166) })
     .cachedCount(6)
     .borderRadius(20)
     .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 1.2, y: 1.2 }).animation({ duration: 500 }),