dev_cs_new
杨树林 6 years ago
parent b171aa35af
commit 6630cae57f

@ -18,9 +18,9 @@ import Notcompletedysl from './modules/user/Notcompletedysl';
import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from"./modules/user/AccountProfile";
import AccountProfile from "./modules/user/AccountProfile";
import Messagerouting from "./modules/message/js/Messagerouting";
import Trialapplication from './modules/login/Trialapplication'
import NotFoundPage from './NotFoundPage'
@ -377,7 +377,7 @@ class App extends Component {
<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>
<Route path="/testRCComponent" component={TestComponent}/>
<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>
<Route path="/message" component={Messagerouting}></Route>
{/* <Route component={NotFoundPage}/> */}
{/*列表页*/}
{/*<Route component={TPMShixunsIndexComponent}/>*/}

@ -0,0 +1,6 @@
.myw120{
width: 120px;
}
.myh120{
height: 120px;
}

@ -0,0 +1,21 @@
import React, { Component } from 'react';
//私信聊天页面
class MessagChat extends Component{
constructor(props) {
super(props);
this.state={
}
}
componentDidMount(){
}
render() {
return (
<div>
</div>
)
}
}
export default MessagChat;

@ -0,0 +1,125 @@
import React, { Component } from 'react';
import {
Spin,
Pagination,
} from "antd";
import axios from 'axios';
//消息页面
class MessagSub extends Component{
constructor(props) {
super(props);
this.state={
page:1,
limit:10,
typeysl:"",
count:0,
isSpin:true,
}
}
// 初始化数据
componentDidMount(){
debugger
console.log("初始化数据了");
this.getdata("",this.state.page);
}
//塞选页数
paginationonChanges=(pageNumber)=>{
this.setState({
page: pageNumber,
})
this.getdata(this.state.typeysl,pageNumber);
}
//获取数据源
getdata=(types,page)=>{
this.setState({
isSpin:true,
})
let{limit}=this.state;
let url = `/users/tidings.json`;
axios.get((url),{params:{
type:types,
page:page,
per_page:limit,
}}).then((result) => {
if (result) {
console.log(types);
console.log(result);
if(result.data.message!==undefined){
console.log("5151515151");
return;
}
console.log("调用了消失的方法");
console.log("5454545454");
this.setState({
count:result.data.count,
typeysl:types,
isSpin:false,
})
}
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
})
})
}
componentWillUnmount(){
// 卸载异步操作设置状态
this.setState = (state, callback) => {
return;
}
}
render() {
let{page,limit,typeysl,count,isSpin}=this.state;
console.log("6868686868");
console.log(isSpin);
return (
<div className="clearfix ml20">
{/*头部筛选数据*/}
<ul className="pl10 ridingNav clearfix edu-back-white">
<li className={typeysl===""?"active":""}><a onClick={()=>this.getdata("")}>全部消息</a></li>
<li className={typeysl&&typeysl==="course"?"active":""} ><a onClick={()=>this.getdata("course")}>课堂提醒</a></li>
<li className={typeysl&&typeysl==="project"?"active":""} ><a onClick={()=>this.getdata("project")}>项目提醒</a></li>
<li className={typeysl&&typeysl==="project_package"?"active":""}><a onClick={()=>this.getdata("project_package")}>众包</a></li>
<li className={typeysl&&typeysl==="apply"?"active":""}><a onClick={()=>this.getdata("apply")}>审核</a></li>
<li className={typeysl&&typeysl==="system"?"active":""}><a onClick={()=>this.getdata("system")}>通知</a></li>
<li className={typeysl&&typeysl==="interactive"?"active":""}><a onClick={()=>this.getdata("interactive")}>互动提醒</a></li>
</ul>
{/*下面内容页面*/}
<div className="bor-top-greyE">
{/*这里可以进行数据处理*/}
<Spin size="large" spinning={isSpin}>
<div className="pl25 ridinglist edu-back-white">
</div>
</Spin>
{/*页数*/}
<div style={{textAlign:"center"}} class="new_expand mt10">
<div className="edu-txt-center mt30">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={count}></Pagination>
</div>
</div>
</div>
</div>
)
}
}
export default MessagSub;

@ -0,0 +1,21 @@
import React, { Component } from 'react';
//私信页面
class MessagePrivate extends Component{
constructor(props) {
super(props);
this.state={
}
}
componentDidMount(){
}
render() {
return (
<div>
</div>
)
}
}
export default MessagePrivate;

