Quellcode durchsuchen

播放在线音乐的时候要转圈圈,百度网盘上传音乐的时候要提示目录限制

onecold vor 7 Monaten
Ursprung
Commit
0698ad20e3

+ 1 - 1
entry/src/main/ets/dialog/AddSongsToPlaylistDialog.ets

@@ -822,7 +822,7 @@ struct AddSongsToPlaylistDialogContent {
         .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true })
         .onReachEnd(() => {
           // 滚动到底部时加载更多数据
-          console.info('List  onReachEnd triggered')
+          console.info('onecold List  onReachEnd triggered')
           this.loadMoreData()
         })
       }

+ 26 - 0
entry/src/main/ets/pages/UploadMusicPage.ets

@@ -1566,6 +1566,32 @@ export struct UploadMusicPage {
             })
         }
         .width('100%')
+
+        // 百度网盘提示信息
+        if (this.selectedAccount && this.selectedAccount.webType === 4) {
+          Row({ space: 8 }) {
+            SymbolGlyph($r('sys.symbol.info_circle'))
+              .fontSize(16)
+              .fontColor([$r('app.color.text_color')])
+
+            Row({ space: 1 }) {
+              Text('提示:')
+                .fontSize(13)
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.text_color'))
+                .opacity(0.6)
+
+              Text('百度网盘上传目录是: apps/天天静听/目录下')
+                .fontSize(12)
+                .fontColor($r('app.color.text_color'))
+                .opacity(0.6)
+            }
+            .alignItems(VerticalAlign.Center)
+            .layoutWeight(1)
+          }
+          .width('100%')
+          .borderRadius(6)
+        }
       }
       .width('100%')
       .padding(14)

+ 52 - 11
entry/src/main/ets/view/LocalMusic.ets

@@ -874,6 +874,7 @@ export struct LocalMusic {
   @Consume @Watch('onIDChange') currentSongListID:string //当前歌单ID
   @State isRefreshing: boolean = false;
   @State maxRefreshingHeight: number = 100.0;
+  @State isPlayerLoading: boolean = false; // 播放器加载状态
   private contentNode?: ComponentContent<Object> = undefined;
 
   // WebDAV相关实例变量(现在改为从内存读取,不再需要存储)
@@ -4108,6 +4109,11 @@ export struct LocalMusic {
       Column() {
         Column() {
           Row() {
+            SymbolGlyph($r('sys.symbol.info_circle'))
+              .fontSize(20)
+              .fontColor([this.themeColor])
+              .alignSelf(ItemAlign.Center)
+              .margin({ left: 8 })
             Text('导入音乐复制到DownLoad目录')
               .margin({ left: 18 })
               .fontSize(14)
@@ -4195,8 +4201,22 @@ export struct LocalMusic {
           MenuItem({
             symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.save')),
             content: '自动导入教程'
-            // content: '从下载文件夹导入(路径:Download/' +
-            // PathUtils.appContext!.resourceManager.getStringSync($r('app.string.EntryAbility_label').id) + ')'
+          })
+            .padding({left:15,right:15})
+            .backgroundColor($r('app.color.silvery'))
+            .border({
+              width: { bottom: 1 },
+              color: '#12ec5c87'
+            })
+            .margin(10)
+            .onClick(async () => {
+              this.showTips()
+              this.showAddSheet = !this.showAddSheet
+            })
+
+          MenuItem({
+            symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.questionmark_circle')),
+            content: '导入疑问'
           })
             .padding({left:15,right:15})
             .backgroundColor($r('app.color.silvery'))
@@ -4211,6 +4231,7 @@ export struct LocalMusic {
             })
         }.attributeModifier(new MenuModifier())
         .margin({bottom:30})
+        .width('100%')
       }
       .layoutWeight(1)
 
@@ -10484,16 +10505,28 @@ export struct LocalMusic {
       .backgroundColor(Color.Transparent)
 
       Button({type:ButtonType.Circle,stateEffect:true}){
-        Column() {
-          Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
-            (this.isCircleBtn?$r('app.media.hm_pause'):$r('app.media.ic_public_play'))
-            : (this.isCircleBtn?$r('app.media.hm_play2'):$r('app.media.ic_public_pause')))
-            .width(this.isPhoneLan()?45:55)
-            .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
-            .fillColor(Color.White)
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
-        }
+        Stack() {
+          Column() {
+            Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
+              (this.isCircleBtn?$r('app.media.hm_pause'):$r('app.media.ic_public_play'))
+              : (this.isCircleBtn?$r('app.media.hm_play2'):$r('app.media.ic_public_pause')))
+              .width(this.isPhoneLan()?45:55)
+              .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
+              .fillColor(Color.White)
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+          }
 
+          // 加载进度圈
+          if (this.isPlayerLoading) {
+            Progress({value:0,total:100,type:ProgressType.Ring })
+              .width(this.isPhoneLan()?48:57)
+              .height(this.isPhoneLan()?48:57)
+              .color(Color.White)
+              .style({ strokeWidth: 5, status: ProgressStatus.LOADING })
+          }
+        }
+        .width(this.isPhoneLan()?45:55)
+        .height(this.isPhoneLan()?45:55)
       }
       .onClick(async () => {
         this.playOrPause()
@@ -13256,6 +13289,10 @@ export struct LocalMusic {
     if (this.CONTROL_PlayStatus == PlayStatus.INIT) {
       this.stopProgressTask();
       this.startProgressTask();
+      // 判断是否是HTTP或在线网盘视频,显示加载进度
+      if (this.currentSong && isRemoteCloudType(this.currentSong.type)) {
+        this.isPlayerLoading = true;
+      }
       this.play(this.videoUrl.toString(),startOffset);
     }
     if (this.CONTROL_PlayStatus == PlayStatus.PAUSE) {
@@ -13630,6 +13667,8 @@ export struct LocalMusic {
     let mOnPreparedListener: OnPreparedListener = {
       onPrepared: async () => {
         LogUtils.getInstance().LOGI("setOnPreparedListener-->go");
+        // 隐藏加载进度
+        this.isPlayerLoading = false;
         try {
           //保存碰一碰分享的当前的歌曲
           AppStorage.setOrCreate('currentSong',this.currentSong) ;
@@ -13938,6 +13977,8 @@ export struct LocalMusic {
 
     let mOnErrorListener: OnErrorListener = {
       onError: (what: number, extra: number) => {
+        // 隐藏加载进度
+        this.isPlayerLoading = false;
         this.stopProgressTask();
         console.info("heanup OnErrorListener-->go:" + what + "===" + extra + " this.videoUrl=" + this.videoUrl)
         console.info('heanup 播放错误,歌曲详情:' + JSON.stringify(this.currentSong))