Parcourir la source

名称的排序问题

onecold il y a 11 mois
Parent
commit
aa8c0113cf

+ 10 - 5
entry/src/main/ets/common/util/Utility.ets

@@ -1465,21 +1465,26 @@ async function isDirectory(filePath: string): Promise<boolean> {
 interface VideoNameParts {
   nonNumeric: string;
   numeric: number;
+  suffix:string;
 }
 
-// 提取文件名中的非数字和数字部分
 function extractParts(name: string): VideoNameParts {
-  // Adjust the regex to handle names that start with numbers
-  const match = name.match(/^(\D*?)(\d+)(\.\w+)?$/);
+  // 更完善的正则表达式,处理各种情况
+  // 匹配:非数字前缀 + 数字部分 + 可选的剩余部分
+  const match = name.match(/^(\D*)(\d+)(.*)$/);
   if (match) {
     return {
-      nonNumeric: match[1] || '', // Ensure nonNumeric is not undefined
-      numeric: parseInt(match[2], 10),
+      nonNumeric: match[1] || '', // 非数字前缀
+      numeric: parseInt(match[2], 10), // 数字部分
+      suffix: match[3] || '' // 剩余部分(可能包含扩展名等)
     };
   }
+
+  // 如果没有找到数字模式,将整个名称作为非数字部分
   return {
     nonNumeric: name,
     numeric: 0,
+    suffix: ''
   };
 }
 

+ 11 - 0
entry/src/main/ets/pages/AboutPage.ets

@@ -191,6 +191,17 @@ export struct AboutPage{
               });
             })
 
+          Button('音频标签', { type: ButtonType.Capsule, stateEffect: false })
+            .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'25%':'60%')
+            .height(55)
+            .margin({top:10,bottom:10})
+            .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.7})
+            .stateEffect(true)
+            .backgroundColor(this.themeColor)
+            .onClick(()=>{
+              Utility.gotoMarket(getContext(this) as common.UIAbilityContext, 'com.xgplayer.ttmusic.tags')
+            })
+
           Button('粉丝QQ群', { type: ButtonType.Capsule, stateEffect: false })
             .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'25%':'60%')
             .height(55)

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

@@ -738,8 +738,7 @@ struct NewIndex {
     })
     .alignListItem(ListItemAlign.Center)
     .layoutWeight(1)
-    // .backgroundColor($r('app.color.silvery'))
-    .backgroundColor($r('app.color.index_background'))
+    .backgroundColor($r('app.color.left_draw_bg'))
 
     .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
   }

+ 1 - 1
entry/src/main/ets/view/LocalMusic.ets

@@ -9469,7 +9469,7 @@ export struct LocalMusic {
 
     { id: 14, image: $r('app.media.cover_online'), title: '获取封面' },
 
-    // { id: 15, image: $r('app.media.rename2'), title: '编辑标签' },
+    { id: 15, image: $r('app.media.rename2'), title: '编辑标签' },
 
     { id: 5, image: $r('app.media.time_close'), title: '定时关闭' },
 

+ 4 - 0
entry/src/main/resources/base/element/color.json

@@ -175,6 +175,10 @@
     {
       "name": "user_center_card_background",
       "value": "#FFFFFF"
+    },
+    {
+      "name": "left_draw_bg",
+      "value": "#FEFEFE"
     }
   ]
 }

+ 4 - 0
entry/src/main/resources/dark/element/color.json

@@ -192,6 +192,10 @@
     {
       "name": "user_center_button_background",
       "value": "#1E1E1E"
+    },
+    {
+      "name": "left_draw_bg",
+      "value": "#000000"
     }
   ]
 }