@ -0,0 +1,77 @@
import React, { Component } from 'react';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Input,Pagination,Tooltip} from 'antd';
import {TPMIndexHOC} from "../../../modules/tpm/TPMIndexHOC";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
import axios from 'axios';
import MessagSub from "./MessagSub";
import MessagePrivate from "./MessagePrivate";
import MessagChat from "./MessagChat";
import "../css/messagemy.css"
// MessagSub 消息自路由
// MessagePrivate 私信
class Messagerouting extends Component{
constructor(props) {
super(props);
this.state={
routing:1,
}
}
componentDidMount(){
}
// 切换路由
SwitchonClick=(value)=>{
this.setState({
routing:value,
})
}
render() {
let{routing} =this.state;
return (
<div className="newMain clearfix">
<div className="educontent mt20 mb80 clearfix">
{/*左边*/}
<div className="leftPanel">
{/*头像*/}
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
<a>
<img className="person radius myw120 myh120" src={"/images/avatars/User/71519?1564061748"}/>
</a>
<p className="font-24 lineh-25 mt10" >杨树林</p>
<p className="color-grey-6 mt5" >工程师</p>
</div>
{/*路由跳转*/}
<ul className="edu-back-white">
<li className={routing ===1?"nav pr active":"nav pr"}>
<a onClick={(value)=>this.SwitchonClick(1)}>消息</a>
</li>
<li className={routing ===2?"nav pr active":"nav pr"}>
<a onClick={(value)=>this.SwitchonClick(2)}>私信</a>
</li>
</ul>
</div>
{/*右边*/}
<div className="rightPanel">
<div className="clearfix ml20">
{/*消息自路由*/}
{routing===1?<MessagSub></MessagSub> :""}
{/*私信*/}
{routing===2?<MessagePrivate></MessagePrivate> :""}
{/*私信聊天页面*/}
{routing===3?<MessagChat></MessagChat>:""}
</div>
</div>
</div>
</div>
)
}
}
export default SnackbarHOC() (TPMIndexHOC ( Messagerouting ));

@ -265,6 +265,9 @@ export function TPMIndexHOC(WrappedComponent) {
"tidding_count": 0
}
*/
if(response=== undefined){
return
}
if (response.data) {
this.initCommonState(response.data)
this.setState({

@ -14,12 +14,12 @@ import './common.css'
import './commontwo.css'
const { TabPane } = Tabs;
const loginInputsyl = {
"width":"434px",
"height": "462px",
"-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"border-radius": "6px",
"background": "#fff"
"width":"434px",
"height": "462px",
"-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"border-radius": "6px",
"background": "#fff"
}
//父组件EducoderLogin.js
@ -66,6 +66,7 @@ class LoginRegisterComponent extends Component {
pciphone:true,
MyEduCoderModals:false,
registered:undefined,
Phonenumberisnotcodmms:undefined,
}
}
@ -103,6 +104,7 @@ class LoginRegisterComponent extends Component {
pciphone:true,
MyEduCoderModals:false,
registered:undefined,
Phonenumberisnotcodmms:undefined,
}
}
@ -162,7 +164,7 @@ class LoginRegisterComponent extends Component {
StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool(3);
// this.props.Setlogins(3);
this.setState({
login: "",
@ -170,7 +172,12 @@ class LoginRegisterComponent extends Component {
logins: "",
passwords: "",
codes: "",
})
});
try {
this.props.Setshowbool(3);
}catch (e) {
}
}
onTabChange = (activeKey) => {
console.log("onTabChange");
@ -294,6 +301,7 @@ class LoginRegisterComponent extends Component {
//登入接口
postLogin = () => {
if (this.state.login === undefined || this.state.login == "") {
this.setState({
Phonenumberisnotco:"账号不能为空",
@ -310,24 +318,25 @@ class LoginRegisterComponent extends Component {
login: this.state.login,
password: this.state.password,
}).then((response) => {
debugger
if (response === undefined) {
return
}
if(response.data.status === -2){
if("该手机号尚未注册" || "该邮箱尚未注册"){
if(response.data.message==="该手机号尚未注册" || response.data.message==="该邮箱尚未注册"){
this.setState({
Phonenumberisnotco:response.data.message,
})
return;
}
else if("错误的账号或密码"){
else if(response.data.message==="错误的账号或密码"){
this.setState({
Phonenumberisnotco:response.data.message,
Phonenumberisnotcodmms:response.data.message,
})
return;
}
else if("违反平台使用规范,账号已被锁定"){
else if(response.data.message==="违反平台使用规范,账号已被锁定"){
this.setState({
Phonenumberisnotco:response.data.message,
})
@ -660,12 +669,14 @@ class LoginRegisterComponent extends Component {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
Phonenumberisnotcodmms:undefined,
login: stirngt,
})
}else{
this.setState({
login: stirngt,
Phonenumberisnotco:undefined,
Phonenumberisnotcodmms:undefined,
})
}
@ -798,6 +809,7 @@ class LoginRegisterComponent extends Component {
this.setState({
password: stirngt,
Phonenumberisnotcodmm:undefined,
Phonenumberisnotcodmms:undefined,
})
// this.setState({
// password: e.target.value
@ -916,6 +928,7 @@ class LoginRegisterComponent extends Component {
// 注册
readAgreement,
pciphone,
Phonenumberisnotcodmms,
} = this.state
// height: 346px;
if (this.state.seconds === 0) {
@ -1008,7 +1021,14 @@ class LoginRegisterComponent extends Component {
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcodmm}</span>
</p>
: <div style={{height:"25px"}}></div>
: (Phonenumberisnotcodmms=== undefined?<div style={{height:"25px"}}></div>:"")
}
{
Phonenumberisnotcodmms && Phonenumberisnotcodmms != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcodmms}</span>
</p>
: ""
}
<div className="left_right font-12 " style={{color: '#676767'}}>

Loading…
Cancel
Save