forked from Gitlink/forgeplus-react
工程认证弹框
This commit is contained in:
parent
bd7e1b2742
commit
c801666b62
|
@ -24,6 +24,18 @@ export function getImageUrl(path) {
|
|||
return `${path}`;
|
||||
}
|
||||
|
||||
|
||||
export function openNewWindow(url) {
|
||||
let link = document.createElement('a')
|
||||
link.target = "_blank"
|
||||
document.body.appendChild(link)
|
||||
link.href = url
|
||||
let evt = document.createEvent("MouseEvents")
|
||||
evt.initEvent("click", false, false)
|
||||
link.dispatchEvent(evt)
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
|
||||
export function numFormat(num, digits){
|
||||
let d = digits || 1;
|
||||
var si = [
|
||||
|
|
|
@ -7,6 +7,7 @@ export {
|
|||
getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
|
||||
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
|
||||
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl
|
||||
, openNewWindow as openNewWindow
|
||||
} from './UrlTool';
|
||||
|
||||
export { setmiyah as setmiyah } from './Component';
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
import React from 'react';
|
||||
import { Modal } from 'antd';
|
||||
import { openNewWindow } from 'educoder';
|
||||
|
||||
function Engineer({QQVisible,setQQVisible}) {
|
||||
|
||||
return(
|
||||
<Modal
|
||||
centered
|
||||
destroyOnClose={true}
|
||||
visible={QQVisible}
|
||||
title="提示"
|
||||
width="500px"
|
||||
// footer={null}ee
|
||||
okText="立即联系"
|
||||
cancelText="取消"
|
||||
onOk={() => {
|
||||
openNewWindow("https://qm.qq.com/cgi-bin/qm/qr?k=DWdqQHAbbfw7_rqm0d-Q_vDn5H6bMp91&jump_from=webapi")
|
||||
}}
|
||||
onCancel={() => setQQVisible(false)}
|
||||
>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
|
||||
<p>您可以在QQ服务群向管理员申请,获得继续操作的权限</p >
|
||||
< img src={require("./teacherQQ.png")} width={200} height={200} alt=""/>
|
||||
<p>群号:693542422 </p >
|
||||
</div>
|
||||
</Modal >
|
||||
)
|
||||
}
|
||||
export default Engineer
|
|
@ -1,9 +1,8 @@
|
|||
import React, { Component } from 'react';
|
||||
import AccountProfile from "../../modules/user/AccountProfile";
|
||||
import { getImageUrl } from 'educoder'
|
||||
import { getImageUrl , openNewWindow } from 'educoder';
|
||||
import axios from 'axios';
|
||||
import { Input , notification , Dropdown ,Popover, Menu,Badge, Button } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Input , notification , Dropdown , Menu } from 'antd';
|
||||
|
||||
import LoginDialog from '../../modules/login/LoginDialog';
|
||||
import HeadSearch from '../Component/HeadSearch';
|
||||
|
@ -13,7 +12,7 @@ import '../../modules/tpm/TPMIndex.css';
|
|||
import CheckProfile from '../Component/ProfileModal/Profile';
|
||||
|
||||
import './header.scss';
|
||||
import NoticeContent from './NoticeContent';
|
||||
import Engineer from './Engineer';
|
||||
const $ = window.$
|
||||
// TODO 这部分脚本从公共脚本中直接调用
|
||||
const { Search } = Input;
|
||||
|
@ -49,6 +48,7 @@ class NewHeader extends Component {
|
|||
visiblemyss: false,
|
||||
openSearch:false,
|
||||
visible:false, //浮动消息框展示控制
|
||||
QQVisible:false
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
|
@ -346,14 +346,32 @@ class NewHeader extends Component {
|
|||
this.setState({ visible });
|
||||
};
|
||||
|
||||
turntoEngineer=(url)=>{
|
||||
const { current_user } = this.props;
|
||||
if(current_user && current_user.login){
|
||||
if(url){
|
||||
window.location.href=url;
|
||||
}else{
|
||||
this.setState({
|
||||
QQVisible:true
|
||||
})
|
||||
}
|
||||
}else{
|
||||
this.educoderlogin();
|
||||
}
|
||||
}
|
||||
|
||||
setQQVisible=()=>{
|
||||
this.setState({
|
||||
QQVisible:false
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { match ,resetUserInfo ,showNotification} = this.props;
|
||||
const { match } = this.props;
|
||||
let current_user = this.props.user;
|
||||
let { Addcoursestypes,
|
||||
tojoinitemtype,
|
||||
tojoinclasstitle,
|
||||
code_notice,
|
||||
checked_notice,
|
||||
let {
|
||||
QQVisible,
|
||||
AccountProfiletype,
|
||||
user,
|
||||
isRender,
|
||||
|
@ -441,6 +459,7 @@ class NewHeader extends Component {
|
|||
let search_url = settings && settings.common && settings.common.search;
|
||||
return (
|
||||
<div className="newHeaders" id="nHeader">
|
||||
<Engineer QQVisible={QQVisible} setQQVisible={this.setQQVisible}/>
|
||||
<div className="headerContent">
|
||||
{isRender === true ?
|
||||
<LoginDialog
|
||||
|
@ -496,6 +515,13 @@ class NewHeader extends Component {
|
|||
)
|
||||
})
|
||||
}
|
||||
{
|
||||
settings && settings.engineer_url !== undefined ?
|
||||
<li>
|
||||
<a onClick={()=>this.turntoEngineer(settings.engineer_url)}>工程认证</a>
|
||||
</li>
|
||||
:""
|
||||
}
|
||||
</ul>
|
||||
: ""
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
|
@ -121,8 +121,9 @@
|
|||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
padding:25px 30px;
|
||||
padding:0px 30px;
|
||||
border-bottom: 1px solid #E0E0E0;
|
||||
height: 62px;
|
||||
}
|
||||
.list-r-Search{
|
||||
width: 400px;
|
||||
|
|
Loading…
Reference in New Issue