|
|
|
@ -66,7 +66,7 @@ class MessagChat extends Component{
|
|
|
|
|
|
|
|
|
|
getChatList=(page,listl,target_ids)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpins:true,
|
|
|
|
|
isSpin:true,
|
|
|
|
|
});
|
|
|
|
|
let url = `/users/${this.props.match.params.userid}/private_message_details.json`;
|
|
|
|
|
axios.get((url),{params:{
|
|
|
|
@ -106,20 +106,20 @@ class MessagChat extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpins:false,
|
|
|
|
|
isSpin:false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpins:false,
|
|
|
|
|
isSpin:false,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
getChatListtwo=(pages,listls,target_ids)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpins:true,
|
|
|
|
|
isSpin:true,
|
|
|
|
|
});
|
|
|
|
|
let url = `/users/${this.props.match.params.userid}/private_message_details.json`;
|
|
|
|
|
axios.get((url),{params:{
|
|
|
|
@ -132,27 +132,43 @@ class MessagChat extends Component{
|
|
|
|
|
if(result.data.message!==undefined){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var datas=[]
|
|
|
|
|
var datay=result.data.messages;
|
|
|
|
|
var obj={};
|
|
|
|
|
for (var i=0;i<datay.length;i++){
|
|
|
|
|
if(i===0){
|
|
|
|
|
obj=datay[i];
|
|
|
|
|
datas.push(datay[i]);
|
|
|
|
|
}else{
|
|
|
|
|
obj=datay[i];
|
|
|
|
|
if(obj.send_day===datay[i].send_day){
|
|
|
|
|
datay[i].send_day="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
datas.push(datay[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(result.data!==null){
|
|
|
|
|
console.log(result)
|
|
|
|
|
this.setState({
|
|
|
|
|
messages:result.data.messages,
|
|
|
|
|
messages:datas,
|
|
|
|
|
myuserl:result.data.target,
|
|
|
|
|
});
|
|
|
|
|
this.getdatatwo(this.state.page);
|
|
|
|
|
// this.getdatatwo(this.state.page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpins:false,
|
|
|
|
|
isSpin:false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpins:false,
|
|
|
|
|
isSpin:false,
|
|
|
|
|
});
|
|
|
|
|
this.getdatatwo(this.state.page);
|
|
|
|
|
// this.getdatatwo(this.state.page);
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
//获取数据地方
|
|
|
|
@ -285,7 +301,7 @@ class MessagChat extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let{isSpins,datay,myyslusers,mess,limits,myuserl,messages}=this.state;
|
|
|
|
|
let{isSpins,datay,myyslusers,mess,limits,myuserl,messages,isSpin}=this.state;
|
|
|
|
|
// console.log(mess);
|
|
|
|
|
// console.log(myyslusers);
|
|
|
|
|
// console.log("MessagChat");
|
|
|
|
@ -308,14 +324,15 @@ class MessagChat extends Component{
|
|
|
|
|
{/*聊天页面*/}
|
|
|
|
|
<div className="dialogPanel">
|
|
|
|
|
<div >
|
|
|
|
|
<Spin size="large" className="myw100baifenbi" spinning={isSpin}>
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
messages===undefined?
|
|
|
|
|
""
|
|
|
|
|
:messages.map((item,key)=>{
|
|
|
|
|
console.log("-----------------================-=-==-==");
|
|
|
|
|
console.log(item.sender_id);
|
|
|
|
|
console.log(this.props.match.params.userid);
|
|
|
|
|
// console.log("-----------------================-=-==-==");
|
|
|
|
|
// console.log(item.sender_id);
|
|
|
|
|
// console.log(this.props.match.params.userid);
|
|
|
|
|
return(
|
|
|
|
|
<div key={key}>
|
|
|
|
|
{
|
|
|
|
@ -342,6 +359,7 @@ class MessagChat extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</Spin>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|