|
|
@@ -227,16 +227,11 @@ export struct LocalMusic {
|
|
|
|
|
|
//瀑布流的列数横竖屏动态切换
|
|
|
onIsLandscapeChange() {
|
|
|
- if(this.isLandscape){
|
|
|
- this.columns = 4
|
|
|
- }else{
|
|
|
- let lastCount = AppStorage.get<number>('columnsCount');
|
|
|
- if (typeof lastCount != 'undefined') {
|
|
|
- this.columns = lastCount;
|
|
|
+ if(this.isLandscape){
|
|
|
+ this.columns = 4
|
|
|
}else{
|
|
|
- this.columns = 2;
|
|
|
+ this.columns = PreferencesUtil.getNumberSync('lastColumns', 2);
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
onColorModeChange() {
|
|
|
@@ -474,10 +469,7 @@ export struct LocalMusic {
|
|
|
// 组件生命周期
|
|
|
aboutToAppear() {
|
|
|
this.sonTwoFingerType = PreferencesUtil.getNumberSync('sonTwoFingerType', 3);
|
|
|
- let lastCount = AppStorage.get<number>('columnsCount');
|
|
|
- if (typeof lastCount != 'undefined') {
|
|
|
- this.columns = lastCount;
|
|
|
- }
|
|
|
+ this.columns = PreferencesUtil.getNumberSync('lastColumns', 2);
|
|
|
if(PreferencesUtil.getBooleanSync('isFirstTiped',true)){
|
|
|
this.tipPopup = !this.tipPopup
|
|
|
PreferencesUtil.putSync('isFirstTiped',false)
|
|
|
@@ -3545,7 +3537,7 @@ export struct LocalMusic {
|
|
|
})
|
|
|
|
|
|
// 持久化保存当前列数:下次启动时恢复
|
|
|
- AppStorage.setOrCreate<number>('columnsCount', this.columns);
|
|
|
+ PreferencesUtil.putSync('lastColumns', this.columns);
|
|
|
})
|
|
|
)
|
|
|
|