Merge branch 'dev_Ysl' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl
commit
e119f8195b
@ -1,62 +1,62 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
class UserSection extends Component {
|
class UserSection extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*点击关注或者取消关注*/
|
/*点击关注或者取消关注*/
|
||||||
AboutFocus(){
|
AboutFocus(){
|
||||||
const { author_info } = this.props
|
const { author_info } = this.props
|
||||||
/*http://localhost:3000/api/v1/users/155/watch?object_id=156&object_type=user*/
|
/*http://localhost:3000/api/v1/users/155/watch?object_id=156&object_type=user*/
|
||||||
|
|
||||||
const focusUrl = `/api/v1/users/${author_info.user_id}/${this.props.author_info.watched ? 'unwatch' : 'watch'}?object_id=${author_info.user_id}&object_type=user`
|
const focusUrl = `/api/v1/users/${author_info.user_id}/${this.props.author_info.watched ? 'unwatch' : 'watch'}?object_id=${author_info.user_id}&object_type=user`
|
||||||
|
|
||||||
axios.get(focusUrl,{
|
axios.get(focusUrl,{
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const status = response.data.status;
|
const status = response.data.status;
|
||||||
console.log(status);
|
console.log(status);
|
||||||
if(status == 1){
|
if(status == 1){
|
||||||
const new_author_info = Object.assign({}, this.props.author_info)
|
const new_author_info = Object.assign({}, this.props.author_info)
|
||||||
new_author_info.watched = !new_author_info.watched
|
new_author_info.watched = !new_author_info.watched
|
||||||
this.props.initForumState({author_info: new_author_info})
|
this.props.initForumState({author_info: new_author_info})
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { match, history, author_info , current_user } = this.props
|
const { match, history, author_info , current_user } = this.props
|
||||||
if (!author_info) {
|
if (!author_info) {
|
||||||
return <div className="edu-back-white" id="forum_index_list"></div>
|
return <div className="edu-back-white" id="forum_index_list"></div>
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="edu-back-white padding40-20 edu-txt-center">
|
<div className="edu-back-white padding40-20 edu-txt-center">
|
||||||
<a href={`/users/${author_info.login}`} target="_blank"><img src={`/images/${author_info.image_url}`} width="90" height="90" className="radius mb5"/></a>
|
<a href={`/users/${author_info.login}`} target="_blank"><img src={`/images/${author_info.image_url}`} width="90" height="90" className="radius mb5"/></a>
|
||||||
<p className="font-20 userPrivateName">{author_info.username}</p>
|
<p className="font-20 userPrivateName">{author_info.username}</p>
|
||||||
<p className="color-grey-9 userPrivatePost">{author_info.identity}</p>
|
<p className="color-grey-9 userPrivatePost">{author_info.identity}</p>
|
||||||
{ author_info.user_id !== current_user.user_id &&
|
{ author_info.user_id !== current_user.user_id &&
|
||||||
<p className="clearfix mt30">
|
<p className="clearfix mt30">
|
||||||
<a href="javascript:void(0)" className="fl font-16 mr10 user_default_btn edu-blueback-btn" onClick={()=>{this.AboutFocus()}}>{ author_info.watched == true ? "取消关注" : "关注" }</a>
|
<a href="javascript:void(0)" className="fl font-16 mr10 user_default_btn edu-blueback-btn" onClick={()=>{this.AboutFocus()}}>{ author_info.watched == true ? "取消关注" : "关注" }</a>
|
||||||
<a href={`/users/${current_user.login}/message_detail?user_id=${author_info.user_id}`} className="fr font-16 user_default_btn user_private_btn" target="_blank">私信</a>
|
<a href={`/message/${current_user.login}/message_detail?target_ids=${author_info.user_id}`} className="fr font-16 user_default_btn user_private_btn" target="_blank">私信</a>
|
||||||
</p> }
|
</p> }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default UserSection;
|
export default UserSection;
|
||||||
|
@ -1,93 +1,97 @@
|
|||||||
.navInfo{
|
.navInfo{
|
||||||
border:none!important;
|
border:none!important;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
bottom: -8px;
|
bottom: -8px;
|
||||||
}
|
}
|
||||||
.navInfo li {
|
.navInfo li {
|
||||||
float: left;
|
float: left;
|
||||||
margin: 0px 40px;
|
margin: 0px 40px;
|
||||||
padding:0px;
|
padding:0px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.navInfo li.active::after{
|
.navInfo li.active::after{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
height: 2px;
|
height: 2px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
content: '';
|
content: '';
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
background: #05101A!important;
|
background: #05101A!important;
|
||||||
color: #666!important;
|
color: #666!important;
|
||||||
}
|
}
|
||||||
.navInfo li,.navInfo li.ant-menu-item-active{
|
.navInfo li,.navInfo li.ant-menu-item-active{
|
||||||
border-bottom: none!important;
|
border-bottom: none!important;
|
||||||
color: #666!important;
|
color: #666!important;
|
||||||
}
|
}
|
||||||
.navInfo li.ant-menu-item-selected{
|
.navInfo li.ant-menu-item-selected{
|
||||||
border-bottom: 2px solid #05101A!important;
|
border-bottom: 2px solid #05101A!important;
|
||||||
color: #05101A!important;
|
color: #05101A!important;
|
||||||
}
|
}
|
||||||
.navInfo ul.ant-menu{float: left!important;border:none!important;}
|
.navInfo ul.ant-menu{float: left!important;border:none!important;}
|
||||||
|
|
||||||
.substancenenew{
|
.substancenenew{
|
||||||
width: 236px;
|
width: 236px;
|
||||||
height: 206px;
|
height: 206px;
|
||||||
background: rgba(248,248,248,1);
|
background: rgba(248,248,248,1);
|
||||||
border: 2px dotted rgba(225,225,225,1);
|
border: 2px dotted rgba(225,225,225,1);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding-top: 50px;
|
padding-top: 50px;
|
||||||
position: inherit;
|
position: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.substancepad{
|
.substancepad{
|
||||||
padding: 20px 20px 0px 20px;
|
padding: 20px 20px 0px 20px;
|
||||||
border-bottom: 1px solid transparent;
|
border-bottom: 1px solid transparent;
|
||||||
}
|
}
|
||||||
.substancefont{
|
.substancefont{
|
||||||
height:24px;
|
height:24px;
|
||||||
font-size:18px;
|
font-size:18px;
|
||||||
font-family:Microsoft YaHei;
|
font-family:Microsoft YaHei;
|
||||||
font-weight:400;
|
font-weight:400;
|
||||||
line-height:21px;
|
line-height:21px;
|
||||||
color:rgba(153,153,153,1);
|
color:rgba(153,153,153,1);
|
||||||
opacity:1;
|
opacity:1;
|
||||||
margin-top: -8px;
|
margin-top: -8px;
|
||||||
}
|
}
|
||||||
.topten{
|
.topten{
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
border: 2px soild rgba(225,225,225,1);
|
border: 2px soild rgba(225,225,225,1);
|
||||||
background: rgba(225,225,225,1);
|
background: rgba(225,225,225,1);
|
||||||
border: 1px solid rgba(225,225,225,1);
|
border: 1px solid rgba(225,225,225,1);
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
.leftten{
|
.leftten{
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background: rgba(225,225,225,1);
|
background: rgba(225,225,225,1);
|
||||||
border: 1px solid rgba(225,225,225,1);
|
border: 1px solid rgba(225,225,225,1);
|
||||||
margin: 0px auto;
|
margin: 0px auto;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 120px;
|
top: 120px;
|
||||||
left: 88px;
|
left: 88px;
|
||||||
}
|
}
|
||||||
.squarebox{
|
.squarebox{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*题库的标签--和资源标签样式相似*/
|
/*题库的标签--和资源标签样式相似*/
|
||||||
.bankTag{max-height: 82px;overflow-y: auto}
|
.bankTag{max-height: 82px;overflow-y: auto}
|
||||||
.bankTag #sourceTag li{margin-left: 0px;margin-right: 5px;}
|
.bankTag #sourceTag li{margin-left: 0px;margin-right: 5px;}
|
||||||
.bank_list_Tag{cursor: default}
|
.bank_list_Tag{cursor: default}
|
||||||
/*资源标签*/
|
/*资源标签*/
|
||||||
#sourceTag li,.bank_list_Tag{font-size: 12px;color: #4E7A9B;background-color: #E5F3FF;padding: 0px 4px;height: 20px;line-height: 20px; margin-left: 5px;display: inline-block;cursor: pointer;margin-bottom: 5px;}
|
#sourceTag li,.bank_list_Tag{font-size: 12px;color: #4E7A9B;background-color: #E5F3FF;padding: 0px 4px;height: 20px;line-height: 20px; margin-left: 5px;display: inline-block;cursor: pointer;margin-bottom: 5px;}
|
||||||
#sourceTag li a{color: #4e7a9b!important;}
|
#sourceTag li a{color: #4e7a9b!important;}
|
||||||
#sourceTag li.active{background-color: #4CACFF;color: #fff;}
|
#sourceTag li.active{background-color: #4CACFF;color: #fff;}
|
||||||
#sourceTag li.active a{background-color: #4CACFF;color: #fff!important;}
|
#sourceTag li.active a{background-color: #4CACFF;color: #fff!important;}
|
||||||
|
|
||||||
|
.mtf15{
|
||||||
|
margin-top:-15px;
|
||||||
|
}
|
Loading…
Reference in new issue