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
|
<view
|
||||||
v-for="result in pendingResults"
|
v-for="result in pendingResults"
|
||||||
:key="result.id"
|
:key="result.id"
|
||||||
class="result-item"
|
class="result-item pending"
|
||||||
@click="showConfirmDialog(result)"
|
@click="showConfirmDialog(result)"
|
||||||
>
|
>
|
||||||
<view class="result-info">
|
<view class="result-info">
|
||||||
@@ -67,9 +67,41 @@
|
|||||||
<view class="score-info">
|
<view class="score-info">
|
||||||
<view class="chief-score">
|
<view class="chief-score">
|
||||||
<text class="label">主裁判分:</text>
|
<text class="label">主裁判分:</text>
|
||||||
<text class="value">{{ result.chiefJudgeScore || result.totalScore }}</text>
|
<text class="value">{{ result.chiefJudgeScore || result.finalScore }}</text>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -86,7 +118,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<text class="label">主裁判分:</text>
|
<text class="label">主裁判分:</text>
|
||||||
<text class="value">{{ currentResult.chiefJudgeScore || currentResult.totalScore }}</text>
|
<text class="value">{{ currentResult.chiefJudgeScore || currentResult.finalScore }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="input-row">
|
<view class="input-row">
|
||||||
<text class="label">确认分数:</text>
|
<text class="label">确认分数:</text>
|
||||||
@@ -128,6 +160,7 @@ export default {
|
|||||||
venues: [],
|
venues: [],
|
||||||
selectedVenueId: null,
|
selectedVenueId: null,
|
||||||
pendingResults: [],
|
pendingResults: [],
|
||||||
|
confirmedResults: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
showDialog: false,
|
showDialog: false,
|
||||||
currentResult: {},
|
currentResult: {},
|
||||||
@@ -141,7 +174,7 @@ export default {
|
|||||||
this.matchName = app.globalData.matchName || ""
|
this.matchName = app.globalData.matchName || ""
|
||||||
this.matchId = app.globalData.matchId
|
this.matchId = app.globalData.matchId
|
||||||
this.loadVenues()
|
this.loadVenues()
|
||||||
this.loadPendingResults()
|
this.loadAllResults()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadVenues() {
|
async loadVenues() {
|
||||||
@@ -161,10 +194,11 @@ export default {
|
|||||||
console.error("加载场地失败:", e)
|
console.error("加载场地失败:", e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async loadPendingResults() {
|
async loadAllResults() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
const res = await uni.request({
|
// 加载待确认成绩
|
||||||
|
const pendingRes = await uni.request({
|
||||||
url: config.apiBaseURL + "/mini/general/pending",
|
url: config.apiBaseURL + "/mini/general/pending",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
data: { competitionId: this.matchId },
|
data: { competitionId: this.matchId },
|
||||||
@@ -172,22 +206,39 @@ export default {
|
|||||||
"Authorization": uni.getStorageSync("token")
|
"Authorization": uni.getStorageSync("token")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (res[1].data.success) {
|
if (pendingRes[1].data.success) {
|
||||||
let results = res[1].data.data || []
|
let results = pendingRes[1].data.data || []
|
||||||
if (this.selectedVenueId) {
|
if (this.selectedVenueId) {
|
||||||
results = results.filter(r => r.venueId === this.selectedVenueId)
|
results = results.filter(r => r.venueId === this.selectedVenueId)
|
||||||
}
|
}
|
||||||
this.pendingResults = results
|
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) {
|
} catch (e) {
|
||||||
console.error("加载待确认成绩失败:", e)
|
console.error("加载成绩失败:", e)
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectVenue(venueId) {
|
selectVenue(venueId) {
|
||||||
this.selectedVenueId = venueId
|
this.selectedVenueId = venueId
|
||||||
this.loadPendingResults()
|
this.loadAllResults()
|
||||||
},
|
},
|
||||||
showConfirmDialog(result) {
|
showConfirmDialog(result) {
|
||||||
this.currentResult = result
|
this.currentResult = result
|
||||||
@@ -221,7 +272,7 @@ export default {
|
|||||||
if (res[1].data.success) {
|
if (res[1].data.success) {
|
||||||
uni.showToast({ title: "确认成功", icon: "success" })
|
uni.showToast({ title: "确认成功", icon: "success" })
|
||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
this.loadPendingResults()
|
this.loadAllResults()
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: res[1].data.msg || "确认失败", icon: "none" })
|
uni.showToast({ title: res[1].data.msg || "确认失败", icon: "none" })
|
||||||
}
|
}
|
||||||
@@ -250,6 +301,7 @@ export default {
|
|||||||
.container {
|
.container {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #F5F5F5;
|
background-color: #F5F5F5;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-bar {
|
.nav-bar {
|
||||||
@@ -345,7 +397,7 @@ export default {
|
|||||||
|
|
||||||
.loading, .empty {
|
.loading, .empty {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 60rpx;
|
padding: 40rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
@@ -363,7 +415,14 @@ export default {
|
|||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
background: #FAFAFA;
|
background: #FAFAFA;
|
||||||
border-radius: 12rpx;
|
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 {
|
.player-name {
|
||||||
@@ -390,16 +449,27 @@ export default {
|
|||||||
.chief-score .value {
|
.chief-score .value {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #8B4513;
|
color: #FF9800;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chief-score .value.confirmed {
|
||||||
|
color: #4CAF50;
|
||||||
|
}
|
||||||
|
|
||||||
.status-tag {
|
.status-tag {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #FF9800;
|
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-tag.pending {
|
||||||
|
color: #FF9800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tag.confirmed {
|
||||||
|
color: #4CAF50;
|
||||||
|
}
|
||||||
|
|
||||||
.dialog-mask {
|
.dialog-mask {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user