diff --git a/public/react/src/modules/message/js/Leftdialogue.js b/public/react/src/modules/message/js/Leftdialogue.js new file mode 100644 index 000000000..95ef00188 --- /dev/null +++ b/public/react/src/modules/message/js/Leftdialogue.js @@ -0,0 +1,57 @@ +import React, { Component } from 'react'; +import { + Spin, + Pagination, +} from "antd"; +import axios from 'axios'; +import moment from 'moment'; +import {getImageUrl} from 'educoder'; +import "../css/messagemy.css" +import WriteaprivateletterModal from '../messagemodal/WriteaprivateletterModal'; +//私信页面 +class Leftdialogue extends Component{ + constructor(props) { + super(props); + this.state={ + }; + + } + + componentDidMount(){ + console.log("Leftdialogue"); + console.log(this.props); + }; + componentDidUpdate(prevProps) { + // console.log("11111111111"); + // console.log(prevProps); + // console.log("22222222222"); + // console.log(this.props); + // console.log("33333333333"); + // if(prevProps.current_user !== this.props.current_user){ + // this.getdata(1); + // } + } + //获取数据地方 + + // 跳转页面 + + render() { + let{page,limit,typeysl,count,isSpin,data,modalsType}=this.state; + + return ( +
+ ) + } +} +export default Leftdialogue; +// onClick="delete_confirm_box('/users/innov/delete_message?mess_id=25148', '确定要删除该条记录吗?')" \ No newline at end of file diff --git a/public/react/src/modules/message/js/MessagChat.js b/public/react/src/modules/message/js/MessagChat.js index c390a5ec0..9bc97cb43 100644 --- a/public/react/src/modules/message/js/MessagChat.js +++ b/public/react/src/modules/message/js/MessagChat.js @@ -4,8 +4,9 @@ import {getImageUrl} from 'educoder'; import { Modal,Input,Icon,Tooltip,Spin} from 'antd'; import axios from 'axios'; import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; - import moment from 'moment'; +import Rightdialogue from './Rightdialogue' +import Leftdialogue from './Leftdialogue' //私信聊天页面 class MessagChat extends Component{ constructor(props) { @@ -17,14 +18,20 @@ class MessagChat extends Component{ limit:20, page:1, datay:[], + limits:20, mess:false, + myuserl:[], + pages:1, + mypagey:20, + messages:[], + objc:[], } } - componentDidMount(){ this.getdata(1); - this.getChatList(1) + let target_ids=this.props.match.params.private; + this.getChatList(1,this.state.limit,target_ids); // console.log("MessagChat111111"); console.log(this.props.myysluser); this.setState({ @@ -35,6 +42,10 @@ class MessagChat extends Component{ }catch (e) { } + console.log("MessagChat111111"); + console.log(this.props); + console.log(this.props.match.params.userid); + } // 滑动刷新 contentViewScrolledit=(e)=>{ @@ -45,32 +56,43 @@ class MessagChat extends Component{ let {page}=this.state; let newpage=page+1 this.getdata(newpage); + let ls=newpage*20 + this.setState({ + limits:ls, + }) } }; - getChatList=(page)=>{ + getChatList=(page,listl,target_ids)=>{ this.setState({ isSpins:true, }); - let target_ids=this.props.match.params.userid; - let url = `/users/${this.props.current_user&&this.props.current_user.user_id}/private_message_details.json`; - + let url = `/users/${this.props.match.params.userid}/private_message_details.json`; axios.get((url),{params:{ target_id:target_ids, page: page, - per_page:20, + per_page:listl, }}).then((result) => { if (result) { if(result.data.message!==undefined){ return; } + var datas=[] + var datay=result.data.messages; + for (var i=0;ithis.smyJump(2)}> - {myyslusers!==undefined?myyslusers.name:""}与你的私信 + {myuserl!==undefined?myuserl.name:""}与你的私信
{/*聊天页面*/}2019/07/20
- {/*右边*/} - + { + messages===undefined? + "" + :messages.map((item,key)=>{ + console.log("-----------------================-=-==-=="); + console.log(item.sender_id); + console.log(this.props.match.params.userid); + return( +2019/07/20
+ { + parseInt(item.sender_id)===parseInt(this.props.match.params.userid)? +