Merge pull request '关注页面issue+个人资料弹框漏掉的按钮' (#39) from caishi/forgeplus-react:feature_router into feature_router

This commit is contained in:
jasder 2021-09-03 11:32:40 +08:00
commit 9d2dc3426c
12 changed files with 57 additions and 21 deletions

View File

@ -25,7 +25,7 @@ if (isDev) {
} }
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' : window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
} }
window._debugType = debugType; window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {

View File

@ -3,6 +3,7 @@ import Modals from '../PublicModal/Index';
import { Button } from 'antd'; import { Button } from 'antd';
import axios from 'axios'; import axios from 'axios';
import ProfileImg from './images/profile.png';
import './Index.scss'; import './Index.scss';
function ProfileModal({visible,onCancel,history}) { function ProfileModal({visible,onCancel,history}) {
@ -57,7 +58,7 @@ function ProfileModal({visible,onCancel,history}) {
} }
> >
<div className="contents"> <div className="contents">
<i className="iconfont icon-gerenziliao1 font-44" style={{color:"#466AFF"}}></i> <img src={ProfileImg} alt=""/>
{ {
addMemberCheck ? addMemberCheck ?
<p>目标用户个人资料不完整需提醒目标用户补充资料后以进行后续操作</p> <p>目标用户个人资料不完整需提醒目标用户补充资料后以进行后续操作</p>

View File

@ -3,8 +3,9 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin:10px auto 0px; margin:10px auto 0px;
i{ img{
margin-right: 13px; margin-right: 13px;
width: 44px;
} }
p{ p{
line-height: 29px; line-height: 29px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -269,7 +269,7 @@ class NewHeader extends Component {
) )
}) })
} }
<li><Link to={`/settings/SSH`}>设置</Link></li> <li><Link to={`/settings/profile`}>设置</Link></li>
<Menu.Item><a onClick={() => this.educoderloginysl()}>退出</a></Menu.Item> <Menu.Item><a onClick={() => this.educoderloginysl()}>退出</a></Menu.Item>
</Menu> </Menu>
) )

View File

