chendeben 1 рік тому
батько
коміт
23c6adc3b6

+ 4 - 1
.gitignore

@@ -9,4 +9,7 @@ package-lock.json
 .clangd
 @ohos
 .vscode
-.vs
+.vs
+build-profile.json5
+oh_modules
+oh-package-lock.json5

+ 24 - 4
entry/src/main/ets/pages/NewIndex.ets

@@ -3,6 +3,7 @@ import TitleBar from '../view/TitleBar';
 import { router } from '@kit.ArkUI';
 import mainViewModel, { MainViewModel } from '../viewmodel/MainViewModel';
 import ItemData from '../viewmodel/ItemData';
+import type { sysResource } from '../viewmodel/ItemData';
 import { CommonConstants } from '../common/constants/CommonConstants';
 import { VideoItem } from '../viewmodel/VideoItem';
 import ScreenUtil from '../common/util/ScreenUtil';
@@ -27,6 +28,8 @@ import { deviceInfo } from '@kit.BasicServicesKit';
 import { resourceManager } from '@kit.LocalizationKit';
 import { systemShare } from '@kit.ShareKit';
 import { uniformTypeDescriptor } from '@kit.ArkData';
+import { IBestIcon } from "@ibestservices/ibest-ui";
+
 
 const TAG = 'NewIndex'; // 日志标签
 
