Explorar o código

修复网格模式和瀑布流模式没有加载下一页功能
编辑网盘账号不能提示网盘限制数量的

onecold hai 7 meses
pai
achega
bc058e42da

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

@@ -2006,7 +2006,7 @@ struct NewIndex {
          this.getUIContext().getPromptAction().closeCustomDialog(this.addDavDialogId)
          this.getUIContext().getPromptAction().closeCustomDialog(this.addDavDialogId)
        },
        },
        onConfirm: (account: WebDavAccount) => {
        onConfirm: (account: WebDavAccount) => {
-         if(this.webDavAccounts.length>=1&&!Utility.isNoble()){
+         if(this.webDavAccounts.length>=1&&!Utility.isNoble()&&!isEditMode){
            ToastUtil.showToast('普通用户只能添加一个网盘账户,请开通会员')
            ToastUtil.showToast('普通用户只能添加一个网盘账户,请开通会员')
            return
            return
          }
          }

+ 25 - 4
entry/src/main/ets/view/LocalMusic.ets

@@ -546,6 +546,7 @@ export struct LocalMusic {
       case 0:
       case 0:
         // 首页模式已在 resetAndLoadFirstPage 中处理
         // 首页模式已在 resetAndLoadFirstPage 中处理
         // 切换模式时加载对应的排序类型
         // 切换模式时加载对应的排序类型
+        this.titleName = Utility.resourceToString(this.context,$r('app.string.home'))
         this.sortType = this.loadSortTypeForCurrentMode()
         this.sortType = this.loadSortTypeForCurrentMode()
         break
         break
       case 1:
       case 1:
@@ -5207,6 +5208,16 @@ export struct LocalMusic {
           centerX: 0,
           centerX: 0,
           centerY: 0
           centerY: 0
         })
         })
+        .onReachEnd(() => {
+          // 触底加载下一页
+          Logger.info('heanup LocalMusic', `onReachEnd: hasMore=${this.hasMoreData}, isLoading=${this.isLoadingPage}`);
+          if (this.isCanBack && (this.modeType === 2 || this.modeType === 3)) {
+            return;
+          }
+          if (this.hasMoreData && !this.isLoadingPage) {
+            this.loadNextPage();
+          }
+        })
         .onAppear(() => {
         .onAppear(() => {
           this.scroller.scrollEdge(Edge.Top)
           this.scroller.scrollEdge(Edge.Top)
         })
         })
@@ -5613,6 +5624,16 @@ export struct LocalMusic {
     .layoutWeight(1)
     .layoutWeight(1)
     .scrollBar(BarState.Off)
     .scrollBar(BarState.Off)
     .supportAnimation(true)
     .supportAnimation(true)
+    .onReachEnd(() => {
+      // 触底加载下一页
+      Logger.info('heanup LocalMusic', `onReachEnd: hasMore=${this.hasMoreData}, isLoading=${this.isLoadingPage}`);
+      if (this.isCanBack && (this.modeType === 2 || this.modeType === 3)) {
+        return;
+      }
+      if (this.hasMoreData && !this.isLoadingPage) {
+        this.loadNextPage();
+      }
+    })
     .cachedCount(this.twoFingerType==1?5:this.twoFingerType==2?4:3)
     .cachedCount(this.twoFingerType==1?5:this.twoFingerType==2?4:3)
     .columnsTemplate(
     .columnsTemplate(
       this.twoFingerType == 3 ? 'repeat(auto-fit, 160)' :
       this.twoFingerType == 3 ? 'repeat(auto-fit, 160)' :
@@ -10649,8 +10670,8 @@ export struct LocalMusic {
           .layoutWeight(1)
           .layoutWeight(1)
           .enabled(this.slideEnable)
           .enabled(this.slideEnable)
           .onChange((value: number, mode: SliderChangeMode) => {
           .onChange((value: number, mode: SliderChangeMode) => {
-           if(this.isSeekTo)
-             return
+            if(this.isSeekTo)
+              return
             this.isSeekTo = true;
             this.isSeekTo = true;
             this.mDestroyPage = false;
             this.mDestroyPage = false;
             // 只有播放网盘歌曲时才显示转圈圈
             // 只有播放网盘歌曲时才显示转圈圈
@@ -14581,8 +14602,8 @@ export struct LocalMusic {
     }
     }
     // 检查常见的流媒体协议
     // 检查常见的流媒体协议
     if (str.startsWith('http://') || str.startsWith('https://') ||
     if (str.startsWith('http://') || str.startsWith('https://') ||
-        str.startsWith('rtmp://') || str.startsWith('rtsp://') ||
-        str.startsWith('rtp://') || str.startsWith('mms://')) {
+    str.startsWith('rtmp://') || str.startsWith('rtsp://') ||
+    str.startsWith('rtp://') || str.startsWith('mms://')) {
       return true;
       return true;
     }
     }