diff --git a/src/pages/competition/result.vue b/src/pages/competition/result.vue
index 641cb5fb..21f2d3c7 100644
--- a/src/pages/competition/result.vue
+++ b/src/pages/competition/result.vue
@@ -8,20 +8,20 @@
-
+
-
+
-
+
-
+
-
+
@@ -31,7 +31,7 @@
-
+
@@ -44,20 +44,20 @@
{{ pkData.correctNub }}
/{{ pkData.qnsNub }}
- {{resultStr}}
+ {{ resultStr }}
总分
{{ pkData.totalScore }}
- {{resultStr}}
+ {{ resultStr }}
用时
{{ formatSecondsToMS(pkData.timeTaken) }}
- {{resultStr}}
+ {{ resultStr }}
-
+
@@ -69,17 +69,17 @@
{{ pkData.correctNubPk }}
/{{ pkData.qnsNubPk }}
- {{resultStr}}
+ {{ resultStr }}
总分
{{ pkData.totalScorePk }}
- {{resultStr}}
+ {{ resultStr }}
用时
{{ formatSecondsToMS(pkData.timeTakenPk) }}
- {{resultStr}}
+ {{ resultStr }}
@@ -116,8 +116,9 @@
import points from '@/components/points-and-badge/points';
import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge';
const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge();
- const resultStr = computed(() => mode.value === 'pk_result'?"加载中":"结算中")
+ const resultStr = computed(() => (mode.value === 'pk_result' ? '加载中' : '结算中'));
const action = ref('');
+ const myAction = ref('');
const mode = ref(''); // 模式 PK中 pk_in, Pk列表查询 pk_result
const autoSub = ref('00'); // 是否是自动提交 00 不是 01是
const pkData = reactive({
@@ -164,36 +165,36 @@
mode.value = e.mode || 'pk_result';
autoSub.value = e.autoSub || '00';
const pkDataInit = common.getPageCache('competition_pk_to_resulf');
- const userInfo = getUserInfo();
- console.log('userInfo', userInfo);
+ // const userInfo = getUserInfo();
+ // console.log('userInfo', userInfo);
console.log('pkDataInit', pkDataInit);
Object.assign(pkData, {
userName: pkDataInit.userName ?? '',
isAnony: pkDataInit.isAnony ?? '',
pkIsAnony: pkDataInit.pkIsAnony ?? '',
- userNamePk: pkDataInit.pkUserName ?? ''
+ userNamePk: pkDataInit.pkUserName ?? '',
+ imgPk: pkDataInit.pkImgAddr ?? ''
});
});
onMounted(() => {
action.value = 'loading';
+ myAction.value = 'loading';
- setTimeout(() => {
- queryCompetitionAnswerResult({ execId: pkData.execId, autoSub:autoSub.value }).then(({ body }) => {
- if (mode.value === 'pk_in') {
- console.log('调用它');
- pointAndBadgesRun('11');
- }
- // 计算需要额外延时的时间
- const currentTime = Math.floor(Date.now() / 1000);
- // 2. 计算对手的答题结束时间(秒)
- const opponentEndTime = body.endTime + body.timeDifference;
- // 3. 计算当前时间到对手结束时间的延迟时间(秒),负数则取0
- const delayTime = Math.max(0, opponentEndTime - currentTime);
- console.log('计算需要额外延时的时间', delayTime);
- setTimeout(() => {
+ setTimeout(
+ () => {
+ queryCompetitionAnswerResult({ execId: pkData.execId, autoSub: autoSub.value }).then(({ body }) => {
+ if (mode.value === 'pk_in') {
+ console.log('调用它');
+ pointAndBadgesRun('11');
+ }
+ // 计算需要额外延时的时间
+ const currentTime = Math.floor(Date.now() / 1000);
+ // 2. 计算对手的答题结束时间(秒)
+ const opponentEndTime = body.endTime + body.timeDifference;
+ // 3. 计算当前时间到对手结束时间的延迟时间(秒),负数则取0
+ const delayTime = Math.max(0, opponentEndTime - currentTime);
+ console.log('计算需要额外延时的时间', delayTime);
const userResult = body.userResult;
- pkData.answerResult = body.answerResult; // 答题结果 Y代表我赢,N代表我输
- pkData.timeDifference = body.timeDifference; // 时差 int 单位 s
Object.assign(pkData, {
// 自己的
isAnony: userResult.isAnony, // 匿名 String
@@ -206,18 +207,38 @@
userIdPk: userResult.userIdPk, // 用户Id String
userNamePk: userResult.userNamePk, // 用户姓名 String
imgPk: userResult.imgPk, // 用户姓名 String
- pkIsAnony: userResult.isAnonyPk, // 匿名 String
- correctNubPk: userResult.correctNubPk, // 正确数 int
- qnsNubPk: userResult.qnsNubPk || 0, // 总数 int
- timeTakenPk: userResult.timeTakenPk || 0, // 用时 int
- totalScorePk: userResult.totalScorePk || 0 // 对方总分
+ pkIsAnony: userResult.isAnonyPk // 匿名 String
});
- nextTick(() => {
- action.value = 'result';
- });
- }, delayTime * 1000);
- });
- }, mode.value === 'pk_result'?0:1000);
+ myAction.value = 'result';
+ setTimeout(() => {
+ pkData.answerResult = body.answerResult; // 答题结果 Y代表我赢,N代表我输
+ pkData.timeDifference = body.timeDifference; // 时差 int 单位 s
+ Object.assign(pkData, {
+ // 自己的
+ // isAnony: userResult.isAnony, // 匿名 String
+ // userName: userResult.userName, // 匿名 String
+ // correctNub: userResult.correctNub, // 正确数 int
+ // qnsNub: userResult.qnsNub, // 总数 int
+ // timeTaken: userResult.timeTaken, // 用时 int
+ // totalScore: userResult.totalScore || 0, // 我方总分
+ // 对方的
+ // userIdPk: userResult.userIdPk, // 用户Id String
+ // userNamePk: userResult.userNamePk, // 用户姓名 String
+ // imgPk: userResult.imgPk, // 用户姓名 String
+ // pkIsAnony: userResult.isAnonyPk, // 匿名 String
+ correctNubPk: userResult.correctNubPk, // 正确数 int
+ qnsNubPk: userResult.qnsNubPk || 0, // 总数 int
+ timeTakenPk: userResult.timeTakenPk || 0, // 用时 int
+ totalScorePk: userResult.totalScorePk || 0 // 对方总分
+ });
+ nextTick(() => {
+ action.value = 'result';
+ });
+ }, delayTime * 1000);
+ });
+ },
+ mode.value === 'pk_result' ? 0 : 1000
+ );
});
@@ -387,12 +408,12 @@
display: none;
}
// loading 状态样式(保持不变)
- &.loading {
- .mascot-div {
+ .loading {
+ &.mascot-div {
left: 50%;
transform: translateX(-50%);
}
- .mascot-msg-div {
+ &.mascot-msg-div {
opacity: 1;
pointer-events: auto;
}
@@ -434,14 +455,14 @@
}
// 当 action=result 时,触发结果动画
- &.result {
+ .result {
// 胜利状态:入场 + 浮动 + 闪光
- .result-container-div.victory {
+ &.result-container-div.victory {
animation: victoryEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards,
victoryFloat 2s ease-in-out infinite 0.8s;
}
// 失败状态:入场 + 抖动
- .result-container-div.defeat {
+ &.result-container-div.defeat {
// defeatShake 1s ease-in-out infinite 0.6s
animation: defeatEnter 0.6s ease-out forwards, defeatRotateSway 1s ease-in-out 0.6s 1; // 入场后开始晃动,2秒结束,仅1次
}