@@ -289,10 +292,27 @@ async aboutToAppear() {
         ListItem(){
           Row() {
             // 菜单图标
-            Image(item.img)
-              .height(22)
-              .alignSelf(ItemAlign.Center)
-              .margin({ left: 2 })
+            if (typeof item.img === 'object' && item.img !== null && (item.img as sysResource).type === 'symbol') {
+              SymbolGlyph((item.img as sysResource).value as Resource)
+                .size({ width: 22, height: 22 })
+                .fontColor([$r("app.color.img_color")])
+                .alignSelf(ItemAlign.Center)
+                .margin({ left: 2 })
+            }else if (typeof item.img === 'object' && item.img !== null && (item.img as sysResource).type === 'ibest') {
+              IBestIcon({
+                name: (item.img as sysResource).value as string,
+                iconSize:22,
+                color: $r("app.color.img_color"),
+              }).margin({ left: 2 })
+                .alignSelf(ItemAlign.Center)
+            }else {
+              Image(item.img as Resource)
+                .height(22)
+                .alignSelf(ItemAlign.Center)
+                .fillColor($r('app.color.img_color'))
+                .margin({ left: 2 })
+            }
+
             // 菜单标题
             Text(item.title)
               .margin({ left: 10, right: 20 })

+ 0 - 19
entry/src/main/ets/pages/SettingPage.ets

@@ -220,25 +220,6 @@ export struct SettingPage {
             }
             .height(48)
             Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
-            // 深色模式
-            // Row() {
-            //   Text('深色模式')
-            //     .margin({ left: 18 })
-            //     .fontSize(15)
-            //     .fontColor(Color.Gray)
-            //     .fontWeight(480)
-            //     .layoutWeight(1)
-            //   Toggle({ type: ToggleType.Switch, isOn: this.isDarkMode })
-            //     .selectedColor($r('app.color.tab_item_bg'))
-            //     .switchPointColor(Color.White)
-            //     .margin({ right: 18 })
-            //     .onChange((checked: boolean) => {
-            //       this.toggleDarkMode(checked);
-            //     })
-            //     .width(50)
-            //     .height(30);
-            // }
-            // .height(55)
             Row() {
               Text('主题模式')
                 .margin({ left: 18 })

+ 7 - 2
entry/src/main/ets/viewmodel/ItemData.ets

@@ -1,14 +1,19 @@
 /**
  * List item data entity.
  */
+export interface sysResource {
+  type: string;
+  value: Resource|string;
+}
+
 export default  class  ItemData{
   title:Resource;
-  img: Resource;
+  img: Resource | sysResource;
   id:number;
   isHide:boolean;
   others?: Resource;
 
-  constructor(title:Resource,img:Resource,id:number,isHide:boolean,others?:Resource) {
+  constructor(title:Resource,img:Resource | sysResource,id:number,isHide:boolean,others?:Resource) {
 
     this.title = title;
     this.img = img;

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

@@ -4,6 +4,10 @@
       "name": "text_color",
       "value": "#000000"
     },
+    {
+      "name": "img_color",
+      "value": "#FF4081"
+    },
     {
       "name": "start_window_background",
       "value": "#FFFFFF"

BIN
entry/src/main/resources/base/media/foreground.png


BIN
entry/src/main/resources/base/media/grid.png


+ 1 - 0
entry/src/main/resources/base/media/grid.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1749662513273" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6259" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M420.949333 468.053333H89.770667A46.250667 46.250667 0 0 1 42.666667 420.949333V89.770667C42.666667 63.061333 63.061333 42.666667 89.770667 42.666667h331.178666c26.709333 0 47.104 20.394667 47.104 47.104v331.178666c0 26.709333-20.394667 47.104-47.104 47.104zM136.832 373.888h237.056V136.832H136.832v237.056zM420.949333 981.333333H89.770667A46.250667 46.250667 0 0 1 42.666667 934.229333v-331.178666c0-26.709333 20.394667-47.104 47.104-47.104h331.178666c26.709333 0 47.104 20.394667 47.104 47.104v331.178666c0 26.709333-20.394667 47.104-47.104 47.104z m-284.117333-94.165333h237.056v-237.056H136.832v237.056zM934.229333 468.053333h-331.178666a46.250667 46.250667 0 0 1-47.104-47.104V89.770667c0-26.709333 20.394667-47.104 47.104-47.104h331.178666C960.938667 42.666667 981.333333 63.061333 981.333333 89.770667v331.178666c0 26.709333-20.394667 47.104-47.104 47.104z m-284.117333-94.165333h237.056V136.832h-237.056v237.056zM934.229333 981.333333h-331.178666a46.250667 46.250667 0 0 1-47.104-47.104v-331.178666c0-26.709333 20.394667-47.104 47.104-47.104h331.178666c26.709333 0 47.104 20.394667 47.104 47.104v331.178666c0 26.709333-20.394667 47.104-47.104 47.104z m-284.117333-94.165333h237.056v-237.056h-237.056v237.056z" fill="#172B4D" p-id="6260"></path></svg>

BIN
entry/src/main/resources/base/media/hm_play.png


+ 1 - 0
entry/src/main/resources/base/media/hm_play.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1749661035231" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M908.714667 669.013333Q938.666667 593.408 938.666667 512q0-81.365333-29.952-157.013333-32.512-82.218667-95.018667-144.682667-62.464-62.506667-144.64-95.018667Q593.365333 85.333333 512 85.333333t-157.013333 29.952q-82.218667 32.512-144.682667 95.018667-62.506667 62.464-95.018667 144.64Q85.333333 430.634667 85.333333 512t29.952 157.013333q32.512 82.218667 95.018667 144.682667 62.464 62.464 144.64 95.018667Q430.634667 938.666667 512 938.666667t157.013333-29.952q82.218667-32.512 144.682667-95.018667 62.464-62.464 95.018667-144.64z m-79.36-282.666666Q853.333333 446.933333 853.333333 512q0 65.109333-23.978666 125.653333-26.026667 65.706667-75.989334 115.712-50.005333 49.962667-115.712 75.989334Q577.066667 853.333333 512 853.333333q-65.109333 0-125.653333-23.978666-65.706667-26.026667-115.712-75.989334-49.962667-50.005333-75.989334-115.712Q170.666667 577.066667 170.666667 512q0-65.109333 23.978666-125.653333 26.026667-65.706667 75.989334-115.712 50.005333-49.962667 115.712-75.989334Q446.933333 170.666667 512 170.666667q65.109333 0 125.653333 23.978666 65.706667 26.026667 115.712 75.989334 49.962667 50.005333 75.989334 115.712z m-335.061334 252.629333l128-92.373333a42.624 42.624 0 0 0 0-69.205334l-128-92.373333A42.666667 42.666667 0 0 0 426.666667 419.626667v184.746666a42.666667 42.666667 0 0 0 67.626666 34.602667z" fill="#4E5969" p-id="1481"></path></svg>

BIN
entry/src/main/resources/base/media/hm_playlist.png


+ 1 - 0
entry/src/main/resources/base/media/hm_playlist.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1749661497912" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1485" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M42.666667 106.666667a21.333333 21.333333 0 0 1 21.333333-21.333334h896a21.333333 21.333333 0 0 1 0 42.666667H64a21.333333 21.333333 0 0 1-21.333333-21.333333z m21.333333 405.333333h597.333333a21.333333 21.333333 0 0 0 0-42.666667H64a21.333333 21.333333 0 0 0 0 42.666667z m384 341.333333H64a21.333333 21.333333 0 0 0 0 42.666667h384a21.333333 21.333333 0 0 0 0-42.666667z m532.853333-324.513333c-4.5-20.773333-14.666667-50.513333-37.466666-74.266667-11.04-11.493333-23.64-20.093333-37.493334-25.606666-10.306667-7.126667-19.44-16.58-27.153333-28.133334-19.64-29.393333-24.373333-64.04-25.446667-82.08A21.333333 21.333333 0 0 0 810.666667 320v479.586667c-1.413333-1.02-2.846667-2-4.326667-3.006667-27.64-18.433333-64-28.58-102.34-28.58s-74.666667 10.146667-102.34 28.58c-14.253333 9.5-25.56 20.746667-33.613333 33.44-8.88 14-13.38 29.013333-13.38 44.666667s4.5 30.666667 13.38 44.666666c8.053333 12.666667 19.333333 23.94 33.613333 33.44C629.333333 971.186667 665.646667 981.333333 704 981.333333s74.666667-10.146667 102.34-28.58c14.253333-9.5 25.56-20.746667 33.613333-33.44 8.88-14 13.38-29.013333 13.38-44.666666V438a140.893333 140.893333 0 0 0 30.966667 27.82A21.18 21.18 0 0 0 888.666667 468c8.713333 3.2 16.773333 8.606667 23.953333 16.086667 16.733333 17.42 23.806667 41.146667 26.533333 53.733333a21.333333 21.333333 0 1 0 41.706667-9.026667z" fill="#5C5C66" p-id="1486"></path></svg>

BIN
entry/src/main/resources/base/media/list.png


+ 1 - 0
entry/src/main/resources/base/media/list.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1749662073454" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1685" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M416 192h448a32 32 0 0 0 0-64h-448a32 32 0 0 0 0 64zM864 448h-448a32 32 0 0 0 0 64h448a32 32 0 0 0 0-64zM864 768h-448a32 32 0 0 0 0 64h448a32 32 0 0 0 0-64z" fill="#231815" p-id="1686"></path><path d="M224 160m-96 0a96 96 0 1 0 192 0 96 96 0 1 0-192 0Z" fill="#231815" p-id="1687"></path><path d="M224 480m-96 0a96 96 0 1 0 192 0 96 96 0 1 0-192 0Z" fill="#231815" p-id="1688"></path><path d="M224 800m-96 0a96 96 0 1 0 192 0 96 96 0 1 0-192 0Z" fill="#231815" p-id="1689"></path></svg>

BIN
entry/src/main/resources/base/media/search.png


+ 1 - 0
entry/src/main/resources/base/media/search.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1749661666224" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1466" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 32c229.75 0 416 186.25 416 416 0 111.504-43.87 212.762-115.29 287.455l190.937 190.937-45.255 45.255-193.396-193.395C694.896 832.034 607.181 864 512 864 282.25 864 96 677.75 96 448S282.25 32 512 32z m0 64c-194.404 0-352 157.596-352 352s157.596 352 352 352 352-157.596 352-352S706.404 96 512 96z" fill="#000000" p-id="1467"></path></svg>

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

@@ -4,6 +4,11 @@
       "name": "text_color",
       "value": "#FFFFFF"
     },
+
+    {
+      "name": "img_color",
+      "value": "#FF5A5959"
+    },
     {
       "name": "start_window_background",
       "value": "#121212"

+ 2 - 1
oh-package.json5

@@ -28,7 +28,8 @@
     "@ohos/imageknife": "^3.2.3",
     "@simplepeng/spider-man": "^1.0.1",
     "@keke/color-picker": "^1.0.4",
-    "@sgaolei/lrc_parser": "^1.0.0"
+    "@sgaolei/lrc_parser": "^1.0.0",
+    "@ibestservices/ibest-ui": "^2.1.2"
   },
   "dynamicDependencies": {}
 }