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:"")}与你的私信

{/*聊天页面*/}
@@ -132,7 +126,7 @@ class MessagChat extends Component{
hello
- 删除
@@ -184,7 +178,7 @@ class MessagChat extends Component{ "" :datay.map((item,key)=>{ return( -
+
this.Clickedontheuser(item.target)}>
@@ -195,7 +189,7 @@ class MessagChat extends Component{ :""} - {(time)=>this.FormatTime(item.send_time)} + {moment(item.send_time).fromNow()}

diff --git a/public/react/src/modules/message/js/MessagePrivate.js b/public/react/src/modules/message/js/MessagePrivate.js index fed52c76d..ffd6a72f5 100644 --- a/public/react/src/modules/message/js/MessagePrivate.js +++ b/public/react/src/modules/message/js/MessagePrivate.js @@ -81,10 +81,13 @@ class MessagePrivate extends Component{ }) }; // 跳转页面 - smyJump =(i)=>{ + smyJump =(i,item)=>{ console.log("跳转页面"); console.log(i); - this.props.Modifyur(i); + this.props.Modifyur(i,item); + }; + myCome=(e)=>{ + window.location.href="/users/innov"; } render() { let{page,limit,typeysl,count,isSpin,data,modalsType}=this.state; @@ -94,7 +97,7 @@ class MessagePrivate extends Component{
{ modalsType===true? - this.smyJump(is)} > + this.smyJump(is,item)} > :"" }
@@ -113,13 +116,13 @@ class MessagePrivate extends Component{ :data.map((item,key)=>{ return( -
this.smyJump(3)}> +
this.smyJump(3,item.target)}>

- 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?this.Message2()} Modifyur={(i)=>this.Modifyur(i)}> :""} {/*私信聊天页面*/} - {routing===3?this.Message2()} Modifyur={(i)=>this.Modifyur(i)}>:""} + {routing===3?this.Message2()} Modifyur={(i)=>this.Modifyur(i)}>:""}

diff --git a/public/react/src/modules/message/messagemodal/WriteaprivateletterModal.js b/public/react/src/modules/message/messagemodal/WriteaprivateletterModal.js index bb23b4f25..3e349ef2c 100644 --- a/public/react/src/modules/message/messagemodal/WriteaprivateletterModal.js +++ b/public/react/src/modules/message/messagemodal/WriteaprivateletterModal.js @@ -69,7 +69,7 @@ class WriteaprivateletterModal extends Component { floatingboxdisplays:false, Pleaseselectthesender:false, }); - this.props.smyJump(3); + this.props.smyJump(3,this.state.users); console.log(result); }).catch((error) => { console.log(error)