|
|
@@ -19,6 +19,7 @@ import {
|
|
|
IBestRadio,
|
|
|
IBestRadioGroup
|
|
|
} from '@ibestservices/ibest-ui'
|
|
|
+import { Utility } from '../common/util/Utility'
|
|
|
|
|
|
@Preview
|
|
|
@Entry
|
|
|
@@ -73,6 +74,9 @@ export struct SettingPage {
|
|
|
@State isMusicMemoryPlay: boolean = false //是否启用记忆播放
|
|
|
@State isMusicBGCover: boolean = true //播放背景随封面
|
|
|
@State sortType: number = 4 //默认排序方式
|
|
|
+ @State isStartAutoPlay: boolean = false //启动后自动播放
|
|
|
+ @State isMemoryLastPlay: boolean = false //是否启用应用退出记忆最后一首的播放进度
|
|
|
+
|
|
|
@State isShowSimi: boolean = false //是否显示私密音频
|
|
|
@State isShowFAV: boolean = true //是否显示我的收藏
|
|
|
@State isShowHistory: boolean = true //是否显示最近播放
|
|
|
@@ -94,6 +98,29 @@ export struct SettingPage {
|
|
|
@StorageProp('currentColorMode') @Watch('onColorModeChange') currentMode: number =
|
|
|
ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT;
|
|
|
@StorageLink('isDarkMode') isDarkMode: boolean = false // 是否启用深色模式
|
|
|
+ static readonly IS_BGPLAY_OPEN: string = 'isBgPlayOpen';
|
|
|
+ static readonly IS_AUTO_RATATE: string = 'isAutoRatate';
|
|
|
+ static readonly iS_MEMORY_PLAY: string = 'isMemoryPlay';
|
|
|
+ static readonly IS_MIDIACODEC_OPEN: string = 'isMediacodec';
|
|
|
+ static readonly iS_MUSIC_MEMORY_PLAY: string = 'isMusicMemoryPlay';
|
|
|
+ static readonly iS_MUSIC_BG_COVER: string = 'isMusicBGCover';
|
|
|
+ static readonly iS_SAVE_PLAY_MODE: string = 'isSavePlayMode';
|
|
|
+ static readonly IS_COVER_RECTANGLE: string = 'isCoverRectangle'; //封面圆形或者方形
|
|
|
+
|
|
|
+ static readonly IS_SHOW_SIMI: string = 'isShowSimi';
|
|
|
+ static readonly IS_SHOW_FAV: string = 'isShowFAV';
|
|
|
+ static readonly IS_SHOW_HISTORY: string = 'isShowHistory';
|
|
|
+ static readonly IS_CUSTOMIZE_BG: string = 'is_customize_bg';
|
|
|
+ static readonly IS_GRID_MUSIC: string = 'is_grid_music';
|
|
|
+ static readonly IS_CUSTOMIZE_BG_PATH: string = 'is_customize_bg_path';
|
|
|
+ static readonly IS_SCROLL_HIDE: string = 'isScrollHide';
|
|
|
+ static readonly IS_SAMETIME_PLAY: string = 'isSameTimePlay';
|
|
|
+ static readonly CUSTOMIZE_BG_BLUR: string = 'customize_bg_blur';
|
|
|
+ static readonly BG_BRIGHTNESS: string = 'bg_brightness';
|
|
|
+
|
|
|
+ static readonly iS_START_AUTO_PLAY: string = 'isStartAutoPlay';
|
|
|
+ static readonly iS_MEMORY_LAST_PLAY: string = 'isMemoryLastPlay';
|
|
|
+
|
|
|
/** 当前断点类型(如大屏/小屏) */
|
|
|
@StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointTypeEnum.MD;
|
|
|
@State verName: string = ''
|
|
|
@@ -183,6 +210,8 @@ export struct SettingPage {
|
|
|
this.isSavePlayMode = PreferencesUtil.getBooleanSync(SettingPage.iS_SAVE_PLAY_MODE, true)
|
|
|
this.blurValue = PreferencesUtil.getNumberSync(SettingPage.CUSTOMIZE_BG_BLUR, 0)
|
|
|
this.bgBrightness = PreferencesUtil.getNumberSync(SettingPage.BG_BRIGHTNESS, 0)
|
|
|
+ this.isStartAutoPlay = PreferencesUtil.getBooleanSync(SettingPage.iS_START_AUTO_PLAY, false)
|
|
|
+ this.isMemoryLastPlay = PreferencesUtil.getBooleanSync(SettingPage.iS_MEMORY_LAST_PLAY, false)
|
|
|
// 只用 themeMode 控制主题
|
|
|
this.themeMode = PreferencesUtil.getNumberSync(SettingPage.THEME_MODE, 0)
|
|
|
this.applyThemeMode(this.themeMode)
|
|
|
@@ -508,14 +537,15 @@ export struct SettingPage {
|
|
|
})
|
|
|
|
|
|
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)
|
|
|
- .bindSheet($$this.isCustomizeBgSheet, this.customizeBgSheet(), {
|
|
|
+ Button({ type: ButtonType.Normal, stateEffect: true }) {
|
|
|
+ Row() {
|
|
|
+ Text('自定义背景')
|
|
|
+ .margin({ left: 18 })
|
|
|
+ .fontSize(15)
|
|
|
+ .fontColor(Color.Gray)
|
|
|
+ .fontWeight(480)
|
|
|
+ .layoutWeight(1)
|
|
|
+ .bindSheet($$this.isCustomizeBgSheet, this.customizeBgSheet(), {
|
|
|
height: '95%',
|
|
|
dragBar: true,
|
|
|
preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
|
|
|
@@ -525,19 +555,20 @@ export struct SettingPage {
|
|
|
title: { title: '自定义背景' }
|
|
|
})
|
|
|
|
|
|
- Blank()
|
|
|
- // 右侧箭头
|
|
|
- Image($r('app.media.arrow_right'))
|
|
|
- .width(22)
|
|
|
- .height(22)
|
|
|
- .margin({ left: 20, right: 20 })
|
|
|
- .align(Alignment.Center)
|
|
|
+ Blank()
|
|
|
+ // 右侧箭头
|
|
|
+ Image($r('app.media.arrow_right'))
|
|
|
+ .width(22)
|
|
|
+ .height(22)
|
|
|
+ .margin({ left: 20, right: 20 })
|
|
|
+ .align(Alignment.Center)
|
|
|
+ }
|
|
|
}
|
|
|
.height(55)
|
|
|
.onClick(() => {
|
|
|
this.isCustomizeBgSheet = !this.isCustomizeBgSheet;
|
|
|
})
|
|
|
-
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
|
|
|
// 滚动隐藏'
|
|
|
@@ -677,6 +708,49 @@ 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.isStartAutoPlay })
|
|
|
+ .selectedColor($r('app.color.tab_item_bg'))
|
|
|
+ .switchPointColor(Color.White)
|
|
|
+ .margin({ right: 18 })
|
|
|
+ .onChange((checked: boolean) => {
|
|
|
+ this.isStartAutoPlay = checked;
|
|
|
+ PreferencesUtil.put(SettingPage.iS_START_AUTO_PLAY, this.isStartAutoPlay)
|
|
|
+ })
|
|
|
+ .width(50)
|
|
|
+ .height(30);
|
|
|
+ }
|
|
|
+ .height(55)
|
|
|
+ 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.isMemoryLastPlay })
|
|
|
+ .selectedColor($r('app.color.tab_item_bg'))
|
|
|
+ .switchPointColor(Color.White)
|
|
|
+ .margin({ right: 18 })
|
|
|
+ .onChange((checked: boolean) => {
|
|
|
+ this.isMemoryLastPlay = checked;
|
|
|
+ PreferencesUtil.put(SettingPage.iS_MEMORY_LAST_PLAY, this.isMemoryLastPlay)
|
|
|
+ this.sendChangeEvent()
|
|
|
+ })
|
|
|
+ .width(50)
|
|
|
+ .height(30);
|
|
|
+ }
|
|
|
+ .height(55)
|
|
|
Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
// 记忆播放
|
|
|
Row() {
|
|
|
@@ -693,6 +767,7 @@ export struct SettingPage {
|
|
|
.onChange((checked: boolean) => {
|
|
|
this.isMusicMemoryPlay = checked;
|
|
|
PreferencesUtil.put(SettingPage.iS_MUSIC_MEMORY_PLAY, this.isMusicMemoryPlay)
|
|
|
+ this.sendChangeEvent()
|
|
|
})
|
|
|
.width(50)
|
|
|
.height(30);
|
|
|
@@ -869,6 +944,8 @@ export struct SettingPage {
|
|
|
})
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.height(55)
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
.backgroundColor($r('app.color.settings_background_main'))
|
|
|
.borderRadius(20)
|
|
|
@@ -880,6 +957,42 @@ export struct SettingPage {
|
|
|
})
|
|
|
.padding(0)
|
|
|
|
|
|
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
+ Text('设置教程:')
|
|
|
+ .margin({ left: 18 })
|
|
|
+ .fontSize(15)
|
|
|
+ .fontColor(Color.Gray)
|
|
|
+ .fontWeight(480)
|
|
|
+ Text('点击进Q群讨论')
|
|
|
+ .margin({ right: 10 })
|
|
|
+ .fontSize(15)
|
|
|
+ .fontColor(Color.Gray)
|
|
|
+ .layoutWeight(1)
|
|
|
+ Blank()
|
|
|
+ // 右侧箭头
|
|
|
+ Image($r('app.media.arrow_right'))
|
|
|
+ .width(22)
|
|
|
+ .height(22)
|
|
|
+ .margin({ left: 20, right: 20 })
|
|
|
+ .align(Alignment.Center)
|
|
|
+ }
|
|
|
+ .height(55)
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .onClick(() => {
|
|
|
+ const qqUrl = `mqqapi://card/show_pslcard?src_type=internal&version=1&uin=${CommonConstants.QQ_GROUP}&card_type=group&source=external`;
|
|
|
+ let context = this.getUIContext().getHostContext() as common.UIAbilityContext;
|
|
|
+ context.openLink(qqUrl, {})
|
|
|
+ })
|
|
|
+ .backgroundColor($r('app.color.settings_background_main'))
|
|
|
+ .borderRadius(15)
|
|
|
+ .margin({ top: 0, bottom: 20 })
|
|
|
+ .padding(0)
|
|
|
+
|
|
|
+
|
|
|
//空白
|
|
|
Column() {
|
|
|
Blank()
|