|
|
@@ -127,9 +127,11 @@ struct HeroItem{
|
|
|
} else {
|
|
|
for (let i = 0; i < this.flowerCoordinates.length; i++) {
|
|
|
let f = new Location(this.flowerCoordinates[i].x, this.flowerCoordinates[i].y)
|
|
|
- f.x -= 5
|
|
|
- f.y += 20
|
|
|
- this.getUIContext().animateTo({ duration: 600 }, () => {
|
|
|
+ // 将原来的固定值修改为随机值
|
|
|
+ // f.x += (Math.random() > 0.5 ? 1 : -1) * (5 + Math.random() * 15)
|
|
|
+
|
|
|
+ f.y += 15 + Math.random() * (this.isOpen ? 300 : 50)
|
|
|
+ this.getUIContext().animateTo({ duration: 800 }, () => {
|
|
|
this.flowerCoordinates.splice(i, 1, f)
|
|
|
})
|
|
|
}
|
|
|
@@ -302,12 +304,15 @@ struct HeroItem{
|
|
|
Image($r('app.media.icon_hero_flower'))
|
|
|
.width(36)
|
|
|
.aspectRatio(1)
|
|
|
+ .zIndex(999)
|
|
|
.position({ x: `${item.item.x}%`, y: item.item.y })
|
|
|
+ .opacity(this.flowerAnimation ? 1 : 0)
|
|
|
})
|
|
|
.key((item) => JSON.stringify(item))
|
|
|
}
|
|
|
.width("100%")
|
|
|
.height(this.height_)
|
|
|
+ .opacity(this.flowerAnimation ? 1 : 0)
|
|
|
}
|
|
|
}
|
|
|
.width('100%')
|