dev_cs_new
parent
b171aa35af
commit
6630cae57f
@ -0,0 +1,6 @@
|
||||
.myw120{
|
||||
width: 120px;
|
||||
}
|
||||
.myh120{
|
||||
height: 120px;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
import React, { Component } from 'react';
|
||||
//私信聊天页面
|
||||
class MessagChat extends Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default MessagChat;
|
@ -0,0 +1,125 @@
|
||||
import React, { Component } from 'react';
|
||||
import {
|
||||
Spin,
|
||||
Pagination,
|
||||
} from "antd";
|
||||
import axios from 'axios';
|
||||
|
||||
//消息页面
|
||||
class MessagSub extends Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
page:1,
|
||||
limit:10,
|
||||
typeysl:"",
|
||||
count:0,
|
||||
isSpin:true,
|
||||
}
|
||||
}
|
||||
// 初始化数据
|
||||
componentDidMount(){
|
||||
debugger
|
||||
console.log("初始化数据了");
|
||||
this.getdata("",this.state.page);
|
||||
}
|
||||
|
||||
//塞选页数
|
||||
paginationonChanges=(pageNumber)=>{
|
||||
this.setState({
|
||||
page: pageNumber,
|
||||
})
|
||||
this.getdata(this.state.typeysl,pageNumber);
|
||||
|
||||
}
|
||||
//获取数据源
|
||||
getdata=(types,page)=>{
|
||||
this.setState({
|
||||
isSpin:true,
|
||||
})
|
||||
let{limit}=this.state;
|
||||
let url = `/users/tidings.json`;
|
||||
axios.get((url),{params:{
|
||||
type:types,
|
||||
page:page,
|
||||
per_page:limit,
|
||||
}}).then((result) => {
|
||||
if (result) {
|
||||
console.log(types);
|
||||
console.log(result);
|
||||
if(result.data.message!==undefined){
|
||||
console.log("5151515151");
|
||||
return;
|
||||
}
|
||||
console.log("调用了消失的方法");
|
||||
console.log("5454545454");
|
||||
this.setState({
|
||||
count:result.data.count,
|
||||
typeysl:types,
|
||||
isSpin:false,
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
this.setState({
|
||||
isSpin:false,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
componentWillUnmount(){
|
||||
// 卸载异步操作设置状态
|
||||
this.setState = (state, callback) => {
|
||||
return;
|
||||
}
|
||||
}
|
||||
render() {
|
||||
let{page,limit,typeysl,count,isSpin}=this.state;
|
||||
console.log("6868686868");
|
||||
console.log(isSpin);
|
||||
return (
|
||||
<div className="clearfix ml20">
|
||||
{/*头部筛选数据*/}
|
||||
<ul className="pl10 ridingNav clearfix edu-back-white">
|
||||
<li className={typeysl===""?"active":""}><a onClick={()=>this.getdata("")}>全部消息</a></li>
|
||||
|
||||
<li className={typeysl&&typeysl==="course"?"active":""} ><a onClick={()=>this.getdata("course")}>课堂提醒</a></li>
|
||||
|
||||
<li className={typeysl&&typeysl==="project"?"active":""} ><a onClick={()=>this.getdata("project")}>项目提醒</a></li>
|
||||
|
||||
<li className={typeysl&&typeysl==="project_package"?"active":""}><a onClick={()=>this.getdata("project_package")}>众包</a></li>
|
||||
|
||||
<li className={typeysl&&typeysl==="apply"?"active":""}><a onClick={()=>this.getdata("apply")}>审核</a></li>
|
||||
|
||||
<li className={typeysl&&typeysl==="system"?"active":""}><a onClick={()=>this.getdata("system")}>通知</a></li>
|
||||
|
||||
<li className={typeysl&&typeysl==="interactive"?"active":""}><a onClick={()=>this.getdata("interactive")}>互动提醒</a></li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
{/*下面内容页面*/}
|
||||
<div className="bor-top-greyE">
|
||||
{/*这里可以进行数据处理*/}
|
||||
<Spin size="large" spinning={isSpin}>
|
||||
<div className="pl25 ridinglist edu-back-white">
|
||||
|
||||
|
||||
</div>
|
||||
</Spin>
|
||||
|
||||
{/*页数*/}
|
||||
<div style={{textAlign:"center"}} class="new_expand mt10">
|
||||
<div className="edu-txt-center mt30">
|
||||
<Pagination showQuickJumper current={page}
|
||||
onChange={this.paginationonChanges} pageSize={limit}
|
||||
total={count}></Pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default MessagSub;
|
@ -0,0 +1,21 @@
|
||||
import React, { Component } from 'react';
|
||||
//私信页面
|
||||
class MessagePrivate extends Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default MessagePrivate;
|
@ -0,0 +1,77 @@
|
||||
import React, { Component } from 'react';
|
||||
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
||||
import {Input,Pagination,Tooltip} from 'antd';
|
||||
import {TPMIndexHOC} from "../../../modules/tpm/TPMIndexHOC";
|
||||
import {Link,NavLink} from 'react-router-dom';
|
||||
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
|
||||
import axios from 'axios';
|
||||
import MessagSub from "./MessagSub";
|
||||
import MessagePrivate from "./MessagePrivate";
|
||||
import MessagChat from "./MessagChat";
|
||||
import "../css/messagemy.css"
|
||||
// MessagSub 消息自路由
|
||||
// MessagePrivate 私信
|
||||
class Messagerouting extends Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
routing:1,
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
|
||||
}
|
||||
// 切换路由
|
||||
|
||||
SwitchonClick=(value)=>{
|
||||
this.setState({
|
||||
routing:value,
|
||||
})
|
||||
}
|
||||
render() {
|
||||
let{routing} =this.state;
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<div className="educontent mt20 mb80 clearfix">
|
||||
{/*左边*/}
|
||||
<div className="leftPanel">
|
||||
{/*头像*/}
|
||||
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
|
||||
<a>
|
||||
<img className="person radius myw120 myh120" src={"/images/avatars/User/71519?1564061748"}/>
|
||||
</a>
|
||||
<p className="font-24 lineh-25 mt10" >杨树林</p>
|
||||
<p className="color-grey-6 mt5" >工程师</p>
|
||||
</div>
|
||||
{/*路由跳转*/}
|
||||
<ul className="edu-back-white">
|
||||
<li className={routing ===1?"nav pr active":"nav pr"}>
|
||||
<a onClick={(value)=>this.SwitchonClick(1)}>消息</a>
|
||||
</li>
|
||||
<li className={routing ===2?"nav pr active":"nav pr"}>
|
||||
<a onClick={(value)=>this.SwitchonClick(2)}>私信</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/*右边*/}
|
||||
<div className="rightPanel">
|
||||
<div className="clearfix ml20">
|
||||
{/*消息自路由*/}
|
||||
{routing===1?<MessagSub></MessagSub> :""}
|
||||
|
||||
{/*私信*/}
|
||||
{routing===2?<MessagePrivate></MessagePrivate> :""}
|
||||
|
||||
{/*私信聊天页面*/}
|
||||
{routing===3?<MessagChat></MessagChat>:""}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default SnackbarHOC() (TPMIndexHOC ( Messagerouting ));
|
Loading…
Reference in new issue