优化总点数显示逻辑,调整初始值为null并从API获取真实数据,改进游戏界面状态处理,提升用户体验
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user