diff --git a/components/index/MahjongCard.vue b/components/index/MahjongCard.vue index 6fb3235..ff24a24 100644 --- a/components/index/MahjongCard.vue +++ b/components/index/MahjongCard.vue @@ -97,7 +97,13 @@ const playerPositions = computed(() => { const joinedCount = joinPerson.length // 根据总人数确定布局 - if (personCount === 2) { + if (personCount === 1) { + // 1人局:只显示自己,头像放在左侧位置(第二行左) + return { + positions: [null, joinPerson[0] || null, null, null], + joinPositions: [false, false, false, false] + } + } else if (personCount === 2) { // 2人局:第二行左边和右边 return { positions: [null, joinPerson[0] || null, joinPerson[1] || null, null], @@ -169,7 +175,10 @@ const getPlayerAtPosition = (position) => { const getJoinPlayerAtPosition = (index) => { const personCount = props.item.personCount - if (personCount === 2) { + if (personCount === 1) { + // 1人局:仅展示左侧位置(索引2) + return index === 2 + } else if (personCount === 2) { // 2人局:第二行左边和右边 return [2, 3].includes(index) } else if (personCount === 3) {