|
@@ -123,193 +123,205 @@ export struct SettingPage {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
build() {
|
|
|
|
|
+
|
|
|
Column() {
|
|
Column() {
|
|
|
TitleBar({ model: $titleBarModel })
|
|
TitleBar({ model: $titleBarModel })
|
|
|
- Column() {
|
|
|
|
|
- //音频设置
|
|
|
|
|
- Row() {
|
|
|
|
|
- Text('音频设置')
|
|
|
|
|
- .margin({ left: 38, right: 20 })
|
|
|
|
|
- .fontSize(16)
|
|
|
|
|
- .fontColor(Color.Gray)
|
|
|
|
|
- .fontWeight(480)
|
|
|
|
|
- Blank()
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .height(55)
|
|
|
|
|
|
|
+ Scroll() {
|
|
|
|
|
+ Column() {
|
|
|
|
|
+ //音频设置
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ Text('音频设置')
|
|
|
|
|
+ .margin({ left: 38, right: 20 })
|
|
|
|
|
+ .fontSize(16)
|
|
|
|
|
+ .fontColor(Color.Gray)
|
|
|
|
|
+ .fontWeight(480)
|
|
|
|
|
+ Blank()
|
|
|
|
|
+ }
|
|
|
|
|
+ .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()
|
|
|
|
|
+ Toggle({ type: ToggleType.Switch, isOn: this.isMusicMemoryPlay })
|
|
|
|
|
+ .selectedColor($r('app.color.title_bar_bg'))// 设置开关打开时的背景颜色为蓝色
|
|
|
|
|
+ .switchPointColor(Color.White)// 设置开关关闭时的滑块颜色为白色
|
|
|
|
|
+ .margin({ right: 28 })
|
|
|
|
|
+ .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
|
|
|
|
|
+ this.isMusicMemoryPlay = checked;
|
|
|
|
|
+ PreferencesUtil.put(SettingPage.iS_MUSIC_MEMORY_PLAY, this.isMusicMemoryPlay)
|
|
|
|
|
+ })
|
|
|
|
|
+ .width(50)
|
|
|
|
|
+ .height(30);
|
|
|
|
|
+ }
|
|
|
|
|
+ .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()
|
|
|
|
|
- Toggle({ type: ToggleType.Switch, isOn: this.isMusicMemoryPlay })
|
|
|
|
|
- .selectedColor($r('app.color.title_bar_bg'))// 设置开关打开时的背景颜色为蓝色
|
|
|
|
|
- .switchPointColor(Color.White)// 设置开关关闭时的滑块颜色为白色
|
|
|
|
|
- .margin({ right: 28 })
|
|
|
|
|
- .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
|
|
|
|
|
- this.isMusicMemoryPlay = checked;
|
|
|
|
|
- PreferencesUtil.put(SettingPage.iS_MUSIC_MEMORY_PLAY, this.isMusicMemoryPlay)
|
|
|
|
|
- })
|
|
|
|
|
- .width(50)
|
|
|
|
|
- .height(30);
|
|
|
|
|
- }
|
|
|
|
|
- .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)
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- 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)
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
- .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()
|
|
|
|
|
+ Toggle({ type: ToggleType.Switch, isOn: this.isMusicBGCover })
|
|
|
|
|
+ .selectedColor($r('app.color.title_bar_bg'))// 设置开关打开时的背景颜色为蓝色
|
|
|
|
|
+ .switchPointColor(Color.White)// 设置开关关闭时的滑块颜色为白色
|
|
|
|
|
+ .margin({ right: 28 })
|
|
|
|
|
+ .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
|
|
|
|
|
+ this.isMusicBGCover = checked;
|
|
|
|
|
+ PreferencesUtil.put(SettingPage.iS_MUSIC_BG_COVER, this.isMusicBGCover)
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ .width(50)
|
|
|
|
|
+ .height(30);
|
|
|
|
|
+ }
|
|
|
|
|
+ .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()
|
|
|
|
|
- Toggle({ type: ToggleType.Switch, isOn: this.isMusicBGCover })
|
|
|
|
|
- .selectedColor($r('app.color.title_bar_bg'))// 设置开关打开时的背景颜色为蓝色
|
|
|
|
|
- .switchPointColor(Color.White)// 设置开关关闭时的滑块颜色为白色
|
|
|
|
|
- .margin({ right: 28 })
|
|
|
|
|
- .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
|
|
|
|
|
- this.isMusicBGCover = checked;
|
|
|
|
|
- PreferencesUtil.put(SettingPage.iS_MUSIC_BG_COVER, this.isMusicBGCover)
|
|
|
|
|
|
|
|
|
|
- })
|
|
|
|
|
- .width(50)
|
|
|
|
|
- .height(30);
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .height(55)
|
|
|
|
|
|
|
+ Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
|
|
|
|
|
|
|
+ // API设置(合并标题)
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ Text('API设置')
|
|
|
|
|
+ .margin({ left: 38, right: 20 })
|
|
|
|
|
+ .fontSize(16)
|
|
|
|
|
+ .fontColor(Color.Gray)
|
|
|
|
|
+ .fontWeight(480)
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .height(55)
|
|
|
|
|
|
|
|
- Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
|
|
|
|
+ Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
|
|
+ // 歌词API地址展示
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ Text('歌词:')
|
|
|
|
|
+ .margin({ left: 38, right: 6 })
|
|
|
|
|
+ .fontSize(15)
|
|
|
|
|
+ .fontColor(Color.Gray)
|
|
|
|
|
+ Text(this.lyricApiUrl)
|
|
|
|
|
+ .margin({ right: 10 })
|
|
|
|
|
+ .fontSize(15)
|
|
|
|
|
+ .fontColor(Color.Gray)
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
|
|
+ // 编辑图标按钮
|
|
|
|
|
+ Image($r('app.media.edit'))
|
|
|
|
|
+ .width(28)
|
|
|
|
|
+ .height(28)
|
|
|
|
|
+ .margin({ right: 18 })
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ this.apiDialogType = 'lyric'
|
|
|
|
|
+ this.tempApiUrl = this.lyricApiUrl
|
|
|
|
|
+ this.apiDialogController.open()
|
|
|
|
|
+ })
|
|
|
|
|
+ Blank()
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .margin({ top: 8, bottom: 12 })
|
|
|
|
|
|
|
|
- // API设置(合并标题)
|
|
|
|
|
- Row() {
|
|
|
|
|
- Text('API设置')
|
|
|
|
|
- .margin({ left: 38, right: 20 })
|
|
|
|
|
- .fontSize(16)
|
|
|
|
|
- .fontColor(Color.Gray)
|
|
|
|
|
- .fontWeight(480)
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .height(55)
|
|
|
|
|
|
|
+ // 封面API地址展示
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ Text('封面:')
|
|
|
|
|
+ .margin({ left: 38, right: 6 })
|
|
|
|
|
+ .fontSize(15)
|
|
|
|
|
+ .fontColor(Color.Gray)
|
|
|
|
|
+ Text(this.coverApiUrl)
|
|
|
|
|
+ .margin({ right: 10 })
|
|
|
|
|
+ .fontSize(15)
|
|
|
|
|
+ .fontColor(Color.Gray)
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
|
|
+ // 编辑图标按钮
|
|
|
|
|
+ Image($r('app.media.edit'))
|
|
|
|
|
+ .width(28)
|
|
|
|
|
+ .height(28)
|
|
|
|
|
+ .margin({ right: 18 })
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ this.apiDialogType = 'cover'
|
|
|
|
|
+ this.tempApiUrl = this.coverApiUrl
|
|
|
|
|
+ this.apiDialogController.open()
|
|
|
|
|
+ })
|
|
|
|
|
+ Blank()
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .margin({ top: 8, bottom: 12 })
|
|
|
|
|
|
|
|
- Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
|
|
|
|
|
- // 歌词API地址展示
|
|
|
|
|
- Row() {
|
|
|
|
|
- Text('歌词:')
|
|
|
|
|
- .margin({ left: 38, right: 6 })
|
|
|
|
|
- .fontSize(15)
|
|
|
|
|
- .fontColor(Color.Gray)
|
|
|
|
|
- Text(this.lyricApiUrl)
|
|
|
|
|
- .margin({ right: 10 })
|
|
|
|
|
- .fontSize(15)
|
|
|
|
|
- .fontColor(Color.Gray)
|
|
|
|
|
- .layoutWeight(1)
|
|
|
|
|
- // 编辑图标按钮
|
|
|
|
|
- Image($r('app.media.edit'))
|
|
|
|
|
- .width(28)
|
|
|
|
|
- .height(28)
|
|
|
|
|
- .margin({ right: 18 })
|
|
|
|
|
- .onClick(() => {
|
|
|
|
|
- this.apiDialogType = 'lyric'
|
|
|
|
|
- this.tempApiUrl = this.lyricApiUrl
|
|
|
|
|
- this.apiDialogController.open()
|
|
|
|
|
- })
|
|
|
|
|
- Blank()
|
|
|
|
|
}
|
|
}
|
|
|
- .width('100%')
|
|
|
|
|
- .margin({ top: 8, bottom: 12 })
|
|
|
|
|
|
|
+ .backgroundColor(Color.White)
|
|
|
|
|
+ .margin({
|
|
|
|
|
+ left: 25,
|
|
|
|
|
+ right: 25,
|
|
|
|
|
+ top: 20,
|
|
|
|
|
+ bottom: 50
|
|
|
|
|
+ })
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
|
|
+ .justifyContent(FlexAlign.Start) // Align items to the start
|
|
|
|
|
+ .borderRadius(30)
|
|
|
|
|
|
|
|
- // 封面API地址展示
|
|
|
|
|
- Row() {
|
|
|
|
|
- Text('封面:')
|
|
|
|
|
- .margin({ left: 38, right: 6 })
|
|
|
|
|
- .fontSize(15)
|
|
|
|
|
- .fontColor(Color.Gray)
|
|
|
|
|
- Text(this.coverApiUrl)
|
|
|
|
|
- .margin({ right: 10 })
|
|
|
|
|
- .fontSize(15)
|
|
|
|
|
- .fontColor(Color.Gray)
|
|
|
|
|
- .layoutWeight(1)
|
|
|
|
|
- // 编辑图标按钮
|
|
|
|
|
- Image($r('app.media.edit'))
|
|
|
|
|
- .width(28)
|
|
|
|
|
- .height(28)
|
|
|
|
|
- .margin({ right: 18 })
|
|
|
|
|
- .onClick(() => {
|
|
|
|
|
- this.apiDialogType = 'cover'
|
|
|
|
|
- this.tempApiUrl = this.coverApiUrl
|
|
|
|
|
- this.apiDialogController.open()
|
|
|
|
|
- })
|
|
|
|
|
- Blank()
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .margin({ top: 8, bottom: 12 })
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- .backgroundColor(Color.White)
|
|
|
|
|
- .margin({
|
|
|
|
|
- left: 15,
|
|
|
|
|
- right: 15,
|
|
|
|
|
- top: 20,
|
|
|
|
|
- bottom: 10
|
|
|
|
|
- })
|
|
|
|
|
- .borderRadius(30)
|
|
|
|
|
|
|
+ .scrollBar(BarState.Auto)
|
|
|
|
|
+ .height('100%')
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .margin({bottom:18})
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
.backgroundColor($r('app.color.index_background'))
|
|
.backgroundColor($r('app.color.index_background'))
|
|
|
.height('100%')
|
|
.height('100%')
|
|
|
|
|
+ .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|