Compare commits
2 Commits
3b05e7fc28
...
412069524e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
412069524e | ||
|
|
53cc4600a8 |
@@ -91,6 +91,27 @@ export function saveDispatch(data) {
|
||||
return request.post('/martial/schedule/save-dispatch', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取编排状态(小程序用)
|
||||
* @param {Number} competitionId - 赛事ID
|
||||
*/
|
||||
export function getScheduleStatus(competitionId) {
|
||||
return request.get('/mini/schedule/status', {
|
||||
params: { competitionId }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出场顺序(小程序用)
|
||||
* @param {Number} competitionId - 赛事ID
|
||||
* @param {Number} projectId - 项目ID (可选)
|
||||
*/
|
||||
export function getLineup(competitionId, projectId) {
|
||||
return request.get('/mini/schedule/lineup', {
|
||||
params: { competitionId, projectId }
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
getScheduleResult,
|
||||
triggerAutoArrange,
|
||||
@@ -99,5 +120,7 @@ export default {
|
||||
moveScheduleGroup,
|
||||
getDispatchData,
|
||||
adjustOrder,
|
||||
saveDispatch
|
||||
saveDispatch,
|
||||
getScheduleStatus,
|
||||
getLineup
|
||||
}
|
||||
|
||||
@@ -1,135 +1,127 @@
|
||||
<template>
|
||||
<view class="event-lineup-page">
|
||||
<view v-if="loading" class="loading-container">
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-else-if="!isScheduleCompleted" class="not-ready">
|
||||
<view class="not-ready-icon">📋</view>
|
||||
<text class="not-ready-text">赛程编排尚未完成</text>
|
||||
<text class="not-ready-hint">请等待赛事组织方完成编排后查看</text>
|
||||
</view>
|
||||
|
||||
<template v-else>
|
||||
<!-- 组别选择 -->
|
||||
<view class="group-tabs">
|
||||
<view
|
||||
class="group-tab"
|
||||
v-for="(group, index) in groups"
|
||||
:key="index"
|
||||
:class="{ active: currentGroup === index }"
|
||||
@click="currentGroup = index"
|
||||
:class="{ active: currentGroupIndex === index }"
|
||||
@click="currentGroupIndex = index"
|
||||
>
|
||||
{{ group }}
|
||||
{{ group.groupName }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 出场顺序列表 -->
|
||||
<view class="lineup-list">
|
||||
<view class="lineup-item" v-for="(item, index) in currentLineup" :key="index">
|
||||
<view class="lineup-list" v-if="currentGroup">
|
||||
<view class="group-header">
|
||||
<text class="group-venue">{{ currentGroup.venueName }}</text>
|
||||
<text class="group-time">{{ currentGroup.timeSlot }}</text>
|
||||
<text class="group-table">表号: {{ currentGroup.tableNo }}</text>
|
||||
</view>
|
||||
|
||||
<view class="lineup-item" v-for="(item, index) in currentGroup.participants" :key="index">
|
||||
<view class="lineup-order">
|
||||
<view class="order-number">{{ item.order }}</view>
|
||||
<text class="order-text">号</text>
|
||||
</view>
|
||||
<view class="lineup-info">
|
||||
<view class="lineup-name">{{ item.name }}</view>
|
||||
<view class="lineup-name">{{ item.playerName }}</view>
|
||||
<view class="lineup-detail">
|
||||
<text class="detail-item">{{ item.team }}</text>
|
||||
<text class="divider">|</text>
|
||||
<text class="detail-item">{{ item.time }}</text>
|
||||
<text class="detail-item">{{ item.organization }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="lineup-status" :class="item.status">
|
||||
{{ item.statusText }}
|
||||
{{ getStatusText(item.status) }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="!currentGroup.participants || currentGroup.participants.length === 0" class="empty-list">
|
||||
<text>暂无参赛者信息</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getScheduleStatus, getLineup } from '@/api/schedule.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentGroup: 0,
|
||||
groups: ['男子A组', '男子B组', '女子A组'],
|
||||
lineups: {
|
||||
0: [
|
||||
{
|
||||
order: 1,
|
||||
name: '张三',
|
||||
team: '北京队',
|
||||
time: '09:00',
|
||||
status: 'finished',
|
||||
statusText: '已完成'
|
||||
},
|
||||
{
|
||||
order: 2,
|
||||
name: '李四',
|
||||
team: '上海队',
|
||||
time: '09:15',
|
||||
status: 'finished',
|
||||
statusText: '已完成'
|
||||
},
|
||||
{
|
||||
order: 3,
|
||||
name: '王五',
|
||||
team: '广东队',
|
||||
time: '09:30',
|
||||
status: 'ongoing',
|
||||
statusText: '进行中'
|
||||
},
|
||||
{
|
||||
order: 4,
|
||||
name: '赵六',
|
||||
team: '天津队',
|
||||
time: '09:45',
|
||||
status: 'waiting',
|
||||
statusText: '待出场'
|
||||
},
|
||||
{
|
||||
order: 5,
|
||||
name: '刘七',
|
||||
team: '江苏队',
|
||||
time: '10:00',
|
||||
status: 'waiting',
|
||||
statusText: '待出场'
|
||||
eventId: '',
|
||||
loading: true,
|
||||
isScheduleCompleted: false,
|
||||
currentGroupIndex: 0,
|
||||
groups: []
|
||||
}
|
||||
],
|
||||
1: [
|
||||
{
|
||||
order: 1,
|
||||
name: '孙八',
|
||||
team: '浙江队',
|
||||
time: '10:30',
|
||||
status: 'waiting',
|
||||
statusText: '待出场'
|
||||
},
|
||||
{
|
||||
order: 2,
|
||||
name: '周九',
|
||||
team: '湖北队',
|
||||
time: '10:45',
|
||||
status: 'waiting',
|
||||
statusText: '待出场'
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
order: 1,
|
||||
name: '小红',
|
||||
team: '四川队',
|
||||
time: '14:00',
|
||||
status: 'waiting',
|
||||
statusText: '待出场'
|
||||
},
|
||||
{
|
||||
order: 2,
|
||||
name: '小芳',
|
||||
team: '河南队',
|
||||
time: '14:15',
|
||||
status: 'waiting',
|
||||
statusText: '待出场'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
currentLineup() {
|
||||
return this.lineups[this.currentGroup] || [];
|
||||
currentGroup() {
|
||||
return this.groups[this.currentGroupIndex] || null
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
if (options.eventId) {
|
||||
this.eventId = options.eventId
|
||||
this.checkScheduleStatus()
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
async checkScheduleStatus() {
|
||||
try {
|
||||
const res = await getScheduleStatus(this.eventId)
|
||||
if (res.data) {
|
||||
this.isScheduleCompleted = res.data.isCompleted
|
||||
if (this.isScheduleCompleted) {
|
||||
await this.loadLineup()
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('检查编排状态失败:', error)
|
||||
uni.showToast({ title: '加载失败', icon: 'none' })
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async loadLineup() {
|
||||
try {
|
||||
const res = await getLineup(this.eventId)
|
||||
if (res.data && res.data.groups) {
|
||||
this.groups = res.data.groups
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载出场顺序失败:', error)
|
||||
}
|
||||
},
|
||||
|
||||
getStatusText(status) {
|
||||
const map = {
|
||||
'waiting': '待出场',
|
||||
'ongoing': '进行中',
|
||||
'finished': '已完成'
|
||||
}
|
||||
return map[status] || '待出场'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -138,6 +130,38 @@ export default {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.loading-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 300rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.not-ready {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 40rpx;
|
||||
}
|
||||
|
||||
.not-ready-icon {
|
||||
font-size: 80rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.not-ready-text {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.not-ready-hint {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.group-tabs {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
@@ -166,6 +190,21 @@ export default {
|
||||
padding: 0 30rpx 20rpx;
|
||||
}
|
||||
|
||||
.group-header {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.group-venue, .group-time, .group-table {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.lineup-item {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
@@ -216,10 +255,6 @@ export default {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.divider {
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
|
||||
.lineup-status {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
@@ -241,4 +276,11 @@ export default {
|
||||
background-color: #F5F5F5;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.empty-list {
|
||||
text-align: center;
|
||||
padding: 60rpx;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -310,6 +310,8 @@ export default {
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
// Refresh contact list when returning from add-contact page
|
||||
this.loadContactList()
|
||||
if (this.currentStep === 1) {
|
||||
if (this.isTeamProject) {
|
||||
this.loadTeamList()
|
||||
|
||||
Reference in New Issue
Block a user