|
|
@@ -20,10 +20,13 @@ export struct SettingPage {
|
|
|
@State isMediacodec: boolean = false //是否启用硬件解码
|
|
|
@State isMusicMemoryPlay: boolean = false //是否启用记忆播放
|
|
|
@State isMusicBGCover: boolean = true //播放背景随封面
|
|
|
+ @State sortType: number = 4 //默认排序方式
|
|
|
@State showCoverApiDialog: boolean = false
|
|
|
@State tempCoverApiUrl: string = ''
|
|
|
@State coverApiUrl: string = PreferencesUtil.getStringSync('COVER_API', 'https://lrc.ss5.xyz/cover')
|
|
|
@State apiDialogType: 'lyric' | 'cover' = 'lyric'
|
|
|
+
|
|
|
+ static readonly SORT_TYPE: string = 'musicSortType';
|
|
|
static readonly IS_BGPLAY_OPEN: string = 'isBgPlayOpen';
|
|
|
static readonly IS_AUTO_RATATE: string = 'isAutoRatate';
|
|
|
static readonly iS_MEMORY_PLAY: string = 'isMemoryPlay';
|
|
|
@@ -105,6 +108,7 @@ export struct SettingPage {
|
|
|
|
|
|
// 组件生命周期
|
|
|
aboutToAppear() {
|
|
|
+ this.sortType = PreferencesUtil.getNumberSync(SettingPage.SORT_TYPE, 4)
|
|
|
this.isBgPlayOpen = PreferencesUtil.getBooleanSync(SettingPage.IS_BGPLAY_OPEN, true)
|
|
|
this.isAutoRatate = PreferencesUtil.getBooleanSync(SettingPage.IS_AUTO_RATATE, true)
|
|
|
this.isMemoryPlay = PreferencesUtil.getBooleanSync(SettingPage.iS_MEMORY_PLAY, true)
|
|
|
@@ -161,6 +165,44 @@ export struct SettingPage {
|
|
|
.width('100%')
|
|
|
.height(55)
|
|
|
|
|
|
+ Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
+ Row() {
|
|
|
+ Image($r('app.media.kp_music_nor'))
|
|
|
+ .width(22)
|
|
|
+ .height(22)
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
+ .margin({ left: 28 })
|
|
|
+ Text('默认排序模式')
|
|
|
+ .margin({ left: 10, right: 20 })
|
|
|
+ .fontSize(15)
|
|
|
+ .fontColor(Color.Gray)
|
|
|
+ .fontWeight(480)
|
|
|
+ Blank()
|
|
|
+ Select([//默认排序模式
|
|
|
+ { value: CommonConstants.SORT_ARRAY[0] },
|
|
|
+ { value: CommonConstants.SORT_ARRAY[1] },
|
|
|
+ { value: CommonConstants.SORT_ARRAY[2] },
|
|
|
+ { value: CommonConstants.SORT_ARRAY[3] },
|
|
|
+ { value: CommonConstants.SORT_ARRAY[4] },
|
|
|
+ { value: CommonConstants.SORT_ARRAY[5] },
|
|
|
+ { value: CommonConstants.SORT_ARRAY[6] },
|
|
|
+ { value: CommonConstants.SORT_ARRAY[7] }])
|
|
|
+ .font({ size: 15, weight: FontWeight.Medium })
|
|
|
+ .fontColor(Color.Gray)
|
|
|
+ .margin({right:28})
|
|
|
+ .selected(this.sortType)
|
|
|
+ .value(CommonConstants.SORT_ARRAY[this.sortType])
|
|
|
+ .onSelect(async (_index: number, text?: string | undefined) => {
|
|
|
+ this.sortType = _index
|
|
|
+ PreferencesUtil.put(SettingPage.SORT_TYPE, this.sortType)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height(55)
|
|
|
+
|
|
|
+
|
|
|
Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
Row() {
|
|
|
Image($r('app.media.kp_music_nor'))
|
|
|
@@ -189,6 +231,7 @@ export struct SettingPage {
|
|
|
.width('100%')
|
|
|
.height(55)
|
|
|
|
|
|
+
|
|
|
Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
|
|
|
// API设置(合并标题)
|