|
|
@ -1,174 +1,177 @@
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
|
|
|
|
|
|
|
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
|
|
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
|
|
|
|
// import { Rating,Loading} from '@icedesign/base';
|
|
|
|
// import { Rating,Loading} from '@icedesign/base';
|
|
|
|
|
|
|
|
|
|
|
|
import {getImageUrl,setImagesUrl, toPath} from 'educoder';
|
|
|
|
import {getImageUrl,setImagesUrl, toPath} from 'educoder';
|
|
|
|
|
|
|
|
|
|
|
|
// import { Pagination,Row,Col } from 'antd';
|
|
|
|
// import { Pagination,Row,Col } from 'antd';
|
|
|
|
|
|
|
|
|
|
|
|
import 'antd/lib/pagination/style/index.css';
|
|
|
|
import 'antd/lib/pagination/style/index.css';
|
|
|
|
|
|
|
|
|
|
|
|
import './shixunCss/shixunCard.css';
|
|
|
|
import './shixunCss/shixunCard.css';
|
|
|
|
|
|
|
|
|
|
|
|
import Rating from '@icedesign/base/lib/rating';
|
|
|
|
import Rating from '@icedesign/base/lib/rating';
|
|
|
|
|
|
|
|
|
|
|
|
import Pagination from '@icedesign/base/lib/pagination';
|
|
|
|
import Pagination from '@icedesign/base/lib/pagination';
|
|
|
|
|
|
|
|
|
|
|
|
// import Loading from '@icedesign/base/lib/loading';
|
|
|
|
// import Loading from '@icedesign/base/lib/loading';
|
|
|
|
|
|
|
|
|
|
|
|
// 引入业务组件样式
|
|
|
|
// 引入业务组件样式
|
|
|
|
import '@icedesign/base/lib/pagination/style.js';
|
|
|
|
import '@icedesign/base/lib/pagination/style.js';
|
|
|
|
|
|
|
|
|
|
|
|
import '@icedesign/base/lib/rating/style.js';
|
|
|
|
import '@icedesign/base/lib/rating/style.js';
|
|
|
|
|
|
|
|
|
|
|
|
import { Tooltip } from 'antd';
|
|
|
|
import { Tooltip } from 'antd';
|
|
|
|
|
|
|
|
|
|
|
|
// import '@icedesign/base/lib/loading/style.js';
|
|
|
|
// import '@icedesign/base/lib/loading/style.js';
|
|
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
const $ = window.$;
|
|
|
|
const $ = window.$;
|
|
|
|
|
|
|
|
|
|
|
|
class ShixunCard extends Component {
|
|
|
|
class ShixunCard extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
super(props)
|
|
|
|
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
startValue:[],
|
|
|
|
startValue:[],
|
|
|
|
order_by:"",
|
|
|
|
order_by:"",
|
|
|
|
page:1,
|
|
|
|
page:1,
|
|
|
|
limit:16,
|
|
|
|
limit:16,
|
|
|
|
keyword:"",
|
|
|
|
keyword:"",
|
|
|
|
status:0,
|
|
|
|
status:0,
|
|
|
|
diff:0,
|
|
|
|
diff:0,
|
|
|
|
hideme:false,
|
|
|
|
hideme:false,
|
|
|
|
tag_level:3,
|
|
|
|
tag_level:3,
|
|
|
|
tag_id:''
|
|
|
|
tag_id:''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PaginationonChange=(pageNumber)=> {
|
|
|
|
PaginationonChange=(pageNumber)=> {
|
|
|
|
this.props.shixunsPage(pageNumber);
|
|
|
|
this.props.shixunsPage(pageNumber);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props;
|
|
|
|
let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="educontent mb80">
|
|
|
|
<div className="educontent mb80">
|
|
|
|
{/*<Loading visible={typepvisible} shape="dot-circle" color='#4AC7FF'>*/}
|
|
|
|
{/*<Loading visible={typepvisible} shape="dot-circle" color='#4AC7FF'>*/}
|
|
|
|
|
|
|
|
|
|
|
|
<div id="shixun_list_content"
|
|
|
|
<div id="shixun_list_content"
|
|
|
|
style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "block" : "none"}}>
|
|
|
|
style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "block" : "none"}}>
|
|
|
|
<div className="square-list clearfix">
|
|
|
|
<div className="square-list clearfix">
|
|
|
|
<div className="edu-tab-con-box clearfix edu-txt-center">
|
|
|
|
<div className="edu-tab-con-box clearfix edu-txt-center">
|
|
|
|
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
|
|
|
|
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
|
|
|
|
<p className="edu-nodata-p mb20">暂无数据哦~</p>
|
|
|
|
<p className="edu-nodata-p mb20">暂无数据哦~</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="educontent edu-txt-center mb80">
|
|
|
|
<div className="educontent edu-txt-center mb80">
|
|
|
|
<div className="inline pages_user_show">
|
|
|
|
<div className="inline pages_user_show">
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
<div className="cl"></div>
|
|
|
|
<div className="cl"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="mt10 mb20 clearfix"
|
|
|
|
<div className="mt10 mb20 clearfix"
|
|
|
|
style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "none" : "block"}}>
|
|
|
|
style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "none" : "block"}}>
|
|
|
|
<div className="shixun_list_content">
|
|
|
|
<div className="shixun_list_content">
|
|
|
|
<div className="square-list clearfix">
|
|
|
|
<div className="square-list clearfix">
|
|
|
|
{ middleshixundata===undefined?" ":middleshixundata.map((item,key)=>{
|
|
|
|
{ middleshixundata===undefined?" ":middleshixundata.map((item,key)=>{
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<div className="square-Item" key={key} id={item.id}>
|
|
|
|
<div className="square-Item" key={key} id={item.id}>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
item.tag_name === null ? "":
|
|
|
|
item.tag_name === null ? "":
|
|
|
|
<div className="tag-green">
|
|
|
|
<div className="tag-green">
|
|
|
|
<span className="tag-name"> {item.tag_name}</span>
|
|
|
|
<span className="tag-name"> {item.tag_name}</span>
|
|
|
|
<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>
|
|
|
|
<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<div className={item.power === false ? "closeSquare" : "none"}>
|
|
|
|
<div className={item.power === false ? "closeSquare" : "none"}>
|
|
|
|
<img src={getImageUrl("images/educoder/icon/lockclose.svg")}
|
|
|
|
<img src={getImageUrl("images/educoder/icon/lockclose.svg")}
|
|
|
|
className="mt80 mb25"/>
|
|
|
|
className="mt80 mb25"/>
|
|
|
|
<p className="font-14 color-white">非试用内容,需要授权</p>
|
|
|
|
<p className="font-14 color-white">非试用内容,需要授权</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="square-img">
|
|
|
|
<a href={"/shixuns/"+item.identifier+"/challenges"} className="square-img">
|
|
|
|
{/*<img src={getImageUrl("images/"+item.pic+"?1540534846")}/>*/}
|
|
|
|
{/*<img src={getImageUrl("images/"+item.pic+"?1540534846")}/>*/}
|
|
|
|
<img src={setImagesUrl(`${item.pic}`)}/>
|
|
|
|
<img src={setImagesUrl(`${item.pic}`)}/>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
{/*target="_blank"*/}
|
|
|
|
<div className="square-main">
|
|
|
|
|
|
|
|
<p className="task-hide">
|
|
|
|
<div className="square-main">
|
|
|
|
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="justify color-grey-name" title={item.name}>
|
|
|
|
<p className="task-hide">
|
|
|
|
{item.name}
|
|
|
|
<a href={"/shixuns/"+item.identifier+"/challenges"} className="justify color-grey-name" title={item.name}>
|
|
|
|
</a>
|
|
|
|
{item.name}
|
|
|
|
</p>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
<p className="clearfix mt8 ml-3">
|
|
|
|
|
|
|
|
<span className="rateYoStar fl" style={{padding: '0px',height: '20px',lineHeight: '19px',cursor: 'default'}} title="">
|
|
|
|
{/*target="_blank"*/}
|
|
|
|
<Rating key={key} value={item.score_info===null?5:item.score_info} disabled allowHalf />
|
|
|
|
|
|
|
|
</span>
|
|
|
|
<p className="clearfix mt8 ml-3">
|
|
|
|
<span className="fl ml25 font-12 color-grey-9 lineh-12 mt4">{item.score_info===null?"5分":item.score_info+"分"}</span>
|
|
|
|
<span className="rateYoStar fl" style={{padding: '0px',height: '20px',lineHeight: '19px',cursor: 'default'}} title="">
|
|
|
|
</p>
|
|
|
|
<Rating key={key} value={item.score_info===null?5:item.score_info} disabled allowHalf />
|
|
|
|
|
|
|
|
</span>
|
|
|
|
<p className="clearfix mt8 font-12 color-grey-B4">
|
|
|
|
<span className="fl ml25 font-12 color-grey-9 lineh-12 mt4">{item.score_info===null?"5分":item.score_info+"分"}</span>
|
|
|
|
<Tooltip placement="bottom" title={"关卡"}>
|
|
|
|
</p>
|
|
|
|
<span className="mr10 fl squareIconSpan">
|
|
|
|
|
|
|
|
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
|
|
|
|
<p className="clearfix mt8 font-12 color-grey-B4">
|
|
|
|
</span>
|
|
|
|
<Tooltip placement="bottom" title={"关卡"}>
|
|
|
|
</Tooltip>
|
|
|
|
<span className="mr10 fl squareIconSpan">
|
|
|
|
|
|
|
|
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
|
|
|
|
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
|
|
|
|
</span>
|
|
|
|
{/*<span className="mr10 fl squareIconSpan">*/}
|
|
|
|
</Tooltip>
|
|
|
|
{/*<i className="iconfont icon-jingyan fl mr3"></i>{item.exp}*/}
|
|
|
|
|
|
|
|
{/*</span>*/}
|
|
|
|
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
|
|
|
|
{/*</Tooltip>*/}
|
|
|
|
{/*<span className="mr10 fl squareIconSpan">*/}
|
|
|
|
|
|
|
|
{/*<i className="iconfont icon-jingyan fl mr3"></i>{item.exp}*/}
|
|
|
|
<Tooltip placement="bottom" title={"学习人数"}>
|
|
|
|
{/*</span>*/}
|
|
|
|
<span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":"block"}}>
|
|
|
|
{/*</Tooltip>*/}
|
|
|
|
<i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
<Tooltip placement="bottom" title={"学习人数"}>
|
|
|
|
</Tooltip>
|
|
|
|
<span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":"block"}}>
|
|
|
|
|
|
|
|
<i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num}
|
|
|
|
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
</Tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
|
|
|
|
</div>
|
|
|
|
</p>
|
|
|
|
)
|
|
|
|
|
|
|
|
})
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)
|
|
|
|
</div>
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
<div className="both"></div>
|
|
|
|
|
|
|
|
{/*totalcount*/}
|
|
|
|
</div>
|
|
|
|
<div className={"ml425"}
|
|
|
|
|
|
|
|
//className={totalcount < 22 ? "ml425" : "ml425"}
|
|
|
|
<div className="both"></div>
|
|
|
|
style={{display: pagination ? "block" : "none"}}>
|
|
|
|
{/*totalcount*/}
|
|
|
|
{/*<Pagination showQuickJumper defaultCurrent={1} current={pages} total={totalcount} pageSize={12} onChange={this.PaginationonChange} />*/}
|
|
|
|
<div className={"ml425"}
|
|
|
|
{/* 不加参数请求的时候,没返回总数了。加了个比较大的数字,让他可以翻页 */}
|
|
|
|
//className={totalcount < 22 ? "ml425" : "ml425"}
|
|
|
|
<Pagination defaultCurrent={1} current={pages} total={ totalcount || 1299 } type="mini" pageSize={16} onChange={this.PaginationonChange} />
|
|
|
|
style={{display: pagination ? "block" : "none"}}>
|
|
|
|
</div>
|
|
|
|
{/*<Pagination showQuickJumper defaultCurrent={1} current={pages} total={totalcount} pageSize={12} onChange={this.PaginationonChange} />*/}
|
|
|
|
|
|
|
|
{/* 不加参数请求的时候,没返回总数了。加了个比较大的数字,让他可以翻页 */}
|
|
|
|
</div>
|
|
|
|
<Pagination defaultCurrent={1} current={pages} total={ totalcount || 1299 } type="mini" pageSize={16} onChange={this.PaginationonChange} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{/*</Loading>*/}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
{/*</Loading>*/}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)
|
|
|
|
export default ShixunCard;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default ShixunCard;
|
|
|
|