浏览代码

永久会员不再显示套餐
修复英文歌词的时候,部分歌词没有显示出来

onecold 1 年之前
父节点
当前提交
342e81360d

+ 11 - 3
entry/src/main/ets/common/util/Utility.ets

@@ -47,6 +47,11 @@ export class Utility {
     return PreferencesUtil.getBooleanSync('hasActiveSubscription', false);
   }
 
+  static isForever(): boolean {
+    // 判断是不是永久会员
+    return PreferencesUtil.getBooleanSync('isForever', false);
+  }
+
   /**
    * 旧版客户端判断会员状态
    * @returns
@@ -64,8 +69,10 @@ export class Utility {
     let isNoble = false
     if(StrUtil.isNotEmpty(expireDate)){
       if(expireDate===VipPage.FOREVER_DATE){
+        PreferencesUtil.putSync('isForever',true)
         isNoble = true
       }else{
+        PreferencesUtil.putSync('isForever',false)
         const currentDate = new Date();
         const targetDate = DateUtil.getFormatDate(expireDate)
 
@@ -1237,11 +1244,11 @@ interface VideoNameParts {
 
 // 提取文件名中的非数字和数字部分
 function extractParts(name: string): VideoNameParts {
-  // 使用正则表达式来捕获非数字部分和数字部分
-  const match = name.match(/^(.+?)(\d+)(\.\w+)?$/);
+  // Adjust the regex to handle names that start with numbers
+  const match = name.match(/^(\D*?)(\d+)(\.\w+)?$/);
   if (match) {
     return {
-      nonNumeric: match[1],
+      nonNumeric: match[1] || '', // Ensure nonNumeric is not undefined
       numeric: parseInt(match[2], 10),
     };
   }
@@ -1250,6 +1257,7 @@ function extractParts(name: string): VideoNameParts {
     numeric: 0,
   };
 }
+
 function getInstallTime(): number | null {
   // 从本地存储中获取安装时间
   return PreferencesUtil.getNumberSync('installTime')

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

@@ -437,7 +437,9 @@ export struct UserCenter {
       Scroll() {
         Column() {
           this.buildUserInfoCard()
-          this.buildVipPlans()
+          if(!Utility.isNoble()||!Utility.isForever()){
+            this.buildVipPlans()
+          }
           this.buildVipFeatures()
 
           // this.buildFunctionMenu()

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

@@ -5509,7 +5509,7 @@ export struct LocalMusic {
     // LogUtil.info('twocold this.currentWidthBreakpoint = '+this.currentWidthBreakpoint)
     if(DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       &&this.currentHeightBreakpoint == HeightBreakpoint.HEIGHT_SM
-      &&this.currentWidthBreakpoint==WidthBreakpoint.WIDTH_MD){//如果是手机横屏,返回false
+      &&this.currentWidthBreakpoint==WidthBreakpoint.WIDTH_MD){//如果是手机横屏,返回true
 
       return true
     }
@@ -5741,7 +5741,7 @@ export struct LocalMusic {
   private positionX: number = PlayConstants.POSITION_X;
   private positionY: number = PlayConstants.POSITION_Y;
   private windowClass: window.Window = globalThis.windowClass
-  @State volume: number = 0.8;
+  @State volume: number = 1;
   @State volumeShow: boolean = PlayConstants.VOLUME_SHOW;
   @State bright: number = PlayConstants.BRIGHT;
   @State brightShow: boolean = PlayConstants.BRIGHT_SHOW;

+ 17 - 11
lib/src/main/ets/parse/LyricParser.ts

@@ -45,17 +45,23 @@ export class LyricParser implements IParser {
                 printW(`the lyric line contains ignored tag, line index= ${i}`);
                 continue;
             }
-            if (line.indexOf("ti") > 0) {
-                title = this.parseIdTag(line)
-            } else if (line.indexOf("ar") > 0) {
-                artist = this.parseIdTag(line)
-            } else if (line.indexOf("al") > 0) {
-                album = this.parseIdTag(line)
-            } else if (line.indexOf("by") > 0) {
-                by = this.parseIdTag(line)
-            } else if (line.indexOf("offset") > 0) {
-                offset = Number.parseInt(this.parseIdTag(line))
-            } else {
+            // 修改后的标签检测逻辑,修复英文歌词的时候,部分歌词没有显示出来。
+            if (line.startsWith("[ti:"))  {
+                title = this.parseIdTag(line);
+            }
+            else if (line.startsWith("[ar:"))  {
+                artist = this.parseIdTag(line);
+            }
+            else if (line.startsWith("[al:"))  {
+                album = this.parseIdTag(line);
+            }
+            else if (line.startsWith("[by:"))  {
+                by = this.parseIdTag(line);
+            }
+            else if (line.startsWith("[offset:"))  {
+                offset = Number.parseInt(this.parseIdTag(line));
+            }
+            else {
 
                 // 新增逐字歌词解析逻辑[mm:ss.xx] <mm:ss.xx>
                 if (this.isWordByWordLyric(line)) {