From 5b2788c596e6a4227d893f653c044ac90d8ff2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Mon, 20 Feb 2023 10:00:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=9B=9E=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/military/competition/refer/jqtz.jsx | 5 ++++ src/military/competition/refer/record.jsx | 34 +++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/military/competition/refer/jqtz.jsx b/src/military/competition/refer/jqtz.jsx index 3c84dce7d..4fd9728fc 100644 --- a/src/military/competition/refer/jqtz.jsx +++ b/src/military/competition/refer/jqtz.jsx @@ -139,6 +139,11 @@ function Introduce({ form, match, history, current_user }) { type: "play" }).then(response=>{ if(response && response.code ==="000"){ + if(response.result.error){ + message.error(response.result.error); + setSimulateUploading(false); + return + } setTimeout(() => { window.open(response.result.live_url);}) } setSimulateUploading(false); diff --git a/src/military/competition/refer/record.jsx b/src/military/competition/refer/record.jsx index 1b49413ff..9271b5aeb 100644 --- a/src/military/competition/refer/record.jsx +++ b/src/military/competition/refer/record.jsx @@ -24,6 +24,8 @@ function Introduce(props) { const [recordDetail1, setRecordDetail1] = useState(undefined); const [recordDetail2, setRecordDetail2] = useState(undefined); const [recordDetail3, setRecordDetail3] = useState(undefined); + const [simulateIndex, setSimulateIndex] = useState(undefined); + const [simulateUploading, setSimulateUploading] = useState(false); useEffect(()=>{ simulatedMatchList({ @@ -134,7 +136,7 @@ function Introduce(props) { dataIndex: 'status', key: 2, render: (text, record, index) => { - return text === 'finished' ? 已完成 : text === "running" ? 运行中 : 未完成 + return text === 'finished' ? 已完成 : text === "running" ? 运行中 : text === "failed" ? 失  败 : 未完成 } }, { @@ -142,6 +144,9 @@ function Introduce(props) { dataIndex: 'score', key: 3, align: 'center', + render: (text) => { + return text || '--' + } }, { title: '操作', @@ -151,7 +156,7 @@ function Introduce(props) { render: (text, record, index) => { return - + } }, @@ -246,13 +251,36 @@ function Introduce(props) { // 模拟回放点击函数 function analogPlayback(id){ + setSimulateIndex(id); + setSimulateUploading(true); matchReplay({ index: repoId, user_id: user_id+"", match_id: id, sign: encryptionuserId(user_id) }).then(res=>{ - console.log('res', res); + if(res && res.code === "000"){ + generateVirtualliveRoomkey({ + id: user_id+"", + match_id: id, + index: repoId, + sign: encryptionuserId(user_id), + type: "replay" + }).then(response=>{ + if(response && response.code ==="000"){ + if(response.result.error){ + message.error(response.result.error); + setSimulateUploading(false); + return + } + setTimeout(() => { window.open(response.result.live_url);}) + } + setSimulateUploading(false); + }) + }else{ + setSimulateUploading(false); + message.error(res.msg); + } }) }