调整筛选条件

issues25489
杨树林 5 years ago
parent e6b489b6ca
commit c58bfe7a86

@ -287,7 +287,7 @@ class Infos extends Component{
}
></Route>
{/* 实训课程 */}
{/* 实践课程 */}
<Route exact path="/users/:username/paths"
render={
(props) => (<InfosPath {...this.props} {...props} {...this.state} {..._commonProps}/>)
@ -317,7 +317,6 @@ class Infos extends Component{
></Route>
<Route exact path="/users/:username"
render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps}/>)

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd';
import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import axios from 'axios';
@ -20,7 +20,8 @@ class InfosCourse extends Component{
status:undefined,
page:1,
per_page:16,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined,
data:undefined,
isSpin:false
@ -31,27 +32,35 @@ class InfosCourse extends Component{
this.setState({
isSpin:true
})
let{category,status,page}=this.state;
this.getCourses(category,status,page);
let {category, status, page, sort_by, sort_direction} = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
getCourses=(category,status,page)=>{
getCourses = (category, status, page, sort_by, sort_direction) => {
let url=`/users/${this.props.match.params.username}/courses.json`;
axios.get((url),{params:{
category,
status,
page,
sort_by,
sort_direction,
per_page: this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
console.log("请求成功");
this.setState({
totalCount:result.data.count,
data:result.data,
sort_direction: sort_direction,
sort_by: sort_by,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin: false
})
})
}
@ -92,6 +101,27 @@ class InfosCourse extends Component{
}
}
updatedlist(sort_by) {
//按照什么样子排序
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, 1, sort_by, "desc");
}
updatedlists(sort_direction, i) {
// console.log("updatedlistssort_direction");
// console.log(sort_direction);
// console.log(i);
//是否是倒序
this.setState({
isSpin: true
});
let {category, status, page, sort_by} = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
render(){
let{
category,
@ -99,11 +129,25 @@ class InfosCourse extends Component{
page,
data,
totalCount,
isSpin
isSpin,
sort_by,
sort_direction
} = this.state;
let is_current=this.props.is_current;
// console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
最新动态
</Menu.Item>
<Menu.Item onClick={() => this.updatedlist("created_at")}>
最新创建
</Menu.Item>
</Menu>
);
return(
<div className="educontent">
<Spin size="large" spinning={isSpin}>
@ -120,10 +164,66 @@ class InfosCourse extends Component{
<li className={status=="end" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("end")}>已结束</a></li>
</div>
}
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<p className="pl25 pr25 clearfix font-12 " style={{
lineHeight: "41px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"课堂"}</span>
<span className="fr color-grey-9">时间最新</span>
<sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc", 1)}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc", 2)}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最新动态' : sort_by === "created_at" ? '最新创建' : ""}</span>
</span>
</Dropdown>
</p>
<style>
{
`
.square-list{width: 100%;box-sizing: border-box;margin-top:10px}
`
}
</style>
<div className="square-list clearfix">
{/* 289 */}
{

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination, Spin} from 'antd';
import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import NoneData from '../../courses/coursesPublic/NoneData'
@ -19,11 +19,11 @@ class InfosPath extends Component{
this.state={
category:undefined,
page:1,
sort_by:'time',
status:undefined,
per_page:16,
isSpin:false,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined,
data:undefined
}
@ -33,28 +33,34 @@ class InfosPath extends Component{
this.setState({
isSpin:true
})
let{category,status,sort_by,page,per_page}=this.state;
this.getCourses(category,status,sort_by,page,per_page);
let {category, status, sort_by, page, per_page, sort_direction} = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
getCourses=(category,status,sort_by,page,per_page)=>{
getCourses = (category, status, sort_by, page, sort_direction) => {
let url=`/users/${this.props.match.params.username}/subjects.json`;
axios.get((url),{params:{
category,
status,
sort_by,
page,
sort_direction,
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
this.setState({
totalCount:result.data.count,
data:result.data,
sort_by: sort_by,
sort_direction: sort_direction,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin: false
})
})
}
@ -66,18 +72,18 @@ class InfosPath extends Component{
page:1,
isSpin:true
})
let{sort_by}=this.state;
this.getCourses(cate,undefined,sort_by,1);
let {sort_by, sort_direction} = this.state;
this.getCourses(cate, undefined, sort_by, 1, sort_direction);
}
// 切换状态
changeStatus=(status)=>{
let{category,sort_by}=this.state;
let {category, sort_by, sort_direction} = this.state;
this.setState({
status,
page:1,
isSpin:true
})
this.getCourses(category,status,sort_by,1);
this.getCourses(category, status, sort_by, 1, sort_direction);
}
//切换页数
changePage=(page)=>{
@ -85,8 +91,8 @@ class InfosPath extends Component{
page,
isSpin:true
})
let{category,sort_by,status}=this.state;
this.getCourses(category,status,sort_by,page);
let {category, sort_by, status, sort_direction} = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
// 进入课堂
@ -101,15 +107,38 @@ class InfosPath extends Component{
sort_by:sort,
isSpin:true
})
let{category,status,page}=this.state;
this.getCourses(category,status,sort,page);
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, sort, page, sort_direction);
}
//切换种类
updatedlist(sort_by) {
//按照什么样子排序
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, sort_by, 1, "desc");
}
//排序
updatedlists(sort_direction) {
//是否是倒序
this.setState({
isSpin: true
});
let {category, status, page, sort_by} = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
render(){
let{
category,
status,
sort_by,
sort_direction,
page,
data,
totalCount,
@ -117,6 +146,17 @@ class InfosPath extends Component{
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
最近更新
</Menu.Item>
<Menu.Item onClick={() => this.updatedlist("created_at")}>
最新创建
</Menu.Item>
</Menu>
);
return(
<div className="educontent">
<Spin size="large" spinning={isSpin}>
@ -142,10 +182,65 @@ class InfosPath extends Component{
<li className={status=="finished" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("finished")}>已完成</a></li>
</div>
}
<div className="pl25 pr25 clearfix font-12 mb20 mt20">
<div className="pl25 pr25 clearfix font-12 " style={{
lineHeight: "41px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实践课程"}</span>
<span className="fr color-grey-9">时间最新</span>
<sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc")}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc")}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最近更新' : sort_by === "created_at" ? '最新创建' : ""}</span>
</span>
</Dropdown>
</div>
<style>
{
`
.square-list{width: 100%;box-sizing: border-box;margin-top:10px}
`
}
</style>
<div className="square-list clearfix">
{/* 295 */}
{

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Pagination,Spin} from 'antd';
import {Tooltip, Pagination, Spin, Dropdown, Menu} from 'antd';
import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder';
@ -16,7 +16,8 @@ class InfosProject extends Component{
status:undefined,
page:1,
per_page:16,
sort_by: "updated_on",
sort_direction: "desc",
totalCount:undefined,
data:undefined,
isSpin:false
@ -27,16 +28,18 @@ class InfosProject extends Component{
this.setState({
isSpin:true
})
let{category,status,page}=this.state;
this.getCourses(category,status,page);
let {category, status, page, sort_by, sort_direction} = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
getCourses=(category,status,page)=>{
getCourses = (category, status, page, sort_by, sort_direction) => {
let url=`/users/${this.props.match.params.username}/projects.json`;
axios.get((url),{params:{
category,
status,
page,
sort_by,
sort_direction,
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
@ -49,6 +52,8 @@ class InfosProject extends Component{
this.setState({
totalCount:result.data.count,
data:result.data,
sort_by: sort_by,
sort_direction: sort_direction,
isSpin:false
})
}
@ -56,6 +61,9 @@ class InfosProject extends Component{
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin: false
})
})
}
@ -66,8 +74,9 @@ class InfosProject extends Component{
page:1,
isSpin:true
})
let{status}=this.state;
this.getCourses(cate,status,1);
let {status, sort_by, sort_direction} = this.state;
this.getCourses(cate, status, 1, sort_by,
sort_direction);
}
//切换状态
changeStatus=(status)=>{
@ -76,8 +85,12 @@ class InfosProject extends Component{
page:1,
isSpin:true
})
let{category}=this.state;
this.getCourses(category,status,1);
let {
category, sort_by,
sort_direction
} = this.state;
this.getCourses(category, status, 1, sort_by,
sort_direction);
}
//切换页数
changePage=(page)=>{
@ -85,8 +98,12 @@ class InfosProject extends Component{
page,
isSpin:true
})
let{category,status}=this.state;
this.getCourses(category,status,page);
let {
category, status, sort_by,
sort_direction
} = this.state;
this.getCourses(category, status, page, sort_by,
sort_direction);
}
// 进入项目
@ -96,6 +113,27 @@ class InfosProject extends Component{
}
}
//切换种类
updatedlist(sort_by) {
//按照什么样子排序
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, 1, sort_by, "desc");
}
//排序
updatedlists(sort_direction) {
//是否是倒序
this.setState({
isSpin: true
});
let {category, status, page, sort_by} = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
render(){
let{
category,
@ -103,12 +141,24 @@ class InfosProject extends Component{
page,
data,
totalCount,
isSpin
isSpin,
sort_by,
sort_direction
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
console.log(data)
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_on")}>
最新动态
</Menu.Item>
<Menu.Item onClick={() => this.updatedlist("created_on")}>
最新创建
</Menu.Item>
</Menu>
);
return(
<div className="educontent">
<Spin size="large" spinning={isSpin}>
@ -125,10 +175,65 @@ class InfosProject extends Component{
<li className={status=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("personal")}>私有</a></li>
</div>
}
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<p className="pl25 pr25 clearfix font-12 " style={{
lineHeight: "41px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"项目"}</span>
<span className="fr color-grey-9">时间最新</span>
<sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc")}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc")}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_on" ? '最近更新' : sort_by === "created_on" ? '最新创建' : ""}</span>
</span>
</Dropdown>
</p>
<style>
{
`
.square-list{width: 100%;box-sizing: border-box;margin-top:10px}
`
}
</style>
<div className="square-list clearfix">
{/* 289 */}
{
@ -174,17 +279,17 @@ class InfosProject extends Component{
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
{
item.members_count> 0 &&
item.members_count > 0 &&
<span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span>
}
{
item.issues_count> 0 &&
item.issues_count > 0 &&
<span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-issue fl mr3" data-tip-down="issues数"></i>{item.issues_count}</span>
}
{
item.changesets_count> 0 &&
item.changesets_count > 0 &&
<span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-banbenku fl mr3" data-tip-down="版本库"></i>{item.changesets_count}</span>
}

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { Pagination , Spin } from 'antd';
import {Pagination, Spin, Dropdown, Menu} from 'antd';
import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios';
@ -16,11 +16,11 @@ class InfosShixun extends Component{
this.state={
category:undefined,
page:1,
sort_by:'time',
status:undefined,
per_page:16,
isSpin:false,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined,
data:undefined
}
@ -30,11 +30,15 @@ class InfosShixun extends Component{
this.setState({
isSpin:true
})
let{category,status,sort_by,page}=this.state;
this.getCourses(category,status,sort_by,page);
let {category, status, sort_by, page, sort_direction} = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
getCourses=(category,status,sort_by,page)=>{
getCourses = (category, status, sort_by, page, sort_direction) => {
// console.log("请求数据成功");
// console.log("getCourses");
// console.log(sort_by);
// console.log(sort_direction);
let url=`/users/${this.props.match.params.username}/shixuns.json`;
axios.get((url),{params:{
category,
@ -44,14 +48,21 @@ class InfosShixun extends Component{
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
console.log("请求数据成功");
console.log(sort_by);
this.setState({
totalCount:result.data.count,
data:result.data,
sort_by: sort_by,
sort_direction: sort_direction,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin: false
})
})
}
@ -63,8 +74,8 @@ class InfosShixun extends Component{
page:1,
isSpin:true
})
let{sort_by}=this.state;
this.getCourses(cate,undefined,sort_by,1);
let {sort_by, sort_direction} = this.state;
this.getCourses(cate, undefined, sort_by, 1, sort_direction);
}
// 切换状态
changeStatus=(status)=>{
@ -73,8 +84,8 @@ class InfosShixun extends Component{
page:1,
isSpin:true
})
let{category,sort_by}=this.state;
this.getCourses(category,status,sort_by,1);
let {category, sort_by, sort_direction} = this.state;
this.getCourses(category, status, sort_by, 1, sort_direction);
}
//切换页数
changePage=(page)=>{
@ -82,8 +93,8 @@ class InfosShixun extends Component{
page,
isSpin:true
})
let{category,sort_by,status}=this.state;
this.getCourses(category,status,sort_by,page);
let {category, sort_by, status, sort_direction} = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
// 进入课堂
@ -98,8 +109,28 @@ class InfosShixun extends Component{
sort_by:sort,
isSpin:true
})
let{category,status,page}=this.state;
this.getCourses(category,status,sort,page);
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, sort, page, sort_direction);
}
//切换种类
updatedlist(sort_by) {
//按照什么样子排序
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, sort_by, 1, "desc");
}
//排序
updatedlists(sort_direction) {
//是否是倒序
this.setState({
isSpin: true
});
let {category, status, page, sort_by} = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
render(){
@ -110,10 +141,22 @@ class InfosShixun extends Component{
page,
data,
totalCount,
sort_direction,
isSpin
} = this.state;
let is_current=this.props.is_current;
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
最新动态
</Menu.Item>
<Menu.Item onClick={() => this.updatedlist("created_at")}>
语言类别
</Menu.Item>
</Menu>
);
return(
<div className="educontent">
<Spin size="large" spinning={isSpin}>
@ -140,17 +183,57 @@ class InfosShixun extends Component{
<li className={status=="passed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("passed")}>已通关</a></li>
</div>
}
<div className="pl25 pr25 clearfix font-12 mb20 mt20">
<div className="pl25 pr25 clearfix font-12 " style={{
lineHeight: "41px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实训"}</span>
<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12">{sort_by=="time"?"时间最新":"语言类别"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal">
<li onClick={()=>this.changeOrder("time")}>时间最新</li>
<li onClick={()=>this.changeOrder("language")}>语言类别</li>
</ul>
</li>
</div>
<sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc")}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc")}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最新动态' : sort_by === "created_at" ? '语言类别' : ""}</span>
</span>
</Dropdown>
</div>
<style>
{
@ -160,6 +243,7 @@ class InfosShixun extends Component{
left: 10px;
bottom: 100px;
}
.square-list{width: 100%;box-sizing: border-box;margin-top:10px}
`
}
</style>

@ -162,7 +162,7 @@
float:left;
}
.userpost label{
display:block;
display: block;
height: 18px;
line-height:18px;
}
@ -435,3 +435,7 @@
.educontent .square-list {
min-height: 400px;
}
.h10 {
height: 10px;
}

@ -1,6 +1,6 @@
import React, { useState, useEffect, useContext, useRef, memo } from 'react';
import {Link} from 'react-router-dom';
import { Pagination, Input, Button } from 'antd'
import {Pagination, Input, Button} from 'antd'
import { getUrl2, isDev, ThemeContext, ActionBtn, NoneData } from 'educoder'
import axios from 'axios'
import VideoInReviewItem from './VideoInReviewItem'
@ -96,7 +96,7 @@ function InfoVideo (props) {
setCount(response.data.count)
}
}).catch(() => {
setLoading(false)
})
}
function fetchReviewvideos() {
@ -201,7 +201,10 @@ function InfoVideo (props) {
function getCopyText (file_url, cover_url) {
return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>`
}
const _inputValue = getCopyText(videoId.file_url, videoId.cover_url)
const _inputValue = getCopyText(videoId.file_url, videoId.cover_url);
const sorts = sortKey.split('-')
return (
<div className="educontent infoVideo">
<EditVideoModal {...props} {...editModalObj}
@ -281,7 +284,9 @@ function InfoVideo (props) {
}
></InfoTab>
<div className="toolbarRow mt20 df">
<div className="toolbarRow df" style={{
lineHeight: "40px",
}}>
<span>
<span style={{color: theme.foreground_orange1}}> {count} </span>
@ -297,11 +302,53 @@ function InfoVideo (props) {
{categoryObj.category == 'all' &&<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12">{sortKey=="published_at-desc"?"最新上传":"最早上传"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal">
<li onClick={()=>onSortChange("published_at-desc",0)}>最新上传</li>
<li onClick={()=>onSortChange("published_at-asc",1)}>最早上传</li>
</ul>
<span className="color-grey-9 font-12" style={{
marginRight: " 5px",
}}>{"最新上传"}</span>
{/*<i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>*/}
{/*<ul className="drop_down_normal">*/}
{/* /!*<li onClick={()=>onSortChange("published_at-desc",0)}>最新上传</li>*!/*/}
{/* /!*<li onClick={()=>onSortChange("published_at-asc",1)}>最早上传</li>*!/*/}
{/*</ul>*/}
<sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sorts[1] === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => onSortChange("published_at-asc", 0)}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sorts[1] === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => onSortChange("published_at-desc", 0)}></i>
</span>
</sapn>
</li>
</div>}
</div>

Loading…
Cancel
Save