|
|
@ -1,16 +1,30 @@
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
|
|
|
|
|
|
|
import {Input,Pagination,Tooltip} from 'antd';
|
|
|
|
import {Input,Pagination,Tooltip} from 'antd';
|
|
|
|
import {TPMIndexHOC} from "../../../modules/tpm/TPMIndexHOC";
|
|
|
|
import {TPMIndexHOC} from "../../../modules/tpm/TPMIndexHOC";
|
|
|
|
import {Link,NavLink} from 'react-router-dom';
|
|
|
|
|
|
|
|
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
|
|
|
|
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
import MessagSub from "./MessagSub";
|
|
|
|
|
|
|
|
import MessagePrivate from "./MessagePrivate";
|
|
|
|
|
|
|
|
import MessagChat from "./MessagChat";
|
|
|
|
|
|
|
|
import "../css/messagemy.css"
|
|
|
|
import "../css/messagemy.css"
|
|
|
|
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
|
|
|
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
|
|
|
|
|
|
|
import Loading from '../../../Loading'
|
|
|
|
|
|
|
|
import Loadable from 'react-loadable';
|
|
|
|
|
|
|
|
|
|
|
|
// MessagSub 消息自路由
|
|
|
|
// MessagSub 消息自路由
|
|
|
|
// MessagePrivate 私信
|
|
|
|
// MessagePrivate 私信
|
|
|
|
|
|
|
|
const MessagSub = Loadable({
|
|
|
|
|
|
|
|
loader: () => import('./MessagSub'),
|
|
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const MessagePrivate = Loadable({
|
|
|
|
|
|
|
|
loader: () => import('./MessagePrivate'),
|
|
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const MessagChat = Loadable({
|
|
|
|
|
|
|
|
loader: () => import('./MessagChat'),
|
|
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
|
|
})
|
|
|
|
class Messagerouting extends Component{
|
|
|
|
class Messagerouting extends Component{
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
@ -23,7 +37,8 @@ class Messagerouting extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount(){
|
|
|
|
componentDidMount(){
|
|
|
|
|
|
|
|
console.log("Messagerouting");
|
|
|
|
|
|
|
|
console.log(this.props);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
// console.log("11111111111");
|
|
|
|
// console.log("11111111111");
|
|
|
@ -58,6 +73,14 @@ class Messagerouting extends Component{
|
|
|
|
routing:value,
|
|
|
|
routing:value,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.Messageprivatemessageunreadmessage(this.props.current_user.user_id);
|
|
|
|
this.Messageprivatemessageunreadmessage(this.props.current_user.user_id);
|
|
|
|
|
|
|
|
if(value===1){
|
|
|
|
|
|
|
|
this.props.history.replace(`/message/info/${this.props.current_user.user_id}`);
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(value===2){
|
|
|
|
|
|
|
|
this.props.history.replace(`/message/letter/${this.props.current_user.user_id}`);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -73,23 +96,35 @@ class Messagerouting extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
//跳转到链接
|
|
|
|
//跳转到链接
|
|
|
|
Modifyur=(i,item)=>{
|
|
|
|
Modifyur=(i,item)=>{
|
|
|
|
console.log("跳转到链接");
|
|
|
|
console.log("跳转到链接1");
|
|
|
|
console.log(i);
|
|
|
|
console.log(i);
|
|
|
|
|
|
|
|
console.log(item);
|
|
|
|
|
|
|
|
console.log("跳转到链接2");
|
|
|
|
if(i<3){
|
|
|
|
if(i<3){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
routing:i,
|
|
|
|
routing:i,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
if(i===1){
|
|
|
|
|
|
|
|
this.props.history.replace(`/message/info/${this.props.current_user.user_id}`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(i===2){
|
|
|
|
|
|
|
|
this.props.history.replace(`/message/letter/${this.props.current_user.user_id}`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
routing:i,
|
|
|
|
routing:i,
|
|
|
|
myysluser:item,
|
|
|
|
myysluser:item,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log("22222222222");
|
|
|
|
|
|
|
|
this.props.history.replace(`/message/letters/${this.props.current_user.user_id}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let{routing,unread_message_count,unread_tiding_count} =this.state;
|
|
|
|
let{routing,unread_message_count,unread_tiding_count} =this.state;
|
|
|
|
console.log(this.props);
|
|
|
|
console.log(this.props);
|
|
|
|
|
|
|
|
console.log(routing);
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="newMain clearfix">
|
|
|
|
<div className="newMain clearfix">
|
|
|
|
<div className="educontent mt20 mb80 clearfix">
|
|
|
|
<div className="educontent mt20 mb80 clearfix">
|
|
|
@ -97,7 +132,7 @@ class Messagerouting extends Component{
|
|
|
|
<div className="leftPanel">
|
|
|
|
<div className="leftPanel">
|
|
|
|
{/*头像*/}
|
|
|
|
{/*头像*/}
|
|
|
|
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
|
|
|
|
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
|
|
|
|
<a href="javascript:void(0);">
|
|
|
|
<a >
|
|
|
|
<img className="person radius myw120 myh120" src={this.props.current_user&&this.props.current_user.image_url}/>
|
|
|
|
<img className="person radius myw120 myh120" src={this.props.current_user&&this.props.current_user.image_url}/>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
<p className="font-24 lineh-25 mt10" >{this.props.current_user&&this.props.current_user.username}</p>
|
|
|
|
<p className="font-24 lineh-25 mt10" >{this.props.current_user&&this.props.current_user.username}</p>
|
|
|
@ -119,14 +154,37 @@ class Messagerouting extends Component{
|
|
|
|
{/*右边*/}
|
|
|
|
{/*右边*/}
|
|
|
|
<div className="rightPanel">
|
|
|
|
<div className="rightPanel">
|
|
|
|
<div className="clearfix">
|
|
|
|
<div className="clearfix">
|
|
|
|
{/*消息自路由*/}
|
|
|
|
{/*/!*消息自路由*!/*/}
|
|
|
|
{routing===1?<MessagSub {...this.state} {...this.props} Message2={()=>this.Message2()}></MessagSub> :""}
|
|
|
|
{/*{routing===1?<MessagSub {...this.state} {...this.props} Message2={()=>this.Message2()}></MessagSub> :""}*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*/!*私信*!/*/}
|
|
|
|
|
|
|
|
{/*{routing===2?<MessagePrivate {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i,item)=>this.Modifyur(i,item)}></MessagePrivate> :""}*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*/!*私信聊天页面*!/*/}
|
|
|
|
|
|
|
|
{/*{routing===3?<MessagChat {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)}></MessagChat>:""}*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Switch>
|
|
|
|
|
|
|
|
{/*/!*消息自路由*!/*/}
|
|
|
|
|
|
|
|
<Route path="/message/info/:userid"
|
|
|
|
|
|
|
|
render={
|
|
|
|
|
|
|
|
(props) => (<MessagSub {...this.state} {...this.props} Message2={()=>this.Message2()}></MessagSub>)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
{/*/!*私信*!/*/}
|
|
|
|
|
|
|
|
<Route path="/message/letter/:userid"
|
|
|
|
|
|
|
|
render={
|
|
|
|
|
|
|
|
(props) => (<MessagePrivate {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i,item)=>this.Modifyur(i,item)}></MessagePrivate> )
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
{/*/!*私信聊天页面*!/*/}
|
|
|
|
|
|
|
|
<Route path="/message/letters/:userid"
|
|
|
|
|
|
|
|
render={
|
|
|
|
|
|
|
|
(props) => (<MessagChat {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)}></MessagChat>)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
{/*私信*/}
|
|
|
|
</Switch>
|
|
|
|
{routing===2?<MessagePrivate {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)}></MessagePrivate> :""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*私信聊天页面*/}
|
|
|
|
|
|
|
|
{routing===3?<MessagChat {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)}></MessagChat>:""}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|