Merge remote-tracking branch 'origin/dev_Ysl' into dev_Ysl

# Conflicts:
#	public/react/src/modules/message/js/MessagChat.js
dev_cs_new
杨树明 6 years ago
commit 0f5aa704a8

@ -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>

@ -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{
<div>
{
modalsType===true?
<WriteaprivateletterModal {...this.state} {...this.props} modalsType={modalsType} cancelmodalsType={this.cancelmodalsType} smyJump={(is)=>this.smyJump(is)} ></WriteaprivateletterModal>
<WriteaprivateletterModal {...this.state} {...this.props} modalsType={modalsType} cancelmodalsType={this.cancelmodalsType} smyJump={(is,item)=>this.smyJump(is,item)} ></WriteaprivateletterModal>
:""
}
<div className="edu-back-white ml25">
@ -113,13 +116,13 @@ class MessagePrivate extends Component{
:data.map((item,key)=>{
return(
<div className="private-item clearfix df" key={key} onClick={(i)=>this.smyJump(3)}>
<div className="private-item clearfix df" key={key} onClick={(i)=>this.smyJump(3,item.target)}>
<a className="fl mr10 private_message_a">
<img src={item.target.image_url} className="radius myimgw48 myimgh48"/>
</a>
<div className="fl flex1">
<p>
<a onClick={()=>this.smyJump()} className="mr20 private_message_a">{item.target.name}</a>
<a onClick={()=>this.myCome(item)} className="mr20 private_message_a">{item.target.name}</a>
<span>与你的私信</span>
<span className="color-grey-c mr20">[{item.message_count}{"条"}]</span>
<span className="color-grey-c">{moment(item.send_time).fromNow()}</span>

@ -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);
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;

@ -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)

Loading…
Cancel
Save