dev_cs_new
杨树明 6 years ago
parent 040e2843a2
commit 9cb00a694a

@ -29,11 +29,13 @@ class MessagChat extends Component{
}
componentDidMount(){
this.getdata(1);
let target_ids=this.props.match.params.private;
this.getChatList(1,this.state.limits,target_ids);
// console.log("MessagChat111111");
// console.log(this.props.myysluser);
this.setState({
const query = this.props.location.search;
let target_ids = query.split('?target_ids=');
this.getChatList(1,this.state.limits,target_ids[1]);
// console.log("MessagChat111111");
// console.log(this.props.myysluser);
this.setState({
myyslusers:this.props.myysluser
})
try {
@ -293,7 +295,7 @@ class MessagChat extends Component{
// mess:true,
// })
this.props.history.replace(`/message/${this.props.current_user.user_id}/${user.id}/message_detail`);
this.props.history.replace(`/message/${this.props.current_user.user_id}/message_detail?target_ids=${user.id}`);
// this.getdatatwo(this.state.page);
this.getChatListtwo(this.state.pages,this.state.mypagey,user.id);
@ -301,10 +303,11 @@ class MessagChat extends Component{
//回复
setreplyfun=()=>{
let contents=this.messageRef.current.getValue().trim();
let target_ids=this.props.match.params.private
const query = this.props.location.search;
let target_ids = query.split('?target_ids=');
let url = `/users/${this.props.match.params.userid}/private_messages.json`;
axios.post(url, {
target_id: target_ids,
target_id: target_ids[1],
content: contents
})
.then((response) => {

@ -122,7 +122,7 @@ class Messagerouting extends Component{
myysluser:item,
});
console.log("22222222222");
this.props.history.replace(`/message/${this.props.current_user.user_id}/${item.id}/message_detail`);
this.props.history.replace(`/message/${this.props.current_user.user_id}/message_detail?target_ids=${item.id}`);
}
};
@ -209,7 +209,7 @@ class Messagerouting extends Component{
}
></Route>
{/*/!*私信聊天页面*! letters/*/}
<Route path="/message/:userid/:private/message_detail"
<Route path="/message/:userid/message_detail"
render={
(props) => (<MessagChat {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagChat>)
}

Loading…
Cancel
Save