|
@@ -139,7 +139,6 @@ const ITEM_HEIGHT_BIG: number = 78; // 列表项大高度
|
|
|
@Component
|
|
@Component
|
|
|
export struct LocalMusic {
|
|
export struct LocalMusic {
|
|
|
@State opacityValueImage: number = 1;
|
|
@State opacityValueImage: number = 1;
|
|
|
- @State isAnimating: boolean = false;
|
|
|
|
|
@State tipPopup:boolean = false
|
|
@State tipPopup:boolean = false
|
|
|
@Consume mType: number;
|
|
@Consume mType: number;
|
|
|
@StorageProp('themeColor') themeColor: string =
|
|
@StorageProp('themeColor') themeColor: string =
|
|
@@ -196,6 +195,7 @@ export struct LocalMusic {
|
|
|
@State isMemoryLastPlay: boolean = false //是否启用应用退出记忆最后一首的播放进度
|
|
@State isMemoryLastPlay: boolean = false //是否启用应用退出记忆最后一首的播放进度
|
|
|
@State isCoverTopBig: boolean = false //顶部大封面部分手机显示会和播放控制页重叠
|
|
@State isCoverTopBig: boolean = false //顶部大封面部分手机显示会和播放控制页重叠
|
|
|
@State isSwipe: boolean = false //listItem的左滑开关
|
|
@State isSwipe: boolean = false //listItem的左滑开关
|
|
|
|
|
+ @State openSkipSongAnimate: boolean = true//切歌动画效果
|
|
|
@State customizeBgPath: string | undefined = '';
|
|
@State customizeBgPath: string | undefined = '';
|
|
|
@State isDarkMode: boolean = false
|
|
@State isDarkMode: boolean = false
|
|
|
@State lyricTextWeight: number = 400
|
|
@State lyricTextWeight: number = 400
|
|
@@ -621,6 +621,7 @@ export struct LocalMusic {
|
|
|
this.isShowHeader = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_HEADER, true)
|
|
this.isShowHeader = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_HEADER, true)
|
|
|
this.volume = PreferencesUtil.getNumberSync('DefalutVolume', this.volume)
|
|
this.volume = PreferencesUtil.getNumberSync('DefalutVolume', this.volume)
|
|
|
this.isSwipe = PreferencesUtil.getBooleanSync(SettingPage.IS_SWIPE, true)
|
|
this.isSwipe = PreferencesUtil.getBooleanSync(SettingPage.IS_SWIPE, true)
|
|
|
|
|
+ this.openSkipSongAnimate = PreferencesUtil.getBooleanSync(SettingPage.OPEN_SKIPSONG_ANIMATE, true)
|
|
|
//如果是hicar连接状态,这些都是false
|
|
//如果是hicar连接状态,这些都是false
|
|
|
if(this.isHiCarStatus){
|
|
if(this.isHiCarStatus){
|
|
|
this.isShowTitleBar = false//不显示导航栏
|
|
this.isShowTitleBar = false//不显示导航栏
|
|
@@ -7315,9 +7316,9 @@ export struct LocalMusic {
|
|
|
.aspectRatio(1)
|
|
.aspectRatio(1)
|
|
|
.opacity(this.opacityValueImage)
|
|
.opacity(this.opacityValueImage)
|
|
|
.scale({ x: this.scaleValueImage, y: this.scaleValueImage }) // 添加缩放效果
|
|
.scale({ x: this.scaleValueImage, y: this.scaleValueImage }) // 添加缩放效果
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
|
.visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
.visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
|
|
|
.align(Alignment.Center)//
|
|
.align(Alignment.Center)//
|
|
|
.clip(true)
|
|
.clip(true)
|
|
|
.rotate({
|
|
.rotate({
|
|
@@ -7453,7 +7454,6 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
.margin({ top: this.isCoverOpacity() ? 20 : isHidden ? 40 : 20 })
|
|
.margin({ top: this.isCoverOpacity() ? 20 : isHidden ? 40 : 20 })
|
|
|
.zIndex(1)
|
|
.zIndex(1)
|
|
|
- // .opacity(this.opacityValueImage)
|
|
|
|
|
.scale({ x: this.scaleValueImage, y: this.scaleValueImage }) // 添加缩放效果
|
|
.scale({ x: this.scaleValueImage, y: this.scaleValueImage }) // 添加缩放效果
|
|
|
.visibility(this.isCoverOpacity() || isHidden ? Visibility.None : Visibility.Visible)
|
|
.visibility(this.isCoverOpacity() || isHidden ? Visibility.None : Visibility.Visible)
|
|
|
}
|
|
}
|
|
@@ -10440,30 +10440,36 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
changeImageAnimation() {
|
|
changeImageAnimation() {
|
|
|
- // 第一步:淡出动画
|
|
|
|
|
- this.getUIContext()?.animateTo({
|
|
|
|
|
- duration: 500,
|
|
|
|
|
- curve: Curve.EaseOut,
|
|
|
|
|
- }, () => {
|
|
|
|
|
- this.opacityValueImage = 0.1;
|
|
|
|
|
- if(this.isCoverRectangle){
|
|
|
|
|
- this.scaleValueImage = 0.88
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 第二步:切换图片后淡入
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.cover = this.songList[this.curIndex].pixelMapPath
|
|
|
|
|
|
|
+ if(this.openSkipSongAnimate){
|
|
|
|
|
+ // 第一步:淡出动画
|
|
|
this.getUIContext()?.animateTo({
|
|
this.getUIContext()?.animateTo({
|
|
|
duration: 500,
|
|
duration: 500,
|
|
|
- curve: Curve.EaseIn,
|
|
|
|
|
|
|
+ curve: Curve.EaseOut,
|
|
|
}, () => {
|
|
}, () => {
|
|
|
- this.opacityValueImage = 1;
|
|
|
|
|
- this.scaleValueImage = 1 // 图标恢复到原始大小
|
|
|
|
|
- this.startPlayOrResumePlay()
|
|
|
|
|
|
|
+ this.opacityValueImage = 0.1;
|
|
|
|
|
+ if(this.isCoverRectangle){
|
|
|
|
|
+ this.scaleValueImage = 0.88
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
- }, 500);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 第二步:切换图片后淡入
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.cover = this.songList[this.curIndex].pixelMapPath
|
|
|
|
|
+ this.getUIContext()?.animateTo({
|
|
|
|
|
+ duration: 500,
|
|
|
|
|
+ curve: Curve.EaseIn,
|
|
|
|
|
+ }, () => {
|
|
|
|
|
+ this.opacityValueImage = 1;
|
|
|
|
|
+ this.scaleValueImage = 1 // 图标恢复到原始大小
|
|
|
|
|
+ this.startPlayOrResumePlay()
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.cover = this.songList[this.curIndex].pixelMapPath
|
|
|
|
|
+ this.startPlayOrResumePlay()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 存储已播放的歌曲索引
|
|
// 存储已播放的歌曲索引
|