add visti_time and finish_time

issues25489
tjsglion 5 years ago
parent 1c6399c01f
commit 39ac4ceb4a

@ -26,6 +26,7 @@ import './leftView.css'
import CodeEvaluateMultiLevelAnswerUnlock from './CodeEvaluateMultiLevelAnswerUnlock' import CodeEvaluateMultiLevelAnswerUnlock from './CodeEvaluateMultiLevelAnswerUnlock'
import MUIDialogStyleUtil from '../component/MUIDialogStyleUtil' import MUIDialogStyleUtil from '../component/MUIDialogStyleUtil'
import moment from 'moment';
// http://danilowoz.com/create-react-content-loader/ // http://danilowoz.com/create-react-content-loader/
const MyLoader = () => ( const MyLoader = () => (
<ContentLoader <ContentLoader
@ -283,7 +284,9 @@ class LeftView extends Component {
} }
.multiLevelAnswer .status{ .multiLevelAnswer .status{
color: #CDCDCD; color: #CDCDCD;
flex: 0 0 45px; }
.multiLevelAnswer .lock-time{
margin-right: 15px;
} }
.markdown-body ol, .markdown-body ul { .markdown-body ol, .markdown-body ul {
padding-left: 2.5em; padding-left: 2.5em;
@ -292,13 +295,17 @@ class LeftView extends Component {
<div className="multiLevelAnswer"> <div className="multiLevelAnswer">
{ unlockedAnswers && unlockedAnswers.map((item, index) => { { unlockedAnswers && unlockedAnswers.map((item, index) => {
const {name, contents, view_time} = item;
return <div className="anwserSection"> return <div className="anwserSection">
<div className="df"> <div className="df">
<div className="level">级别{index + 1}</div> <div className="level">级别{index + 1}</div>
<div className="name">{item.name}</div> <div className="name">{name}</div>
<div className="status">已解锁</div> <div className="status">
<span className="lock-time">{view_time ? moment(view_time).format('YYYY-MM-DD HH:mm') : ''}</span>
已解锁
</div>
</div> </div>
<div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}> <div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(contents)}}>
</div> </div>
</div> </div>
})} })}

@ -89,4 +89,35 @@
.rateRow .rc-rate-star-half .rc-rate-star-first, .rateRow .rc-rate-star-full .rc-rate-star-second { .rateRow .rc-rate-star-half .rc-rate-star-first, .rateRow .rc-rate-star-full .rc-rate-star-second {
color: #FFA800; color: #FFA800;
} }
.tip-info-wrap{
background-color: #111C24;
padding: 20px 0px;
}
.tip-info-wrap .tip-info{
display: flex;
background: #707070;
border: 1px solid rgba(112,112,112,1);
border-radius: 100px;
width: 375px;
height: 52px;
font-size: 12px;
align-items: center;
align-items: space-around;
margin: 0 auto;
padding: 0 20px;
}
.finish-wrap{
display: flex;
padding: 0 0px 0 20px;
margin-top: 10px;
}
.finish-wrap .finish-time{
flex: 1;
}
.finish-time .time-title{
color: #747A7F;
margin-right: 5px;
}
/*------------------------------- TaskList End */ /*------------------------------- TaskList End */

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import moment from 'moment';
import Rate from 'rc-rate'; import Rate from 'rc-rate';
import 'rc-rate/assets/index.css'; import 'rc-rate/assets/index.css';
@ -21,7 +21,7 @@ class TaskList extends Component {
challenge.experience = challenge.get_experience challenge.experience = challenge.get_experience
challenge.gold = challenge.get_gold challenge.gold = challenge.get_gold
challenge.subject = challenge.name challenge.subject = challenge.name
const {finished_time, view_answer_time} = challenge;
const showExp = (challenge.experience > 0 && challenge.status === 2) ? '+' + challenge.experience : challenge.experience const showExp = (challenge.experience > 0 && challenge.status === 2) ? '+' + challenge.experience : challenge.experience
const showGold = (challenge.gold > 0 && challenge.status === 2) ? '+' + challenge.gold : challenge.gold const showGold = (challenge.gold > 0 && challenge.status === 2) ? '+' + challenge.gold : challenge.gold
return ( return (
@ -70,6 +70,15 @@ class TaskList extends Component {
</span> </span>
</div> </div>
<div className="finish-wrap">
<p class="finish-time font-12">
<span class="time-title">完成时间</span>
{ finished_time ? moment(finished_time).format('YYYY-MM-DD HH:mm') : '--' }
</p>
<p class="finish-time font-12">
<span class="time-title">查看答案时间</span>
{ view_answer_time ? moment(view_answer_time).format('YYYY-MM-DD HH:mm') : '--' } </p>
</div>
{ shixun.status >= 2 && <div className="rateRow"> { shixun.status >= 2 && <div className="rateRow">
{/* 已完成、未评分 */} {/* 已完成、未评分 */}
{challenge.status === 2 && challenge.star === 0? {challenge.status === 2 && challenge.star === 0?
@ -103,8 +112,15 @@ class TaskList extends Component {
render() { render() {
const { taskListLoading } = this.props; const { taskListLoading } = this.props;
return ( return (
<div className="page--over"> <div className="page--over" style={{ width: '420px'}}>
<div className="col-width-3 -scroll" style={{height: '100%'}} id="all_task_index"> {/** 增加提示信息 */}
<div className="tip-info-wrap">
<p className="tip-info">
<span><span style={{ color: '#FFBD4C'}}>温馨提示: </span> </span>
</p>
</div>
<div className="col-width-3 -scroll" style={{height: 'calc( 100% - 100px )', width: '420px'}} id="all_task_index">
{ taskListLoading ? { taskListLoading ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> : <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
this.renderTasks() this.renderTasks()

Loading…
Cancel
Save