forgeplus-react/src/forge/users/InfosUser.js

106 lines
2.4 KiB
JavaScript

import React, { Component } from "react";
// import { SnackbarHOC } from 'educoder';
import { Link } from "react-router-dom";
import { Avatar, Tag, Button, Pagination, Spin, Dropdown, Menu } from "antd";
import FocusButton from "../UsersList/focus_button";
import axios from "axios";
import { getImageUrl } from "educoder";
import NoneData from "../Nodata";
// import "./new_user.css";
import "../css/index.css";
class InfosUser extends Component {
constructor(props) {
super(props);
this.state = {
category: undefined,
status: undefined,
page: 1,
per_page: 16,
sort_by: "updated_on",
sort_direction: "desc",
totalCount: undefined,
data: undefined,
isSpin: false,
};
}
componentDidMount = () => {
};
//切换种类
changeCategory = (cate) => {
this.setState({
category: cate,
page: 1,
isSpin: true,
});
let { status, sort_by, sort_direction } = this.state;
this.getCourses(cate, status, 1, sort_by, sort_direction);
};
//切换状态
changeStatus = (status) => {
this.setState({
status: status,
page: 1,
isSpin: true,
});
let { category, sort_by, sort_direction } = this.state;
this.getCourses(category, status, 1, sort_by, sort_direction);
};
//切换页数
changePage = (page) => {
this.setState({
page,
isSpin: true,
});
let { category, status, sort_by, sort_direction } = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
};
//切换种类
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_directions) {
//是否是倒序
this.setState({
isSpin: true,
});
let { category, status, page, sort_by, sort_direction } = this.state;
let sort_directiony = sort_directions;
if (sort_directions === "asc") {
if (sort_directions === sort_direction) {
sort_directiony = "desc";
}
} else if (sort_directions === "desc") {
if (sort_directions === sort_direction) {
sort_directiony = "asc";
}
}
this.getCourses(category, status, page, sort_by, sort_directiony);
}
render() {
return (
<div>
ddddd
</div>
);
}
}
export default InfosUser;