@ -39,14 +39,14 @@ function Index(props){
<img src={getImageUrl(`/${current_user && current_user.image_url}`)} alt=""/> <img src={getImageUrl(`/${current_user && current_user.image_url}`)} alt=""/>
<span>{current_user && current_user.username}</span> <span>{current_user && current_user.username}</span>
</div> </div>
<ul className="securityUl">
<li>安全设置</li>
<li className={pathname.indexOf("/settings/SSH")>-1 ?"active":""}><Link to={`/settings/SSH`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i>SSH密钥</Link></li>
</ul>
<ul className="securityUl"> <ul className="securityUl">
<li>个人信息</li> <li>个人信息</li>
<li className={pathname.indexOf("/settings/profile")>-1 ?"active":""}><Link to={`/settings/profile`}><i className="iconfont icon-gerenziliao mr5 font-14"></i>基本资料</Link></li> <li className={pathname.indexOf("/settings/profile")>-1 ?"active":""}><Link to={`/settings/profile`}><i className="iconfont icon-gerenziliao mr5 font-14"></i>基本资料</Link></li>
</ul> </ul>
<ul className="securityUl">
<li>安全设置</li>
<li className={pathname.indexOf("/settings/SSH")>-1 ?"active":""}><Link to={`/settings/SSH`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i>SSH密钥</Link></li>
</ul>
</div> </div>
<LongWidth> <LongWidth>
<Gap> <Gap>

View File

@ -3,7 +3,7 @@ import axios from "axios";
import { Button } from "antd"; import { Button } from "antd";
import "./list.css"; import "./list.css";
function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc}){ function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc,notReset}){
const [ isSpin , setIsSpin ] = useState(false); const [ isSpin , setIsSpin ] = useState(false);
const [ watchFlag , setWatchFlag ] = useState(is_watch); const [ watchFlag , setWatchFlag ] = useState(is_watch);
// 关注和取消关注 // 关注和取消关注
@ -19,7 +19,8 @@ function FocusButton({is_watch , fontClass, starText, is_block , id , successFun
}).then((result) => { }).then((result) => {
if (result && result.data.status === 0) { if (result && result.data.status === 0) {
successFunc && successFunc(); successFunc && successFunc();
if(!flag){ console.log(notReset);
if(notReset){
setWatchFlag(!watchFlag); setWatchFlag(!watchFlag);
} }
} }

View File

@ -6,7 +6,8 @@ import { Button } from "antd";
import "./list.css"; import "./list.css";
class UserList extends Component { class UserList extends Component {
renderList = (users, userClass, current_user, type_title , successFunc) => { renderList = (users, userClass, current_user, type_title , successFunc , notReset) => {
console.log("user:",notReset)
if (users && users.length > 0) { if (users && users.length > 0) {
return users.map((item, key) => { return users.map((item, key) => {
return ( return (
@ -43,7 +44,7 @@ class UserList extends Component {
current_user && current_user.login === item.login ? current_user && current_user.login === item.login ?
<Button type="default">当前用户</Button> <Button type="default">当前用户</Button>
: :
<FocusButton is_watch={item.is_watch} id={item.login} successFunc={successFunc}/> <FocusButton is_watch={item.is_watch} notReset={notReset} id={item.login} successFunc={successFunc}/>
} }
</div> </div>
</div> </div>
@ -53,9 +54,9 @@ class UserList extends Component {
} }
} }
render() { render() {
const { users, userClass, current_user , type_title , successFunc } = this.props; const { users, userClass, current_user , type_title , successFunc , notReset } = this.props;
return ( return (
this.renderList(users, userClass, current_user, type_title , successFunc) this.renderList(users, userClass, current_user, type_title , successFunc , notReset)
); );
} }
} }

View File

@ -2,10 +2,11 @@ import React, { useEffect, useState } from 'react';
import { Modal , Checkbox , Spin , Input } from 'antd'; import { Modal , Checkbox , Spin , Input } from 'antd';
import Axios from 'axios'; import Axios from 'axios';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import CheckProfile from '../../Component/ProfileModal/Profile';
const { Search } = Input; const { Search } = Input;
const limit = 20; const limit = 20;
function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) { function ConcentrateBox({ visible , onCancel , onSure , username , choosed , history , showCompeleteDialog , completeProfile }) {
const [ page , setPage ]= useState(1); const [ page , setPage ]= useState(1);
const [ total , setTotal ]= useState(0); const [ total , setTotal ]= useState(0);
const [ pageSize , setPageSize ] = useState(false); const [ pageSize , setPageSize ] = useState(false);
@ -164,7 +165,16 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) {
</Checkbox.Group> </Checkbox.Group>
</div> </div>
{ total > limit && page < pageSize && <div className="morelist" onClick={()=>setPage(page+1)}>查看更多</div> } { total > limit && page < pageSize && <div className="morelist" onClick={()=>setPage(page+1)}>查看更多</div> }
{ (list && list.length === 0) && (copyList && copyList.length === 0) && <div style={{textAlign:"center"}}>您还没有公开的{search && `${search}`}项目先去<Link to={`/projects/deposit/new`} className="color-blue">新建项目</Link></div> } {
(list && list.length === 0) && (copyList && copyList.length === 0) &&
<div style={{textAlign:"center"}}>您还没有公开的{search && `${search}`}项目先去
<CheckProfile
showCompeleteDialog={showCompeleteDialog}
completeProfile={completeProfile}
sureFunc={()=>{history.push(`/projects/deposit/new`)}}
className="color-blue">新建项目</CheckProfile>
</div>
}
</Spin> </Spin>
</Modal> </Modal>
) )

View File

@ -4,7 +4,7 @@ import { Link } from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import Box from './ConcentrateBox'; import Box from './ConcentrateBox';
function ConcentrateProject({userLogin,current}) { function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfile}) {
const [ list , setList ] = useState(undefined); const [ list , setList ] = useState(undefined);
const [ visible , setVisible ] = useState(false); const [ visible , setVisible ] = useState(false);
const [ value , setValue ] = useState([]); const [ value , setValue ] = useState([]);
@ -45,7 +45,15 @@ function ConcentrateProject({userLogin,current}) {
} }
return( return(
<React.Fragment> <React.Fragment>
<Box visible={visible} onCancel={()=>setVisible(false)} onSure={onSure} username={userLogin} choosed={value}/> <Box
visible={visible}
onCancel={()=>setVisible(false)}
onSure={onSure}
username={userLogin}
choosed={value}
completeProfile={completeProfile}
showCompeleteDialog={showCompeleteDialog}
/>
{ {
list && list.length>0 && list && list.length>0 &&
<div className="concentrate"> <div className="concentrate">

View File

@ -99,7 +99,11 @@ function Index(props) {
return( return(
<div> <div>
<div> <div>
<ConcentrateProject userLogin={username} current={current_user && (current_user.login === username)}/> <ConcentrateProject
{...props}
userLogin={username}
current={current_user && (current_user.login === username)}
/>
</div> </div>
<div className="recentStatic"> <div className="recentStatic">
<p className="font-18 mb15">近期活动统计</p> <p className="font-18 mb15">近期活动统计</p>

View File

@ -91,7 +91,10 @@ class CommonList extends Component {
<Spin spinning={isSpin}> <Spin spinning={isSpin}>
<div className="minH-670"> <div className="minH-670">
<div className="grid-item pb20 bbt"> <div className="grid-item pb20 bbt">
<h3 style={{marginBottom:"0px"}}><Link to={`/${login}`} ><i className="iconfont icon-zuojiantou color-grey-9 font-16 mr8"></i></Link>{userType === "watch_users" ? `${title_type}` : `${title_type}`}</h3> <h3 style={{marginBottom:"0px"}}>
<Link to={`/${login}`} ><i className="iconfont icon-zuojiantou color-grey-9 font-16 mr8"></i></Link>
{userType === "watch_users" ? `${title_type}关注的` : `关注${title_type}`}
</h3>
<div className="text-right"> <div className="text-right">
<Search <Search
placeholder="输入名称进行搜索" placeholder="输入名称进行搜索"
@ -107,7 +110,14 @@ class CommonList extends Component {
{users && users.length > 0 ? ( {users && users.length > 0 ? (
<div className="w-100 inline-block"> <div className="w-100 inline-block">
<UserList users={users} userClass={"w-33"} type_title={'关注列表'} current_user={current_user} successFunc={this.successFunc}></UserList> <UserList
users={users}
userClass={"w-33"}
type_title={'关注列表'}
current_user={current_user}
successFunc={this.successFunc}
notReset={userType === "watch_users"?false:true}
/>
</div> </div>
) : ( ) : (
<Nodata _html={`暂时没有数据~`} /> <Nodata _html={`暂时没有数据~`} />