nscc增加 加入社区和工作台跳转按钮
This commit is contained in:
parent
68961f0885
commit
c12369d373
|
|
@ -1,9 +1,12 @@
|
|||
import React , { useState , useEffect, Fragment } from 'react';
|
||||
import { Menu } from 'antd';
|
||||
import { Menu, message } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { tempConfig } from '../tempInfo';
|
||||
import TopEdition from './TopEdition'
|
||||
import leftImg from '../img/left.png';
|
||||
import MemberApply from './memberApply';
|
||||
import { memberStatusEnum } from '../Pages/zoneVIP';
|
||||
import { applyJoin, getAuditStatus } from '../api';
|
||||
|
||||
|
||||
|
||||
|
|
@ -11,8 +14,10 @@ function PublicBanner(props){
|
|||
const [ key , setKey ] = useState("1");
|
||||
const { deptId } = props.match.params;
|
||||
const { pathname } = props.history.location;
|
||||
const { data:{sectionHomepageShow, sectionHomepageTitle, sectionProjectShow,sectionDataSetShow,sectionDataSetTitle, sectionProjectTitle, sectionResourceShow, sectionResourceTitle, sectionCmsShow, sectionCmsTitle, sectionMemberShow, sectionMemberTitle, sectionHelperShow, sectionHelperTitle}, data , adminUrl, temp } = props;
|
||||
const { data:{sectionHomepageShow, sectionHomepageTitle, sectionProjectShow,sectionDataSetShow,sectionDataSetTitle, sectionProjectTitle, sectionResourceShow, sectionResourceTitle, sectionCmsShow, sectionCmsTitle, sectionMemberShow, sectionMemberTitle, sectionHelperShow, sectionHelperTitle}, data , adminUrl, temp, showLoginDialog, showNotification, checkIfLogin, id } = props;
|
||||
const isNSCC = deptId === "NSCC";
|
||||
const [ memberStatus , setMemberStatus] = useState(memberStatusEnum.notMember);
|
||||
const [ applyVisible , setApplyVisible ] = useState(false);
|
||||
|
||||
useEffect(()=>{
|
||||
if(pathname){
|
||||
|
|
@ -47,6 +52,49 @@ function PublicBanner(props){
|
|||
}
|
||||
},[pathname])
|
||||
|
||||
useEffect(()=>{
|
||||
if(id && deptId && deptId === "NSCC"){
|
||||
getMemberStatus()
|
||||
}
|
||||
},[id, deptId])
|
||||
|
||||
function getMemberStatus() {
|
||||
getAuditStatus(id).then(res => {
|
||||
if (res && res.data && res.data.code === 200) {
|
||||
setMemberStatus(res.data.data)
|
||||
} else {
|
||||
setMemberStatus(memberStatusEnum.notMember)
|
||||
}
|
||||
}).catch(() => { setMemberStatus(memberStatusEnum.notMember) })
|
||||
}
|
||||
|
||||
function onOk(e) {
|
||||
applyJoin(id, e).then(res => {
|
||||
if (res && res.data) {
|
||||
showNotification(res.data.msg)
|
||||
setApplyVisible(!applyVisible)
|
||||
if (res.data.code === 200) {
|
||||
setMemberStatus(memberStatusEnum.applying)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function apply() {
|
||||
if(checkIfLogin()===false){
|
||||
showLoginDialog()
|
||||
return false;
|
||||
}else if(memberStatus === memberStatusEnum.applying){
|
||||
message.info("您已提交申请,请耐心等待管理员审核!")
|
||||
return;
|
||||
}else if(memberStatus === memberStatusEnum.isMember){
|
||||
message.info("您已加入会员!")
|
||||
return;
|
||||
}else{
|
||||
setApplyVisible(!applyVisible)
|
||||
}
|
||||
}
|
||||
|
||||
return(
|
||||
<div className={`in_banner ${isNSCC ? "bannerByNSCC" : ""}`}>
|
||||
<TopEdition bannerList={ data && data.bannerList && data.bannerList.split(",") }></TopEdition>
|
||||
|
|
@ -56,11 +104,15 @@ function PublicBanner(props){
|
|||
{!isNSCC && <p className="main_t">{data.mainTitle}</p>}
|
||||
{isNSCC && <Fragment>
|
||||
<img src={require('../img/new.png').default} alt='' width={115}/>
|
||||
<p className="main_t_nscc mt5 pb10">
|
||||
<span className='title_n_1'>{data.mainTitle}</span>
|
||||
</p>
|
||||
<p className="main_t_nscc mt10 pb10">
|
||||
<span className='title_n_1'>{data.mainTitle}</span>
|
||||
</p>
|
||||
|
||||
</Fragment>}
|
||||
<p className="sub_t" dangerouslySetInnerHTML={{ __html: data.subTitle }}></p>
|
||||
{isNSCC && <div className='mt30'>
|
||||
<a className="zone_apply_but font-16 color-white" onClick={ apply }>加入社区<i class="iconfont icon-jiantou3 font-14 ml5"></i></a>
|
||||
</div>}
|
||||
</div>
|
||||
}
|
||||
{
|
||||
|
|
@ -100,6 +152,7 @@ function PublicBanner(props){
|
|||
{ adminUrl && <Menu.Item key={"7"}><a onClick={()=>{window.location.href=adminUrl}}><img src={require(`../img/${temp}Menu7.png`)} alt="" width="34px"/>后台管理</a></Menu.Item> }
|
||||
</Menu>
|
||||
</div>
|
||||
<MemberApply visible={applyVisible} onOk={ onOk } onCancel={() => setApplyVisible(!applyVisible)} current_user={props.current_user}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { getSpecialProjectDetail, getSpecialProjectList, getSpecialProjectTypeList, getImage, getSpecialReportList } from '../../../api';
|
||||
import { Col, Divider, Icon, Row, Tag } from 'antd';
|
||||
import React, { Fragment, useEffect, useState } from 'react';
|
||||
import { getSpecialProjectDetail, getSpecialProjectList, getSpecialProjectTypeList, getImage, getSpecialReportList, checkOpenedEnterprise } from '../../../api';
|
||||
import { Col, Divider, Icon, message } from 'antd';
|
||||
import Nodata from '../../../../Nodata';
|
||||
import '../index.scss';
|
||||
import ProjectVerticalSlider from './projectVerticalSlider';
|
||||
import { Link } from 'react-router-dom';
|
||||
function SpecialProjects({ data }) {
|
||||
import axios from 'axios';
|
||||
|
||||
function SpecialProjects({ data, showLoginDialog, checkIfLogin }) {
|
||||
const { key, homepageSpecialProjectTitle, id } = data || {};
|
||||
const [typeList, setTypeList] = useState([]);
|
||||
const [typeId, setTypeId] = useState(undefined);
|
||||
|
|
@ -78,13 +80,45 @@ function SpecialProjects({ data }) {
|
|||
const docId = {
|
||||
6: 1048
|
||||
}
|
||||
const orgId = {
|
||||
6: "Supercomputing",
|
||||
}
|
||||
return <div key={i} className={`proTypeBox_NSCC ${typeId === item.id && "active"}`}>
|
||||
<p className={`mb15 FlexAJ`} onClick={() => { setTypeId(item.id) }}>
|
||||
<span className={`flex1 task-hide-2 font-18 color131 break-word ${typeId === item.id ? "font-20 font-bd" : "pointer"}`}>{docId[item.id] ? <Link to={`/zone/${key}/newdetail/${docId[item.id]}`} className="color131">{item.name}</Link> : item.name}</span>
|
||||
{typeId !== item.id && <i className={`iconfont icon-shouqi ml40 color82880 pointer`}></i>}
|
||||
</p>
|
||||
{typeId === item.id && item.introduction && <div className='desc_spt mb30' dangerouslySetInnerHTML={{__html: item.introduction}}>
|
||||
</div>}
|
||||
{typeId === item.id && <Fragment>
|
||||
{item.introduction && <div className='desc_spt mb30' dangerouslySetInnerHTML={{__html: item.introduction}}></div>}
|
||||
{!!orgId[item.id] && <a className='gotoPM color-white' onClick={()=>{
|
||||
if(checkIfLogin()===false){
|
||||
showLoginDialog();
|
||||
return;
|
||||
}
|
||||
// 查询是否是组织成员
|
||||
axios.get(`/organizations/${orgId[item.id]}.json`).then(result=>{
|
||||
if(result && result.data){
|
||||
if(result.data.is_member){
|
||||
checkOpenedEnterprise(result.data.id).then(res=>{
|
||||
if(res && res.data.code === 200){
|
||||
const {isOpen, url} = res.data.data
|
||||
if(isOpen){
|
||||
window.open(url)
|
||||
}else if(result.data.is_admin){
|
||||
message.error(<span>组织未开通工作台,是否前往<a href={`/${orgId[item.id]}/enterprise`} className='color-blue ml5'>开通工作台</a></span>)
|
||||
}else{
|
||||
message.error("组织未开通工作台")
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
message.error("您不是组织成员,请先联系项目负责人加入组织")
|
||||
}
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}}>前往工作台<i class="iconfont icon-jiantou3 font-14 ml5"></i></a>}
|
||||
<Divider dashed style={{borderColor: '#C7CADA'}} className="mt35"/>
|
||||
</Fragment>}
|
||||
</div>
|
||||
})}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -663,8 +663,6 @@
|
|||
transition: height .5s;
|
||||
.desc_spt{
|
||||
padding-right: 30px;
|
||||
padding-bottom: 30px;
|
||||
border-bottom: 1px dashed #C7CADA;
|
||||
transition: height .3s ease-out;
|
||||
opacity: 1;
|
||||
animation: animation1 .3s ease-in-out .3s backwards;
|
||||
|
|
@ -672,6 +670,24 @@
|
|||
.proTypeBox_NSCC:hover .icon-shouqi{
|
||||
color: #131415;
|
||||
}
|
||||
.gotoPM{
|
||||
background-image:linear-gradient(95.71deg,#694dff 0%,#1d5bff 100%);
|
||||
border-radius:6px;
|
||||
transition: all 0.3s;
|
||||
padding: 12px 13px;
|
||||
letter-spacing: 1px;
|
||||
&:hover{
|
||||
background-image:linear-gradient(273.05deg,#694dff 0%,#1d5bff 100%);
|
||||
.icon-jiantou3{
|
||||
left: 5px;
|
||||
}
|
||||
}
|
||||
.icon-jiantou3{
|
||||
position: relative;
|
||||
left: 0px;
|
||||
transition: left .85s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
.carousel-row {
|
||||
align-items: center;
|
||||
|
|
@ -768,6 +784,7 @@
|
|||
overflow: hidden;
|
||||
border-radius:15px;
|
||||
z-index: 2;
|
||||
min-height: 150px;
|
||||
&:hover .firstDoc_Img{
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ function HeaderPageUos(props) {
|
|||
</span>
|
||||
</div>}
|
||||
</div>
|
||||
<SpecialProjectsByNSCC data={data} />
|
||||
<SpecialProjectsByNSCC data={data} {...props}/>
|
||||
<NewsByNSCC data={data}/>
|
||||
<ProjectByNSCC data={data} />
|
||||
<SourceByNSCC data={data} />
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {setZoneVisits} from '../api'
|
|||
|
||||
import '../indexZone1.scss';
|
||||
|
||||
const memberStatusEnum = {
|
||||
export const memberStatusEnum = {
|
||||
applying: '0',
|
||||
isMember: '1',
|
||||
notMember: '2'
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
|
|
@ -192,7 +192,7 @@ function Index(props){
|
|||
|
||||
return(
|
||||
<div className="information_main">
|
||||
{ (!sourcedetail && deptId!=="apply") && (id ? <PublicBanner {...props} data={data} temp={ temp } adminUrl={adminUrl}/> : <div style={{ width: '100%', height: '450px' }}></div>)}
|
||||
{ (!sourcedetail && deptId!=="apply") && (id ? <PublicBanner {...props} data={data} temp={ temp } adminUrl={adminUrl} id={id}/> : <div style={{ width: '100%', height: '450px' }}></div>)}
|
||||
<Switch>
|
||||
<Route
|
||||
path="/zone/:deptId/news/self"
|
||||
|
|
|
|||
|
|
@ -211,22 +211,41 @@
|
|||
line-height: normal;
|
||||
width: max-content;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
border-bottom: 1px solid transparent;
|
||||
border-image: linear-gradient(135deg,#72f4fc 0%,#4ac0f3 39.2%,#468bff 100%) 1;
|
||||
margin-bottom: -20px !important;
|
||||
// border-bottom: 1px solid transparent;
|
||||
// border-image: linear-gradient(135deg,#72f4fc 0%,#4ac0f3 39.2%,#468bff 100%) 1;
|
||||
// margin-bottom: -20px !important;
|
||||
}
|
||||
.title_n_1{
|
||||
font-size: 45px;
|
||||
font-size: 40px;
|
||||
background: linear-gradient(135deg,#72f4fc 0%,#beeaff 44.18%,#468bff 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
font-family: "ziyouwenyihei";
|
||||
}
|
||||
.sub_t{
|
||||
margin-top: 0px;
|
||||
font-size:18px;
|
||||
color:#ffffff;
|
||||
line-height: 36px;
|
||||
letter-spacing: 7px;
|
||||
letter-spacing: 5px;
|
||||
}
|
||||
.zone_apply_but{
|
||||
width: max-content;
|
||||
padding: 14px 28px;
|
||||
background-image: url('./img/button.png');
|
||||
background-size: 100% 100%;
|
||||
transition: all 0.3s;
|
||||
&:hover{
|
||||
background-image: url('./img/button1.png');
|
||||
.icon-jiantou3{
|
||||
left: 5px;
|
||||
}
|
||||
}
|
||||
.icon-jiantou3{
|
||||
position: relative;
|
||||
left: 0px;
|
||||
transition: left .85s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue