Compare commits
6 Commits
c978a5bf64
...
devops
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88a931976d | ||
|
|
96bc2d92a2 | ||
|
|
a9c5c4a904 | ||
|
|
5349b80cf8 | ||
|
|
56c1320e40 | ||
|
|
c5c31e8088 |
@@ -23,7 +23,10 @@ export function getMyAthletes(params) {
|
||||
return request({
|
||||
url: '/mini/score/athletes',
|
||||
method: 'GET',
|
||||
params: params, // GET 请求使用 params
|
||||
params: {
|
||||
...params,
|
||||
size: 200 // 确保获取所有选手
|
||||
},
|
||||
showLoading: true
|
||||
})
|
||||
}
|
||||
@@ -36,14 +39,24 @@ export function getMyAthletes(params) {
|
||||
* @param {String} params.projectId - 项目ID
|
||||
* @returns {Promise}
|
||||
*
|
||||
* 注意:此接口需要后端实现
|
||||
* 建议路径: GET /api/mini/athletes/admin
|
||||
* 实际调用 /mini/score/athletes 接口,传递 refereeType=1
|
||||
*/
|
||||
export function getAthletesForAdmin(params) {
|
||||
// 从 globalData 获取 judgeId
|
||||
const app = getApp()
|
||||
const globalData = app.globalData || {}
|
||||
const judgeId = globalData.judgeId
|
||||
|
||||
return request({
|
||||
url: '/mini/athletes/admin',
|
||||
url: '/mini/score/athletes',
|
||||
method: 'GET',
|
||||
params: params, // GET 请求使用 params
|
||||
params: {
|
||||
judgeId: judgeId,
|
||||
refereeType: 1, // 裁判长
|
||||
venueId: params.venueId,
|
||||
projectId: params.projectId,
|
||||
size: 200 // 确保获取所有选手
|
||||
},
|
||||
showLoading: true
|
||||
})
|
||||
}
|
||||
@@ -90,55 +103,3 @@ export default {
|
||||
getVenues,
|
||||
getProjects
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端接口规范:
|
||||
*
|
||||
* GET /api/mini/score/athletes
|
||||
*
|
||||
* 请求参数:
|
||||
* {
|
||||
* "judgeId": "456",
|
||||
* "refereeType": 2, // 1-裁判长, 2-普通裁判
|
||||
* "venueId": "1", // 可选
|
||||
* "projectId": "5" // 可选
|
||||
* }
|
||||
*
|
||||
* 响应(普通裁判 - 待评分选手):
|
||||
* {
|
||||
* "code": 200,
|
||||
* "success": true,
|
||||
* "msg": "操作成功",
|
||||
* "data": [
|
||||
* {
|
||||
* "athleteId": 1,
|
||||
* "name": "张三",
|
||||
* "number": "123-4567898275",
|
||||
* "team": "少林寺武术大学院",
|
||||
* "projectName": "女子组长拳",
|
||||
* "orderNum": 1,
|
||||
* "competitionStatus": 0
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
*
|
||||
* 响应(裁判长 - 已有评分选手):
|
||||
* {
|
||||
* "code": 200,
|
||||
* "success": true,
|
||||
* "msg": "操作成功",
|
||||
* "data": [
|
||||
* {
|
||||
* "athleteId": 1,
|
||||
* "name": "张三",
|
||||
* "number": "123-4567898275",
|
||||
* "team": "少林寺武术大学院",
|
||||
* "projectName": "女子组长拳",
|
||||
* "orderNum": 1,
|
||||
* "totalScore": 8.907,
|
||||
* "scoredJudgeCount": 3,
|
||||
* "competitionStatus": 2
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
*/
|
||||
|
||||
213
index.html
213
index.html
@@ -3,32 +3,229 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<!-- 关键:使用最严格的 viewport 设置 -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<title>武术评分系统</title>
|
||||
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
|
||||
<style>
|
||||
* {
|
||||
touch-action: manipulation;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
/* 允许垂直滚动,但禁用其他触摸动作 */
|
||||
touch-action: pan-y !important;
|
||||
-webkit-touch-callout: none !important;
|
||||
-webkit-tap-highlight-color: transparent !important;
|
||||
-webkit-user-select: none !important;
|
||||
user-select: none !important;
|
||||
}
|
||||
|
||||
/* 针对按钮元素完全禁用所有触摸动作 */
|
||||
button,
|
||||
.control-btn,
|
||||
[class*="btn"],
|
||||
[class*="control"],
|
||||
.decrease,
|
||||
.increase {
|
||||
touch-action: none !important;
|
||||
-webkit-user-select: none !important;
|
||||
user-select: none !important;
|
||||
-webkit-touch-callout: none !important;
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
|
||||
/* 允许输入框正常交互 */
|
||||
input, textarea {
|
||||
touch-action: manipulation !important;
|
||||
-webkit-user-select: text !important;
|
||||
user-select: text !important;
|
||||
}
|
||||
|
||||
/* 防止页面整体缩放 */
|
||||
html, body {
|
||||
touch-action: pan-y !important;
|
||||
-ms-touch-action: pan-y !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// 禁用 iOS Safari 双击缩放
|
||||
// UniApp H5 专用:iOS Safari 双击缩放终极解决方案
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
var lastTouchEnd = 0;
|
||||
var touchStartTime = 0;
|
||||
var touchCount = 0;
|
||||
var resetTimer = null;
|
||||
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
|
||||
console.log('iOS 检测:', isIOS);
|
||||
console.log('User Agent:', navigator.userAgent);
|
||||
|
||||
// 方案1: 全局拦截 touchstart - 最高优先级
|
||||
document.addEventListener('touchstart', function(event) {
|
||||
var now = Date.now();
|
||||
touchStartTime = now;
|
||||
|
||||
// 清除重置计时器
|
||||
if (resetTimer) {
|
||||
clearTimeout(resetTimer);
|
||||
}
|
||||
|
||||
// 检查是否是快速连续触摸
|
||||
var timeSinceLastTouch = now - lastTouchEnd;
|
||||
|
||||
if (timeSinceLastTouch < 350) {
|
||||
touchCount++;
|
||||
|
||||
// 如果是第二次或更多次快速触摸,立即阻止
|
||||
if (touchCount >= 1) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
event.stopImmediatePropagation();
|
||||
console.log('阻止快速连续触摸', touchCount, timeSinceLastTouch);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
touchCount = 0;
|
||||
}
|
||||
|
||||
// 600ms 后重置计数器
|
||||
resetTimer = setTimeout(function() {
|
||||
touchCount = 0;
|
||||
}, 600);
|
||||
|
||||
}, { passive: false, capture: true });
|
||||
|
||||
// 方案2: 全局拦截 touchend
|
||||
document.addEventListener('touchend', function(event) {
|
||||
var now = Date.now();
|
||||
if (now - lastTouchEnd <= 300) {
|
||||
var touchDuration = now - touchStartTime;
|
||||
var timeSinceLastTouch = now - lastTouchEnd;
|
||||
|
||||
// 如果触摸时间很短(<150ms)且距离上次触摸很近(<350ms),很可能是双击
|
||||
if (touchDuration < 150 && timeSinceLastTouch < 350 && timeSinceLastTouch > 0) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
event.stopImmediatePropagation();
|
||||
console.log('阻止疑似双击', touchDuration, timeSinceLastTouch);
|
||||
return false;
|
||||
}
|
||||
|
||||
lastTouchEnd = now;
|
||||
}, { passive: false });
|
||||
}, { passive: false, capture: true });
|
||||
|
||||
// 禁用双击缩放
|
||||
// 方案3: 完全禁用 dblclick 事件
|
||||
document.addEventListener('dblclick', function(event) {
|
||||
event.preventDefault();
|
||||
}, { passive: false });
|
||||
event.stopPropagation();
|
||||
event.stopImmediatePropagation();
|
||||
console.log('阻止 dblclick 事件');
|
||||
return false;
|
||||
}, { passive: false, capture: true });
|
||||
|
||||
// 方案4: 禁用手势缩放
|
||||
document.addEventListener('gesturestart', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
console.log('阻止 gesturestart');
|
||||
}, { passive: false, capture: true });
|
||||
|
||||
document.addEventListener('gesturechange', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}, { passive: false, capture: true });
|
||||
|
||||
document.addEventListener('gestureend', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}, { passive: false, capture: true });
|
||||
|
||||
// 方案5: 监听 click 事件,过滤快速连续点击
|
||||
var lastClickTime = 0;
|
||||
document.addEventListener('click', function(event) {
|
||||
var now = Date.now();
|
||||
var timeSinceLastClick = now - lastClickTime;
|
||||
|
||||
// 如果距离上次点击小于350ms,阻止
|
||||
if (timeSinceLastClick < 350 && timeSinceLastClick > 0) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
event.stopImmediatePropagation();
|
||||
console.log('阻止快速连续点击', timeSinceLastClick);
|
||||
return false;
|
||||
}
|
||||
|
||||
lastClickTime = now;
|
||||
}, { passive: false, capture: true });
|
||||
|
||||
// 方案6: 针对按钮元素的特殊处理
|
||||
function addButtonProtection() {
|
||||
var selectors = [
|
||||
'.control-btn',
|
||||
'.control-btn.decrease',
|
||||
'.control-btn.increase',
|
||||
'button',
|
||||
'[class*="btn"]'
|
||||
];
|
||||
|
||||
selectors.forEach(function(selector) {
|
||||
var elements = document.querySelectorAll(selector);
|
||||
elements.forEach(function(element) {
|
||||
// 移除所有现有的事件监听器(通过克隆节点)
|
||||
var newElement = element.cloneNode(true);
|
||||
element.parentNode.replaceChild(newElement, element);
|
||||
|
||||
// 添加新的保护性事件监听器
|
||||
['touchstart', 'touchend', 'touchmove', 'click', 'dblclick'].forEach(function(eventType) {
|
||||
newElement.addEventListener(eventType, function(e) {
|
||||
if (eventType === 'dblclick') {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
return false;
|
||||
}
|
||||
}, { passive: false, capture: true });
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// DOM 加载完成后添加按钮保护
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
setTimeout(addButtonProtection, 100);
|
||||
// 使用 MutationObserver 监听 DOM 变化
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
addButtonProtection();
|
||||
});
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
});
|
||||
} else {
|
||||
setTimeout(addButtonProtection, 100);
|
||||
}
|
||||
|
||||
// 方案7: 使用 CSS 强制禁用缩放
|
||||
var style = document.createElement('style');
|
||||
style.innerHTML = `
|
||||
* {
|
||||
touch-action: pan-y !important;
|
||||
}
|
||||
.control-btn,
|
||||
.control-btn *,
|
||||
button,
|
||||
button * {
|
||||
touch-action: none !important;
|
||||
-webkit-user-select: none !important;
|
||||
user-select: none !important;
|
||||
-webkit-touch-callout: none !important;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
|
||||
console.log('iOS Safari 双击缩放防护已启用 - UniApp H5 专用版本');
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@@ -50,7 +50,13 @@
|
||||
</view>
|
||||
|
||||
<view class="score-control">
|
||||
<view class="control-btn decrease" @touchstart.prevent="decreaseScore" @click.prevent="decreaseScore">
|
||||
<!-- 减分按钮 - 使用 catchtouchstart 阻止事件冒泡 -->
|
||||
<view
|
||||
class="control-btn decrease"
|
||||
@touchstart="onDecreaseStart"
|
||||
@touchend="onDecreaseEnd"
|
||||
@touchcancel="onTouchCancel"
|
||||
>
|
||||
<text class="btn-symbol">-</text>
|
||||
<text class="btn-value">-0.001</text>
|
||||
</view>
|
||||
@@ -60,15 +66,17 @@
|
||||
<text class="no-modify-text">可不改</text>
|
||||
</view>
|
||||
|
||||
<view class="control-btn increase" @touchstart.prevent="increaseScore" @click.prevent="increaseScore">
|
||||
<!-- 加分按钮 - 使用 catchtouchstart 阻止事件冒泡 -->
|
||||
<view
|
||||
class="control-btn increase"
|
||||
@touchstart="onIncreaseStart"
|
||||
@touchend="onIncreaseEnd"
|
||||
@touchcancel="onTouchCancel"
|
||||
>
|
||||
<text class="btn-symbol">+</text>
|
||||
<text class="btn-value">+0.001</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="modify-tip">
|
||||
裁判长修改:保留3位小数点,超过上限或下限时,按钮置灰
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 备注 -->
|
||||
@@ -114,7 +122,15 @@ export default {
|
||||
originalScore: 8.000,
|
||||
note: '',
|
||||
minScore: 5.0,
|
||||
maxScore: 10.0
|
||||
maxScore: 10.0,
|
||||
// 防止双击的状态管理
|
||||
isTouching: false,
|
||||
touchTimer: null,
|
||||
lastTouchTime: 0,
|
||||
// 长按相关
|
||||
longPressTimer: null,
|
||||
longPressInterval: null,
|
||||
isLongPressing: false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -124,7 +140,7 @@ export default {
|
||||
const globalData = app.globalData || {}
|
||||
|
||||
// 获取当前选手信息(从 score-list-multi 页面传递)
|
||||
const currentAthlete = globalData.currentAthlete || {}
|
||||
const currentAthlete = globalData.currentAthlete ||
|
||||
|
||||
// 获取裁判长ID
|
||||
this.modifierId = globalData.judgeId
|
||||
@@ -141,9 +157,151 @@ export default {
|
||||
if (currentAthlete.athleteId) {
|
||||
await this.loadScoreDetail(currentAthlete.athleteId)
|
||||
}
|
||||
|
||||
// H5 平台特殊处理:禁用双击缩放
|
||||
// #ifdef H5
|
||||
this.disableDoubleTapZoom()
|
||||
// #endif
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
// 清理定时器
|
||||
this.clearAllTimers()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// #ifdef H5
|
||||
disableDoubleTapZoom() {
|
||||
// 在 H5 环境下,添加额外的事件监听来防止双击缩放
|
||||
this.$nextTick(() => {
|
||||
const decreaseBtn = document.querySelector('.control-btn.decrease')
|
||||
const increaseBtn = document.querySelector('.control-btn.increase')
|
||||
|
||||
const preventZoom = (e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
e.stopImmediatePropagation()
|
||||
return false
|
||||
}
|
||||
|
||||
if (decreaseBtn) {
|
||||
decreaseBtn.addEventListener('touchstart', preventZoom, { passive: false, capture: true })
|
||||
decreaseBtn.addEventListener('touchend', preventZoom, { passive: false, capture: true })
|
||||
decreaseBtn.addEventListener('touchmove', preventZoom, { passive: false, capture: true })
|
||||
decreaseBtn.addEventListener('click', preventZoom, { passive: false, capture: true })
|
||||
}
|
||||
|
||||
if (increaseBtn) {
|
||||
increaseBtn.addEventListener('touchstart', preventZoom, { passive: false, capture: true })
|
||||
increaseBtn.addEventListener('touchend', preventZoom, { passive: false, capture: true })
|
||||
increaseBtn.addEventListener('touchmove', preventZoom, { passive: false, capture: true })
|
||||
increaseBtn.addEventListener('click', preventZoom, { passive: false, capture: true })
|
||||
}
|
||||
})
|
||||
},
|
||||
// #endif
|
||||
|
||||
clearAllTimers() {
|
||||
if (this.touchTimer) {
|
||||
clearTimeout(this.touchTimer)
|
||||
this.touchTimer = null
|
||||
}
|
||||
if (this.longPressTimer) {
|
||||
clearTimeout(this.longPressTimer)
|
||||
this.longPressTimer = null
|
||||
}
|
||||
if (this.longPressInterval) {
|
||||
clearInterval(this.longPressInterval)
|
||||
this.longPressInterval = null
|
||||
}
|
||||
},
|
||||
|
||||
// 减分按钮 - touchstart
|
||||
onDecreaseStart(e) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
const now = Date.now()
|
||||
|
||||
// 防止快速连续触摸(300ms内的触摸被忽略)
|
||||
if (now - this.lastTouchTime < 300) {
|
||||
return
|
||||
}
|
||||
|
||||
this.lastTouchTime = now
|
||||
this.isTouching = true
|
||||
|
||||
// 立即执行一次减分
|
||||
this.decreaseScore()
|
||||
|
||||
// 设置长按定时器(500ms后开始连续减分)
|
||||
this.longPressTimer = setTimeout(() => {
|
||||
this.isLongPressing = true
|
||||
// 每100ms执行一次减分
|
||||
this.longPressInterval = setInterval(() => {
|
||||
this.decreaseScore()
|
||||
}, 100)
|
||||
}, 500)
|
||||
},
|
||||
|
||||
// 减分按钮 - touchend
|
||||
onDecreaseEnd(e) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
this.isTouching = false
|
||||
this.isLongPressing = false
|
||||
this.clearAllTimers()
|
||||
},
|
||||
|
||||
// 加分按钮 - touchstart
|
||||
onIncreaseStart(e) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
const now = Date.now()
|
||||
|
||||
// 防止快速连续触摸(300ms内的触摸被忽略)
|
||||
if (now - this.lastTouchTime < 300) {
|
||||
return
|
||||
}
|
||||
|
||||
this.lastTouchTime = now
|
||||
this.isTouching = true
|
||||
|
||||
// 立即执行一次加分
|
||||
this.increaseScore()
|
||||
|
||||
// 设置长按定时器(500ms后开始连续加分)
|
||||
this.longPressTimer = setTimeout(() => {
|
||||
this.isLongPressing = true
|
||||
// 每100ms执行一次加分
|
||||
this.longPressInterval = setInterval(() => {
|
||||
this.increaseScore()
|
||||
}, 100)
|
||||
}, 500)
|
||||
},
|
||||
|
||||
// 加分按钮 - touchend
|
||||
onIncreaseEnd(e) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
this.isTouching = false
|
||||
this.isLongPressing = false
|
||||
this.clearAllTimers()
|
||||
},
|
||||
|
||||
// 触摸取消
|
||||
onTouchCancel(e) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
this.isTouching = false
|
||||
this.isLongPressing = false
|
||||
this.clearAllTimers()
|
||||
},
|
||||
|
||||
async loadScoreDetail(athleteId) {
|
||||
try {
|
||||
uni.showLoading({
|
||||
@@ -151,9 +309,6 @@ export default {
|
||||
mask: true
|
||||
})
|
||||
|
||||
// 🔥 关键改动:使用 dataAdapter 获取评分详情
|
||||
// Mock模式:调用 mock/score.js 的 getScoreDetail 函数
|
||||
// API模式:调用 api/score.js 的 getScoreDetail 函数(GET /api/mini/score/detail/{athleteId})
|
||||
const response = await dataAdapter.getData('getScoreDetail', {
|
||||
athleteId: athleteId
|
||||
})
|
||||
@@ -202,12 +357,26 @@ export default {
|
||||
decreaseScore() {
|
||||
if (this.currentScore > this.minScore) {
|
||||
this.currentScore = parseFloat((this.currentScore - 0.001).toFixed(3))
|
||||
|
||||
// 添加触觉反馈(仅在支持的平台)
|
||||
// #ifndef H5
|
||||
uni.vibrateShort({
|
||||
type: 'light'
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
increaseScore() {
|
||||
if (this.currentScore < this.maxScore) {
|
||||
this.currentScore = parseFloat((this.currentScore + 0.001).toFixed(3))
|
||||
|
||||
// 添加触觉反馈(仅在支持的平台)
|
||||
// #ifndef H5
|
||||
uni.vibrateShort({
|
||||
type: 'light'
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
@@ -236,14 +405,16 @@ export default {
|
||||
mask: true
|
||||
})
|
||||
|
||||
// 🔥 关键改动:使用 dataAdapter 修改评分
|
||||
// Mock模式:调用 mock/score.js 的 modifyScore 函数
|
||||
// API模式:调用 api/score.js 的 modifyScore 函数(PUT /api/mini/score/modify)
|
||||
// 获取场地ID
|
||||
const app = getApp()
|
||||
const venueId = app.globalData?.currentVenueId
|
||||
|
||||
const response = await dataAdapter.getData('modifyScore', {
|
||||
athleteId: this.athleteInfo.athleteId,
|
||||
modifierId: this.modifierId,
|
||||
modifiedScore: this.currentScore,
|
||||
note: this.note
|
||||
note: this.note,
|
||||
venueId: venueId // 添加场地ID
|
||||
})
|
||||
|
||||
uni.hideLoading()
|
||||
@@ -459,18 +630,22 @@ export default {
|
||||
}
|
||||
|
||||
.control-btn {
|
||||
touch-action: manipulation;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 12rpx;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
||||
/* 关键:禁用所有可能导致缩放的触摸行为 */
|
||||
touch-action: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.control-btn.decrease {
|
||||
@@ -484,6 +659,7 @@ export default {
|
||||
.btn-symbol {
|
||||
font-size: 48rpx;
|
||||
font-weight: 300;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.control-btn.decrease .btn-symbol {
|
||||
@@ -497,6 +673,7 @@ export default {
|
||||
.btn-value {
|
||||
font-size: 24rpx;
|
||||
margin-top: 8rpx;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.control-btn.decrease .btn-value {
|
||||
@@ -525,13 +702,6 @@ export default {
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.modify-tip {
|
||||
font-size: 24rpx;
|
||||
color: #FF4D6A;
|
||||
line-height: 1.6;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 备注 */
|
||||
.note-section {
|
||||
margin: 30rpx;
|
||||
|
||||
@@ -68,13 +68,20 @@
|
||||
<view class="player-header">
|
||||
<view class="player-name">{{ player.name }}</view>
|
||||
|
||||
<!-- 已评分:显示总分和修改按钮 -->
|
||||
<view class="action-area" v-if="player.totalScore">
|
||||
<text class="total-score">总分:{{ player.totalScore }}</text>
|
||||
<view class="chief-actions">
|
||||
<!-- <text class="chief-hint">裁判长功能:修改评分、修改按钮需等总分出来才出现</text> -->
|
||||
<button class="modify-btn" @click="goToModify(player)">修改</button>
|
||||
</view>
|
||||
<!-- 动作区域:始终显示 -->
|
||||
<view class="action-area">
|
||||
<!-- 已评分:显示总分和修改按钮 -->
|
||||
<template v-if="player.scoringComplete && player.totalScore > 0">
|
||||
<text class="total-score">总分:{{ player.totalScore }}</text>
|
||||
<view class="chief-actions">
|
||||
<button class="modify-btn" @click="goToModify(player)">修改</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 未评分:显示评分中提示 -->
|
||||
<template v-else>
|
||||
<text class="scoring-status">评分中...</text>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -217,11 +224,11 @@ export default {
|
||||
uni.hideLoading()
|
||||
|
||||
// 保存选手列表
|
||||
this.players = response.data || []
|
||||
this.players = (response.data.records || response.data) || []
|
||||
|
||||
// 计算评分统计(裁判长视图:统计有总分的选手)
|
||||
this.totalCount = this.players.length
|
||||
this.scoredCount = this.players.filter(p => p.totalScore).length
|
||||
this.scoredCount = this.players.filter(p => p.scoringComplete).length
|
||||
|
||||
// 调试信息
|
||||
if (config.debug) {
|
||||
@@ -509,6 +516,15 @@ export default {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.scoring-status {
|
||||
font-size: 26rpx;
|
||||
color: #FF9800;
|
||||
font-weight: 500;
|
||||
padding: 8rpx 20rpx;
|
||||
background-color: #FFF3E0;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.chief-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -62,18 +62,35 @@
|
||||
|
||||
<!-- 裁判长:显示总分和已评分裁判数 -->
|
||||
<view class="player-scores" v-if="refereeType === 1">
|
||||
<text class="total-score">总分:{{ player.totalScore || '未评分' }}</text>
|
||||
<text class="judge-count">已评分:{{ player.scoredJudgeCount || 0 }}人</text>
|
||||
<text class="total-score">
|
||||
总分:{{ player.scoringComplete ? player.totalScore : '评分中' }}
|
||||
</text>
|
||||
<text class="judge-count">
|
||||
已评分:{{ player.scoredJudgeCount || 0 }}/{{ player.requiredJudgeCount || 0 }}人
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<!-- 普通裁判:显示评分按钮 -->
|
||||
<button
|
||||
class="score-btn"
|
||||
v-else
|
||||
@click.stop="goToScoreDetail(player)"
|
||||
>
|
||||
评分
|
||||
</button>
|
||||
<!-- 普通裁判:根据评分状态显示不同内容 -->
|
||||
<view class="judge-action" v-else>
|
||||
<!-- 已评分:显示分数和修改按钮 -->
|
||||
<view class="scored-info" v-if="player.scored">
|
||||
<text class="my-score-text">我的评分:{{ player.myScore }}</text>
|
||||
<button
|
||||
class="score-btn modify-btn"
|
||||
@click.stop="goToScoreDetail(player)"
|
||||
>
|
||||
修改
|
||||
</button>
|
||||
</view>
|
||||
<!-- 未评分:显示评分按钮 -->
|
||||
<button
|
||||
class="score-btn"
|
||||
v-else
|
||||
@click.stop="goToScoreDetail(player)"
|
||||
>
|
||||
评分
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="player-info">
|
||||
@@ -634,6 +651,29 @@ export default {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.judge-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.scored-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.my-score-text {
|
||||
font-size: 28rpx;
|
||||
color: #1B7C5E;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.modify-btn {
|
||||
background: linear-gradient(135deg, #FF9500 0%, #FFB340 100%);
|
||||
padding: 10rpx 30rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.player-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in New Issue
Block a user