修复跑马bug

This commit is contained in:
2026-04-12 17:39:46 +08:00
parent 5b637d2c64
commit 87c7a8d786
@@ -209,10 +209,12 @@
'#b8d0e8')">
</div>
{{-- 马匹图标(跟随进度) --}}
<div style="position:absolute; top:50%; font-size:18px; line-height:1; transition:left .9s ease-out, transform .25s ease-out; pointer-events:none; will-change:left,transform;"
:style="'left:calc(' + Math.min(100, Math.max(0, positions[horse.id] || 0)) + '% - 14px); transform:translateY(-50%) ' +
((leaderId === horse.id || (positions[horse.id] || 0) > 0) ? 'scale(1.06)' : 'scale(1)') + '; ' +
((positions[horse.id] || 0) > 0 ? 'animation:horse-run .45s ease-in-out infinite alternate;' : '')">
<div style="position:absolute; top:50%; font-size:18px; line-height:1; transition:left .9s ease-out, transform .25s ease-out; pointer-events:none; will-change:left,transform; z-index:1;"
:style="{
left: (positions[horse.id] || 0) + '%',
transform: 'translateY(-50%) translateX(-100%) ' + (leaderId === horse.id ? 'scale(1.2)' : 'scale(1)'),
animation: (positions[horse.id] || 0) > 0 ? 'horse-run .45s ease-in-out infinite alternate' : 'none'
}">
<span x-text="horse.emoji"></span>
</div>
</div>
@@ -536,7 +538,11 @@
*/
updateProgress(data) {
this.phase = 'running';
this.positions = data.positions || {};
// 确保响应式更新
this.positions = {
...this.positions,
...(data.positions || {})
};
this.leaderId = data.leader_id;
},