Commit 961a5932 by wufan

feat:完成考试详情页联调

parent 735a13ce
@font-face { @font-face {
font-family: 'iconfont'; /* Project id 2223403 */ font-family: 'iconfont'; /* Project id 2223403 */
src: url('//at.alicdn.com/t/font_2223403_obblua8v3q.woff2?t=1628151518578') format('woff2'), src: url('//at.alicdn.com/t/font_2223403_2digpsfgq8l.woff2?t=1628853864698') format('woff2'),
url('//at.alicdn.com/t/font_2223403_obblua8v3q.woff?t=1628151518578') format('woff'), url('//at.alicdn.com/t/font_2223403_2digpsfgq8l.woff?t=1628853864698') format('woff'),
url('//at.alicdn.com/t/font_2223403_obblua8v3q.ttf?t=1628151518578') format('truetype'); url('//at.alicdn.com/t/font_2223403_2digpsfgq8l.ttf?t=1628853864698') format('truetype');
} }
.iconfont { .iconfont {
font-family: 'iconfont' !important; font-family: 'iconfont' !important;
......
<!-- <!--
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-24 12:20:57 * @Date: 2020-08-24 12:20:57
* @LastEditors: Please set LastEditors * @LastEditors: wufan
* @LastEditTime: 2021-05-26 16:26:17 * @LastEditTime: 2021-08-13 19:25:12
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
--> -->
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_2223403_oqqm4z9s35j.css"> <link rel="stylesheet" href="//at.alicdn.com/t/font_2223403_2digpsfgq8l.css">
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
......
<!-- <!--
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-24 12:20:57 * @Date: 2020-08-24 12:20:57
* @LastEditors: yuananting * @LastEditors: wufan
* @LastEditTime: 2021-08-11 15:06:32 * @LastEditTime: 2021-08-13 19:25:18
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
--> -->
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_2223403_obblua8v3q.css" /> <link rel="stylesheet" href="//at.alicdn.com/t/font_2223403_2digpsfgq8l.css" />
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-08-05 10:55:49 * @Date: 2021-08-05 10:55:49
* @LastEditors: yuananting * @LastEditors: wufan
* @LastEditTime: 2021-08-12 19:23:56 * @LastEditTime: 2021-08-13 17:10:58
* @Description: 个人学习详情 * @Description: 个人学习详情
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -69,7 +69,7 @@ function UserLearningData(props) { ...@@ -69,7 +69,7 @@ function UserLearningData(props) {
{tabList.map((item) => { {tabList.map((item) => {
return ( return (
<TabPane tab={item.name} key={item.key}> <TabPane tab={item.name} key={item.key}>
{<item.compoment detail={detail} />} {<item.compoment detail={detail} taskId={taskId}/>}
</TabPane> </TabPane>
); );
})} })}
......
...@@ -31,15 +31,9 @@ function LeftStageList(props) { ...@@ -31,15 +31,9 @@ function LeftStageList(props) {
> >
<div className="icon"> <div className="icon">
{item.isShowMoreCourse ? ( {item.isShowMoreCourse ? (
<img <span className="icon iconfont edit-icon">&#xe6b2;</span>
src="https://image.xiaomaiketang.com/xm/YtihN8T7sT.png"
alt=""
/>
) : ( ) : (
<img <span className="icon iconfont edit-icon">&#xe600;</span>
src="https://image.xiaomaiketang.com/xm/RmG5tbhmep.png"
alt=""
/>
)} )}
</div> </div>
<div className="stage-name"> <div className="stage-name">
...@@ -48,7 +42,7 @@ function LeftStageList(props) { ...@@ -48,7 +42,7 @@ function LeftStageList(props) {
</div> </div>
{!item.isShowMoreCourse && ( {!item.isShowMoreCourse && (
<div className="exam-list"> <div className="exam-list">
{item.courseVOList.map((examItem, examIdndex) => { {item.contentVOList && item.contentVOList.map((examItem, examIdndex) => {
return ( return (
<div <div
key={examIdndex} key={examIdndex}
......
...@@ -12,9 +12,12 @@ ...@@ -12,9 +12,12 @@
line-height: 44px; line-height: 44px;
margin-right: 8px; margin-right: 8px;
cursor: pointer; cursor: pointer;
img { .iconfont {
width: 24px; line-height: 15px;
height: 24px; font-size: 10px;
margin: 0 8px;
display: inline-block;
color: #666;
} }
&.active { &.active {
background: rgba(41, 102, 255, 0.06); background: rgba(41, 102, 255, 0.06);
......
...@@ -5,44 +5,37 @@ import TestDetailPage from "@/modules/teach-tool/examination-manager/TestDetailP ...@@ -5,44 +5,37 @@ import TestDetailPage from "@/modules/teach-tool/examination-manager/TestDetailP
import { Route, withRouter } from "react-router-dom"; import { Route, withRouter } from "react-router-dom";
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import LottieIcon from "@/components/LottieIcon"; import LottieIcon from "@/components/LottieIcon";
import User from '@/common/js/user';
function TestLinkTaskData(props) { function TestLinkTaskData(props) {
const [stageExamList, setStageExamList] = useState([]); const [stageExamList, setStageExamList] = useState([]);
const [activeExam, setActiveExam] = useState({}); const [activeExam, setActiveExam] = useState({});
const [activeStage, setActiveStage] = useState({}); const [activeStage, setActiveStage] = useState({});
const [isShow, setIsShow] = useState(true); const [isShow, setIsShow] = useState(true);
const {taskId, detail: {storeCustomerId}} = props;
useEffect(() => { useEffect(() => {
getTrainingTaskDetail(); getTrainingTaskDetail();
}, []); }, []);
function getTrainingTaskDetail() { function getTrainingTaskDetail() {
Service.Hades("public/hades/getTaskCustomerDetail", { Service.Hades("public/hades/getTaskCustomerDetail", {
taskId: "1412706381214687233", taskId: taskId,
storeId: "1192022572770412395", storeId: User.getStoreId(),
storeCustomerId: "1384073988114677761", storeCustomerId: storeCustomerId,
// todolist 数据写死调接口
// taskId: props.match.params.taskId.replace(/\?.+/, ""),
// storeId: User.getStoreId(),
// storeCustomerId: User.getCustomerId(),
}).then((res) => { }).then((res) => {
const data = { ...res.result }; const data = { ...res.result };
const { stageCustomerVOList = [] } = data; const { stageExamCustomerVOList = [] } = data;
if (!!stageCustomerVOList.length) { if (!!stageExamCustomerVOList.length) {
setStageExamList(stageCustomerVOList); setStageExamList(stageExamCustomerVOList);
setActiveStage(stageCustomerVOList[0]); setActiveStage(stageExamCustomerVOList[0]);
setActiveExam(stageCustomerVOList[0].courseVOList[0]); setActiveExam(stageExamCustomerVOList[0].contentVOList[0]);
const { contentId, paperId } = stageCustomerVOList[0].courseVOList[0]; const { contentId, paperId } = stageExamCustomerVOList[0].contentVOList[0];
const { match } = props; const { match } = props;
const path = `${match.url}/test-detail/1424698828831531009?paperId=1408034318353940481&userId=1351455073595023362&fromTrainingTask=true`; const path = `${match.url}/test-detail/${contentId}?paperId=${paperId}1&userId=${storeCustomerId}&fromTrainingTask=true`;
window.RCHistory.replace(path); window.RCHistory.replace(path);
} }
// const { stageExamCustomerVOList = [] } = data;
// if (stageExamCustomerVOList.length) {
// setStageExamList(stageExamCustomerVOList);
// setActiveStage(stageExamCustomerVOList[0]);
// setActiveExam(stageExamCustomerVOList[0].courseVOList[0]);
// }
}); });
} }
...@@ -52,13 +45,10 @@ function TestLinkTaskData(props) { ...@@ -52,13 +45,10 @@ function TestLinkTaskData(props) {
setActiveStage(_activeStage); setActiveStage(_activeStage);
const { contentId, paperId } = _activeExam; const { contentId, paperId } = _activeExam;
const { match } = props; const { match } = props;
const path = `${match.url}/test-detail/1424698828831531009?paperId=1408034318353940481&userId=1351455073595023362&fromTrainingTask=true`; const path = `${
match.url
}/test-detail/${contentId}?paperId=${paperId}&userId=${111}`;
window.RCHistory.replace(path); window.RCHistory.replace(path);
// window.RCHistory.push({
// pathname: `${
// props.match.url
// }/test-detail/${contentId}?paperId=${paperId}&userId=${111}`,
// });
} }
function toggleShowBar(diretion) { function toggleShowBar(diretion) {
...@@ -97,10 +87,19 @@ function TestLinkTaskData(props) { ...@@ -97,10 +87,19 @@ function TestLinkTaskData(props) {
/> />
</div> </div>
<div className={`right-exam-data-box ${!isShow ? 'hidden':''}`}> <div className={`right-exam-data-box ${!isShow ? 'hidden':''}`}>
{/* 未考过的考试显示暂无考试数据,否则请求接口会报错 */}
{
activeExam.learnFinishPercentage === 0 ?
<LottieIcon
title={<span className="desc">暂无考试数据</span>}
type="college"
size={150}
/> :
<Route <Route
path={`${props.match.url}/test-detail/:testId`} path={`${props.match.url}/test-detail/:testId`}
component={TestDetailPage} component={TestDetailPage}
/> />
}
</div> </div>
</div> </div>
) : ( ) : (
......
...@@ -100,6 +100,14 @@ ...@@ -100,6 +100,14 @@
overflow-y: auto; overflow-y: auto;
margin-top: -16px; margin-top: -16px;
overflow-x: hidden; overflow-x: hidden;
@media screen and (max-width: 1400px) {
.lottie-icon {
text-align: center;
margin-top: 153px;
margin-bottom: 50px;
}
}
&.hidden { &.hidden {
width: calc(100vw - 200px); width: calc(100vw - 200px);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment