|
|
@ -86,21 +86,7 @@ class MessagChat extends Component{
|
|
|
|
console.log(i);
|
|
|
|
console.log(i);
|
|
|
|
this.props.Modifyur(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
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let{isSpins,datay}=this.state;
|
|
|
|
let{isSpins,datay}=this.state;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -178,7 +164,7 @@ class MessagChat extends Component{
|
|
|
|
<span className="newLetter"></span>
|
|
|
|
<span className="newLetter"></span>
|
|
|
|
:""}
|
|
|
|
:""}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span className="color-grey-c fr">{(time)=>this.FormatTime(item.send_time)}</span>
|
|
|
|
<span className="color-grey-c fr">{item.send_time}</span>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
<p className="color-grey-6 lineh-20 justify break_word task-hide-2" style={{wordBreak:"break-word"}} dangerouslySetInnerHTML={{__html:item.content}}></p>
|
|
|
|
<p className="color-grey-6 lineh-20 justify break_word task-hide-2" style={{wordBreak:"break-word"}} dangerouslySetInnerHTML={{__html:item.content}}></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|