feat: 总裁页面同时显示待确认和已确认成绩
- 新增已确认成绩列表区域 - 调用 /mini/general/confirmed 接口获取已确认数据 - 区分显示待确认(橙色)和已确认(绿色)状态 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
<view
|
||||
v-for="result in pendingResults"
|
||||
:key="result.id"
|
||||
class="result-item"
|
||||
class="result-item pending"
|
||||
@click="showConfirmDialog(result)"
|
||||
>
|
||||
<view class="result-info">
|
||||
@@ -67,9 +67,41 @@
|
||||
<view class="score-info">
|
||||
<view class="chief-score">
|
||||
<text class="label">主裁判分:</text>
|
||||
<text class="value">{{ result.chiefJudgeScore || result.totalScore }}</text>
|
||||
<text class="value">{{ result.chiefJudgeScore || result.finalScore }}</text>
|
||||
</view>
|
||||
<view class="status-tag">待确认</view>
|
||||
<view class="status-tag pending">待确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 已确认成绩列表 -->
|
||||
<view class="result-section">
|
||||
<view class="section-title">
|
||||
已确认成绩
|
||||
<text class="count">({{ confirmedResults.length }})</text>
|
||||
</view>
|
||||
|
||||
<view v-if="confirmedResults.length === 0" class="empty">
|
||||
<text>暂无已确认成绩</text>
|
||||
</view>
|
||||
|
||||
<view v-else class="result-list">
|
||||
<view
|
||||
v-for="result in confirmedResults"
|
||||
:key="result.id"
|
||||
class="result-item confirmed"
|
||||
>
|
||||
<view class="result-info">
|
||||
<view class="player-name">{{ result.playerName }}</view>
|
||||
<view class="team-name">{{ result.teamName }}</view>
|
||||
</view>
|
||||
<view class="score-info">
|
||||
<view class="chief-score">
|
||||
<text class="label">最终得分:</text>
|
||||
<text class="value confirmed">{{ result.finalScore }}</text>
|
||||
</view>
|
||||
<view class="status-tag confirmed">已确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -86,7 +118,7 @@
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">主裁判分:</text>
|
||||
<text class="value">{{ currentResult.chiefJudgeScore || currentResult.totalScore }}</text>
|
||||
<text class="value">{{ currentResult.chiefJudgeScore || currentResult.finalScore }}</text>
|
||||
</view>
|
||||
<view class="input-row">
|
||||
<text class="label">确认分数:</text>
|
||||
@@ -128,6 +160,7 @@ export default {
|
||||
venues: [],
|
||||
selectedVenueId: null,
|
||||
pendingResults: [],
|
||||
confirmedResults: [],
|
||||
loading: false,
|
||||
showDialog: false,
|
||||
currentResult: {},
|
||||
@@ -141,7 +174,7 @@ export default {
|
||||
this.matchName = app.globalData.matchName || ""
|
||||
this.matchId = app.globalData.matchId
|
||||
this.loadVenues()
|
||||
this.loadPendingResults()
|
||||
this.loadAllResults()
|
||||
},
|
||||
methods: {
|
||||
async loadVenues() {
|
||||
@@ -161,10 +194,11 @@ export default {
|
||||
console.error("加载场地失败:", e)
|
||||
}
|
||||
},
|
||||
async loadPendingResults() {
|
||||
async loadAllResults() {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await uni.request({
|
||||
// 加载待确认成绩
|
||||
const pendingRes = await uni.request({
|
||||
url: config.apiBaseURL + "/mini/general/pending",
|
||||
method: "GET",
|
||||
data: { competitionId: this.matchId },
|
||||
@@ -172,22 +206,39 @@ export default {
|
||||
"Authorization": uni.getStorageSync("token")
|
||||
}
|
||||
})
|
||||
if (res[1].data.success) {
|
||||
let results = res[1].data.data || []
|
||||
if (pendingRes[1].data.success) {
|
||||
let results = pendingRes[1].data.data || []
|
||||
if (this.selectedVenueId) {
|
||||
results = results.filter(r => r.venueId === this.selectedVenueId)
|
||||
}
|
||||
this.pendingResults = results
|
||||
}
|
||||
|
||||
// 加载已确认成绩
|
||||
const confirmedRes = await uni.request({
|
||||
url: config.apiBaseURL + "/mini/general/confirmed",
|
||||
method: "GET",
|
||||
data: { competitionId: this.matchId },
|
||||
header: {
|
||||
"Authorization": uni.getStorageSync("token")
|
||||
}
|
||||
})
|
||||
if (confirmedRes[1].data.success) {
|
||||
let results = confirmedRes[1].data.data || []
|
||||
if (this.selectedVenueId) {
|
||||
results = results.filter(r => r.venueId === this.selectedVenueId)
|
||||
}
|
||||
this.confirmedResults = results
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("加载待确认成绩失败:", e)
|
||||
console.error("加载成绩失败:", e)
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
selectVenue(venueId) {
|
||||
this.selectedVenueId = venueId
|
||||
this.loadPendingResults()
|
||||
this.loadAllResults()
|
||||
},
|
||||
showConfirmDialog(result) {
|
||||
this.currentResult = result
|
||||
@@ -221,7 +272,7 @@ export default {
|
||||
if (res[1].data.success) {
|
||||
uni.showToast({ title: "确认成功", icon: "success" })
|
||||
this.closeDialog()
|
||||
this.loadPendingResults()
|
||||
this.loadAllResults()
|
||||
} else {
|
||||
uni.showToast({ title: res[1].data.msg || "确认失败", icon: "none" })
|
||||
}
|
||||
@@ -250,6 +301,7 @@ export default {
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
background-color: #F5F5F5;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.nav-bar {
|
||||
@@ -345,7 +397,7 @@ export default {
|
||||
|
||||
.loading, .empty {
|
||||
text-align: center;
|
||||
padding: 60rpx;
|
||||
padding: 40rpx;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
@@ -363,7 +415,14 @@ export default {
|
||||
padding: 24rpx;
|
||||
background: #FAFAFA;
|
||||
border-radius: 12rpx;
|
||||
border-left: 6rpx solid #8B4513;
|
||||
}
|
||||
|
||||
.result-item.pending {
|
||||
border-left: 6rpx solid #FF9800;
|
||||
}
|
||||
|
||||
.result-item.confirmed {
|
||||
border-left: 6rpx solid #4CAF50;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
@@ -390,16 +449,27 @@ export default {
|
||||
.chief-score .value {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #8B4513;
|
||||
color: #FF9800;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.chief-score .value.confirmed {
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
font-size: 24rpx;
|
||||
color: #FF9800;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.status-tag.pending {
|
||||
color: #FF9800;
|
||||
}
|
||||
|
||||
.status-tag.confirmed {
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
.dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
||||
Reference in New Issue
Block a user