diff --git a/public/react/src/modules/message/js/MessagChat.js b/public/react/src/modules/message/js/MessagChat.js index 6077ec508..42d42bb8c 100644 --- a/public/react/src/modules/message/js/MessagChat.js +++ b/public/react/src/modules/message/js/MessagChat.js @@ -5,6 +5,7 @@ import { Modal,Input,Icon,Tooltip,Spin} from 'antd'; import axios from 'axios'; import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; +import moment from 'moment'; //私信聊天页面 class MessagChat extends Component{ constructor(props) { @@ -16,6 +17,7 @@ class MessagChat extends Component{ limit:20, page:1, datay:[], + mess:false, } } @@ -89,24 +91,16 @@ class MessagChat extends Component{ console.log(i); this.props.Modifyur(i); }; - FormatTime=(timestamp)=> { - var datetime = new Date(timestamp.replace(/-/,"/")) - var mistiming = Math.round(new Date() / 1000) - datetime; - var postfix = mistiming > 0 ? '前' : '后' - mistiming = Math.abs(mistiming) - var arrr = ['年', '个月', '星期', '天', '小时', '分钟', '秒']; - var arrn = [31536000, 2592000, 604800, 86400, 3600, 60, 1]; - - for (var i = 0; i < 7; i++) { - var inm = Math.floor(mistiming / arrn[i]) - if (inm != 0) { - return inm + arrr[i] + postfix - } - } - } - + // 点击了用户 + Clickedontheuser=(user)=>{ + this.setState({ + myysluser:user, + mess:true, + }) + } render() { + let{isSpins,datay,myysluser}=this.state; let{isSpins,datay}=this.state; //this.newquestioMDMdRef.current.getValue().trim(); return ( @@ -118,7 +112,7 @@ class MessagChat extends Component{
this.smyJump(2)}> - 117llj与你的私信 + {mess===false?(myysluser!==undefined?myysluser.name:""):(myysluser!==undefined?myysluser.name:"")}与你的私信
{/*聊天页面*/}
- this.smyJump()} className="mr20 private_message_a">{item.target.name}
+ this.myCome(item)} className="mr20 private_message_a">{item.target.name}
与你的私信
[{item.message_count}{"条"}]
{moment(item.send_time).fromNow()}
diff --git a/public/react/src/modules/message/js/Messagerouting.js b/public/react/src/modules/message/js/Messagerouting.js
index 56eafec7e..3bad873b0 100644
--- a/public/react/src/modules/message/js/Messagerouting.js
+++ b/public/react/src/modules/message/js/Messagerouting.js
@@ -18,6 +18,7 @@ class Messagerouting extends Component{
routing:1,
unread_message_count:0,
unread_tiding_count:0,
+ myysluser:undefined,
}
}
@@ -71,12 +72,20 @@ class Messagerouting extends Component{
};
//跳转到链接
- Modifyur=(i)=>{
+ Modifyur=(i,item)=>{
console.log("跳转到链接");
console.log(i);
- this.setState({
- routing:i,
- })
+ if(i<3){
+ this.setState({
+ routing:i,
+ })
+ }else {
+ this.setState({
+ routing:i,
+ myysluser:item,
+ })
+ }
+
}
render() {
let{routing,unread_message_count,unread_tiding_count} =this.state;
@@ -117,7 +126,7 @@ class Messagerouting extends Component{
{routing===2?