|
|
|
@ -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{
|
|
|
|
|
<p className="clearfix pt30 pb30 edu-txt-center font-16 bor-bottom-greyE">
|
|
|
|
|
<a onClick={()=>this.smyJump(2)}><i className="iconfont icon-zuojiantou font-14 fl ml25 color-grey-9"
|
|
|
|
|
data-tip-down="返回到列表"></i></a>
|
|
|
|
|
117llj与你的私信
|
|
|
|
|
{mess===false?(myysluser!==undefined?myysluser.name:""):(myysluser!==undefined?myysluser.name:"")}与你的私信
|
|
|
|
|
</p>
|
|
|
|
|
{/*聊天页面*/}
|
|
|
|
|
<div className="dialogPanel">
|
|
|
|
@ -132,7 +126,7 @@ class MessagChat extends Component{
|
|
|
|
|
<span className="trangle"></span>
|
|
|
|
|
<div className="sms break_word" id="message_content_show_25137">hello</div>
|
|
|
|
|
<div className="edu-txt-left mt5">
|
|
|
|
|
<a href="javascript:void(0)" className="color-grey-c"
|
|
|
|
|
<a className="color-grey-c"
|
|
|
|
|
>删除</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -184,7 +178,7 @@ class MessagChat extends Component{
|
|
|
|
|
""
|
|
|
|
|
:datay.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<div className="private-part clearfix" key={key}>
|
|
|
|
|
<div className="private-part clearfix" key={key} onClick={(item)=>this.Clickedontheuser(item.target)}>
|
|
|
|
|
<div className="part-line df">
|
|
|
|
|
<img src={item.target.image_url} className="radius mr10 myimgw48 myimgh48"/>
|
|
|
|
|
<div className="flex1">
|
|
|
|
@ -195,7 +189,7 @@ class MessagChat extends Component{
|
|
|
|
|
<span className="newLetter"></span>
|
|
|
|
|
:""}
|
|
|
|
|
</span>
|
|
|
|
|
<span className="color-grey-c fr">{(time)=>this.FormatTime(item.send_time)}</span>
|
|
|
|
|
<span className="color-grey-c fr">{moment(item.send_time).fromNow()}</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p className="color-grey-6 lineh-20 justify break_word task-hide-2" style={{wordBreak:"break-word"}} dangerouslySetInnerHTML={{__html:item.content}}></p>
|
|
|
|
|
</div>
|
|
|
|
|