优化总点数显示逻辑,调整初始值为null并从API获取真实数据,改进游戏界面状态处理,提升用户体验

This commit is contained in:
zyh
2025-11-06 18:56:26 +08:00
parent 2e35f219e7
commit e2a9fef1d0
4 changed files with 81 additions and 18 deletions

View File

@@ -16,7 +16,7 @@
<div class="detail-value region-value">{{ selectedRegion || '未选择' }}</div>
<div class="detail-value">待选区</div>
<div class="detail-value">{{ mecmachineId || '待分配' }}</div>
<div class="detail-value points-value">{{ totalPoints || 4000 }}</div>
<div class="detail-value points-value">{{ displayTotalPoints }}</div>
</div>
</div>
@@ -92,7 +92,7 @@ export default {
},
totalPoints: {
type: Number,
default: 4000
default: null
}
},
data() {
@@ -103,6 +103,16 @@ export default {
}
},
emits: ['selectRegion'],
computed: {
displayTotalPoints() {
// 如果 totalPoints 为 null 或 undefined显示"待分配"
// 注意0 是有效值,应该显示
if (this.totalPoints === null || this.totalPoints === undefined) {
return '待分配'
}
return this.totalPoints
}
},
methods: {
selectRegionOption(code) {
this.regionCode = code