diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index c2a40c98b..fa82f3045 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -1266,14 +1266,16 @@ a.shixun-task-btn { /*-------------学员统计 通关排行榜------------*/ -/*-----------实训配置、评测脚本-------------*/body { +/*-----------实训配置、评测脚本-------------*/ +html body { font-size: 14px; line-height: 2.0; - background: #fafafa !important; + background: #fafafa; font-family: "微软雅黑", "宋体"; color: #05101a; height: 100%; position: relative; + padding-right: 0px!important; } html, diff --git a/src/App.js b/src/App.js index b2a84807e..717b52761 100644 --- a/src/App.js +++ b/src/App.js @@ -19,7 +19,7 @@ import Certifiedprofessional from './modules/modals/Certifiedprofessional'; import Loading from './Loading' import Loadable from 'react-loadable'; -import marked from './common/marked'; +import marked from './common/marked'; import moment from 'moment' import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles'; @@ -83,7 +83,7 @@ class App extends Component { mygetHelmetapi: null, } } - + HideAddcoursestypess = (i) => { this.setState({ Addcoursestype: false, @@ -217,35 +217,35 @@ class App extends Component { - {/*项目*/} - { - return () - } - }> - + {/*项目*/} + { + return () + } + }> + {/*403*/} - { - return () - } - }> - + { + return () + } + }> + {/*404*/} - {/* 个人主页 */} + {/* 个人主页 */} { - return () + return () } - }> + }> ( diff --git a/src/AppConfig.js b/src/AppConfig.js index e07996277..12abacae9 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -123,15 +123,15 @@ export function initAxiosInterceptors(props) { let url = `/api${config.url}`; //qq登录去掉api - if (config.params && config.params.redirect_uri != undefined) { - if (config.params.redirect_uri.indexOf('otherloginqq') != -1) { + if (config.params && config.params.redirect_uri !== undefined) { + if (config.params.redirect_uri.indexOf('otherloginqq') !== -1) { url = `${config.url}`; } } - if (`${config[0]}` != `true`) { + if (`${config[0]}` !== `true`) { if (window.location.port === "3007") { config.url = `${proxy}${url}`; - if (config.url.indexOf('?') == -1) { + if (config.url.indexOf('?') === -1) { config.url = `${config.url}?debug=${debugType}`; } else { config.url = `${config.url}&debug=${debugType}`; diff --git a/src/forge/Component/Title.jsx b/src/forge/Component/Title.jsx index a9d1ad37a..9b3f8bf3f 100644 --- a/src/forge/Component/Title.jsx +++ b/src/forge/Component/Title.jsx @@ -7,6 +7,9 @@ const Nav = styled.div`{ border-bottom:1px solid #eee; font-size:16px; color:#333; + display:flex; + justify-content: space-between; + align-items:center; }` export default (({children})=>{ diff --git a/src/forge/Component/layout.jsx b/src/forge/Component/layout.jsx index 71824e8fc..a2eece9f7 100644 --- a/src/forge/Component/layout.jsx +++ b/src/forge/Component/layout.jsx @@ -48,13 +48,35 @@ export const WhiteBack = styled.div`{ border-radius:5px; }` export const Blueline = styled.a`{ - height:30px; - line-height:30px; - border-radius:5px; + height:32px; + line-height:32px; + border-radius:2px; border:1px solid rgba(80,145,255,1); color:rgba(80,145,255,1); padding:0px 12px; }` +export const Redline = styled.a`{ + height:32px; + line-height:32px; + border-radius:2px; + border:1px solid #F73030; + color:#F73030; + padding:0px 12px; + display:inline-block; + min-width:80px; + text-align:center; +}` +export const Greenline = styled.a`{ + height:32px; + line-height:32px; + border-radius:2px; + border:1px solid #28BD6C; + color:#28BD6C; + padding:0px 12px; + display:inline-block; + min-width:80px; + text-align:center; +}` export const NumUl = styled.ul`{ padding-left: 20px; & > li{ @@ -77,3 +99,15 @@ export const GreenUnder = styled.a`{ background:#28BD6C; } }` +export const Cancel = styled.a`{ + height:32px; + line-height:32px; + border-radius:2px; + background-color:#BBBBBB; + color:#fff; + padding:0px 12px; + display:inline-block; + min-width:64px; + text-align:center; + letter-spacing: 4px; +}` diff --git a/src/forge/GetData/getData.jsx b/src/forge/GetData/getData.jsx index 75e661f88..e0474a33f 100644 --- a/src/forge/GetData/getData.jsx +++ b/src/forge/GetData/getData.jsx @@ -1,9 +1,13 @@ import axios from 'axios'; - +// 获取分支列表 export const getBranch = async (id)=>{ return (await axios.get(`/projects/${id}/branches.json`)).data; } - +// 获取标签列表 export const getTag = async (id)=>{ return (await axios.get(`/repositories/${id}/tags.json`)).data; +} +// 获取hooks(仓库设置-管理web钩子)列表 +export const getHooks = async (id,params)=>{ + return (await axios.get(`/projects/${id}/hooks.json`,{params})).data; } \ No newline at end of file diff --git a/src/forge/Settings/Index.js b/src/forge/Settings/Index.js index 5cd077d96..5c254ba69 100644 --- a/src/forge/Settings/Index.js +++ b/src/forge/Settings/Index.js @@ -24,6 +24,14 @@ const Tags = Loadable({ loader: () => import("./new_tags"), loading: Loading, }); +const Manage = Loadable({ + loader: () => import("./ManageWeb"), + loading: Loading, +}); +const ManageNew = Loadable({ + loader: () => import("./ManageWebNew"), + loading: Loading, +}); class Index extends Component { render() { const { projectsId } = this.props.match.params; @@ -79,11 +87,11 @@ class Index extends Component { {/*
  • -1 ? "active" : "" + pathname.indexOf("setting/manage") > -1 ? "active" : "" } >

    - + 管理Web钩子 @@ -114,6 +122,18 @@ class Index extends Component { )} > + ( + + )} + > + ( + + )} + > {/* 修改仓库信息 */} { + const [page, setPage] = useState(1); + const [limit, setLimit] = useState(20); + const [data, setData] = useState(undefined); + + const {projectsId} = props.match.params; + // useEffect(() => { + // if(projectsId){ + // getHook(projectsId); + // } + // },[projectsId]); + + async function getHook(id) { + const params = { + page, + limit + }; + let data = await getHooks(id, params); + data && setData(data); + } + return ( + + + <span>管理web钩子</span> + <Button type="primary">添加web钩子</Button> + +

    +

    + 当Gitea事件发生时,Web钩子自动发出HTTP POST请求。在{" "} + + 指南 + {" "} + 中阅读更多内容。 +

    + + + + https://gitea.com/zxf/homebrew-cask-versions/settings/hooks/gitea/new + + + 删除 + 编辑 + + + + + https://gitea.com/zxf/homebrew-cask-versions/settings/hooks/gitea/new + + + 删除 + 编辑 + + + +
    + + ); +}); diff --git a/src/forge/Settings/ManageWebNew.jsx b/src/forge/Settings/ManageWebNew.jsx new file mode 100644 index 000000000..f58d5cc70 --- /dev/null +++ b/src/forge/Settings/ManageWebNew.jsx @@ -0,0 +1,98 @@ +import React , { forwardRef , useCallback } from 'react'; +import { Form , Input , Radio , Checkbox , Button , Select } from 'antd'; +import { Link } from 'react-router-dom'; +import { WhiteBack , Cancel } from '../Component/layout'; +import Title from '../Component/Title'; +import styled from 'styled-components'; + +const { Option } = Select; +const Div = styled.div`{ + padding:0px 30px +}` +const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', +}; + +export default Form.create()( + forwardRef(({ form })=>{ + const { getFieldDecorator } = form; + const helper = useCallback( + (label, name, rules, widget, isRequired ) => ( + + {label} + + {getFieldDecorator(name, { rules, validateFirst: true })(widget)} + + + ), + [] + ); + return( + + + <span>管理web钩子</span> + +
    +

    Gitea 将向目标 URL 发送具有指定内容类型的 POST 请求。在 webhooks 指南 中阅读更多内容。

    + {helper( + "目标URL", + "URL", + [{ required: true, message: "请输入目标URL" }], + ,true + )} + {helper( + "HTTP方法", + "HTTP", + [], + + )} + {helper( + "POST Content Type", + "Type", + [], + + )} + {helper( + "秘钥文本", + "passwordtext", + [], + + )} + {helper( + "触发条件:", + "condition", + [], + + 推送事件 + 所有事件 + 自定义事件 + + )} + {helper( + "分支过滤", + "branch", + [], + + )} +

    推送、创建,删除分支事件白名单,支持匹配符。如果为空或者 *,所有分支的事件均被触发。
    语法参见 github.com/gobwas/glob 。示例: Master, ${'{master,release*}'}。

    + {helper( + "", + "active", + [], + 激活触发事件的信息将发送到此 webhook 网址。 + )} +
    + + 取消 +
    +
    +
    + ) + }) +) \ No newline at end of file diff --git a/src/forge/Settings/new_tags.js b/src/forge/Settings/new_tags.js index 0d3c023c7..037925f1a 100644 --- a/src/forge/Settings/new_tags.js +++ b/src/forge/Settings/new_tags.js @@ -374,7 +374,7 @@ class NewTags extends Component { if (data && data.issue_tags && data.issue_tags.length > 0) { return (
    -
    +
    共{data && data.issue_tags_count}个标签
    • @@ -394,37 +394,13 @@ class NewTags extends Component {
    record.id} >
    - {/* { - data.issue_tags.map((item,key)=>{ - return( -
    - - - {item.name} - - {item.description} - {item.issues_count}个开启的任务 - { - data && data.user_admin_or_member ? - - : '' - } -
    - ) - }) - } */}
    ); @@ -509,7 +485,7 @@ class NewTags extends Component {
    -
    +
    {renderList()} {Paginations}
    @@ -520,7 +496,8 @@ class NewTags extends Component { visible={this.state.isShow} onOk={this.handleok} mask={true} - width="60%" + width="600px" + closable={false} >
    tr:hover > td{ + background-color: #fff!important; + } + .ant-table-tbody > tr > td{ + border-bottom: none; + } +} +.hooksNew{ + .required{ + position: relative; + &::before{ + content: "*"; + color: red; + position: absolute; + left: -10px; + top: -2px; + } + } + .ant-select.ant-select-enabled{ + width: 100%; + } +} \ No newline at end of file diff --git a/src/modules/courses/css/Courses.css b/src/modules/courses/css/Courses.css index 425f58793..2f127ff74 100644 --- a/src/modules/courses/css/Courses.css +++ b/src/modules/courses/css/Courses.css @@ -1108,7 +1108,7 @@ body #root { .ant-modal-title { height: 38px; - line-height: 38px; + line-height: 38px!important; } .underline { diff --git a/src/modules/login/LoginDialog.js b/src/modules/login/LoginDialog.js index f8a00701a..927eddb9c 100644 --- a/src/modules/login/LoginDialog.js +++ b/src/modules/login/LoginDialog.js @@ -7,7 +7,7 @@ import Dialog, { DialogContentText, DialogTitle, } from 'material-ui/Dialog'; -import {notification,Modal } from 'antd'; +import { notification, Modal } from 'antd'; import axios from 'axios'; @@ -17,129 +17,131 @@ import Notcompletedysl from "../user/Notcompletedysl"; const $ = window.$; var wait = 60; -function time(btn){ - if (wait==0) { - $(btn).addClass("btn_orange_bg"); - btn.removeAttribute("disabled"); - btn.innerHTML = "获取验证码"; - wait = 60; - return; - }else{ - $(btn).removeClass("btn_orange_bg"); - btn.setAttribute("disabled", "disabled"); - btn.innerHTML = wait + "s后重试"; - wait--; +function time(btn) { + if (wait == 0) { + $(btn).addClass("btn_orange_bg"); + btn.removeAttribute("disabled"); + btn.innerHTML = "获取验证码"; + wait = 60; + return; + } else { + $(btn).removeClass("btn_orange_bg"); + btn.setAttribute("disabled", "disabled"); + btn.innerHTML = wait + "s后重试"; + wait--; } - setTimeout(function(){ - time(btn); - },1000); + setTimeout(function () { + time(btn); + }, 1000); } function get_login_verification_code(btn) { - if($(btn).attr("disabled")) { + if ($(btn).attr("disabled")) { return false; } else { - if (/^1\d{10}$/.test($("#pass_name_input").val()) || /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test($("#pass_name_input").val())){ - if(!window.IsPC() || $('#quick-drag .drag_text').html() == "验证通过") { - $("#passlogin_error_notice").hide(); - btn.setAttribute("disabled", "disabled"); - var val = ''; - var type = 6; - if(/^1\d{10}$/.test($("#pass_name_input").val())){ - type = 6; - } else if(/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test($("#pass_name_input").val())){ - type = 7; - } - $.get( - '/account/get_verification_code', - { value: $('#pass_name_input').val().trim(), - type: type}, - function (data) { - if (data.status == "2") { - if(type == 6){ - $("#pass_name_input").next().find("p").html("该手机号尚未注册,你可以去注册").show(); - } else{ - $("#pass_name_input").next().find("p").html("该邮箱尚未绑定,你可以登录后去绑定").show(); - } - } else { - $("#pass_name_input").next().find("p").hide(); - if(type == 6){ - $("#send_code_notice").html(data.msg).show(); - } else{ - var uurl = window.gotoEmail(data.link); - $("#send_code_notice").html("验证码已经发送到您的邮箱,去查收").show(); - } - time(btn); - } - }); - } else{ - $("#passlogin_error_notice").show(); + if (/^1\d{10}$/.test($("#pass_name_input").val()) || /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test($("#pass_name_input").val())) { + if (!window.IsPC() || $('#quick-drag .drag_text').html() == "验证通过") { + $("#passlogin_error_notice").hide(); + btn.setAttribute("disabled", "disabled"); + var val = ''; + var type = 6; + if (/^1\d{10}$/.test($("#pass_name_input").val())) { + type = 6; + } else if (/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test($("#pass_name_input").val())) { + type = 7; } + $.get( + '/account/get_verification_code', + { + value: $('#pass_name_input').val().trim(), + type: type + }, + function (data) { + if (data.status == "2") { + if (type == 6) { + $("#pass_name_input").next().find("p").html("该手机号尚未注册,你可以去注册").show(); + } else { + $("#pass_name_input").next().find("p").html("该邮箱尚未绑定,你可以登录后去绑定").show(); + } + } else { + $("#pass_name_input").next().find("p").hide(); + if (type == 6) { + $("#send_code_notice").html(data.msg).show(); + } else { + var uurl = window.gotoEmail(data.link); + $("#send_code_notice").html("验证码已经发送到您的邮箱,去查收").show(); + } + time(btn); + } + }); + } else { + $("#passlogin_error_notice").show(); + } } } } class LoginDialog extends Component { - constructor(props) { - super(props) - this.state = { - open: true, - login:0, - speedy:1, - regular:0, - loginValue:'', - passValue:'', - isGoing:true, - isGoingValue:1, - disabled:true, - bottonclass:'log-botton mt5', - dialogBox:'dialogBox', - shortcutValue:'', - shortcutnum:1, - disabledType:true, - gaincode:'gain-code', - authCodeType:true, - authCodeclass:'log-botton mt5', - isRender: false, - MyEduCoderModals:false, - Phonenumberisnotco:undefined, - Phonenumberisnotcobool:false, - weixinlogin:false, - qqlogin:false - }; + constructor(props) { + super(props) + this.state = { + open: true, + login: 0, + speedy: 1, + regular: 0, + loginValue: '', + passValue: '', + isGoing: true, + isGoingValue: 1, + disabled: true, + bottonclass: 'log-botton mt5', + dialogBox: 'dialogBox', + shortcutValue: '', + shortcutnum: 1, + disabledType: true, + gaincode: 'gain-code', + authCodeType: true, + authCodeclass: 'log-botton mt5', + isRender: false, + MyEduCoderModals: false, + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + weixinlogin: false, + qqlogin: false + }; + } + enter = (num) => { + this.setState({ login: num, speedy: 1, dialogBox: 'dialogBox' }); + } + + register = (num) => { + this.setState({ login: 1, speedy: num, dialogBox: 'dialogBox2' }); + } + inputOnBlur = (e, id) => { + this.Emailphonenumberverification(e.target.value, 1); + }; + // 输入页面 + loginChange = (e) => { + var stirngt = ""; + if (e.target.value.length > 0) { + var str = e.target.value.replace(/\s*/g, "") + stirngt = str; + } else { + stirngt = e.target.value; } - enter=(num) =>{ - this.setState({login:num,speedy:1,dialogBox:'dialogBox'}); - } - register=(num) =>{ - this.setState({login:1,speedy:num,dialogBox:'dialogBox2'}); - } - inputOnBlur = (e, id) => { - this.Emailphonenumberverification(e.target.value, 1); - }; - // 输入页面 - loginChange = (e) =>{ - var stirngt=""; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - - if (e.target.value.length === 0) { - this.setState({ - loginValue: stirngt, - Phonenumberisnotco:undefined, - }) - }else{ - this.setState({ - loginValue: stirngt, - Phonenumberisnotco:undefined, - }) - } - }; + if (e.target.value.length === 0) { + this.setState({ + loginValue: stirngt, + Phonenumberisnotco: undefined, + }) + } else { + this.setState({ + loginValue: stirngt, + Phonenumberisnotco: undefined, + }) + } + }; //邮箱手机号验证 Emailphonenumberverification = (value, id) => { var url = `/accounts/valid_email_and_phone.json`; @@ -149,26 +151,26 @@ class LoginDialog extends Component { type: 1, } }).then((result) => { - if(result){ - if(result.data.status===-2){ - if(result.data.message==="该手机号码或邮箱已被注册"){ - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - }else { - this.setState({ - Phonenumberisnotco: result.data.message, - Phonenumberisnotcobool: true, - }) - } - return; - }else { + if (result) { + if (result.data.status === -2) { + if (result.data.message === "该手机号码或邮箱已被注册") { this.setState({ Phonenumberisnotco: undefined, Phonenumberisnotcobool: false, }) - return; + } else { + this.setState({ + Phonenumberisnotco: result.data.message, + Phonenumberisnotcobool: true, + }) + } + return; + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + return; } } }).catch((error) => { @@ -176,339 +178,325 @@ class LoginDialog extends Component { }) }; - passwordChange = () =>{ - let value =this.refs.passwordText.value; + passwordChange = () => { + let value = this.refs.passwordText.value; - let valuenum= value.length; - this.setState({disabled:false}) - this.setState({bottonclass:'log-botton mt5 edu-back-blue'}) - if(valuenum==0){ - this.setState({bottonclass:'log-botton mt5'}) - this.setState({disabled:true}) - } - this.setState({passValue:value}) - } + let valuenum = value.length; + this.setState({ disabled: false }) + this.setState({ bottonclass: 'log-botton mt5 edu-back-blue' }) + if (valuenum == 0) { + this.setState({ bottonclass: 'log-botton mt5' }) + this.setState({ disabled: true }) + } + this.setState({ passValue: value }) + } - handleInputChange =(event)=> { - const target = event.target; - const value = target.type === 'checkbox' ? target.checked : target.value; - const name = target.name; + handleInputChange = (event) => { + const target = event.target; + const value = target.type === 'checkbox' ? target.checked : target.value; + const name = target.name; - this.setState({[name]:value}) + this.setState({ [name]: value }) - if(value===true){ - this.setState({isGoingValue:1}) - }else{ - this.setState({isGoingValue:0}) + if (value === true) { + this.setState({ isGoingValue: 1 }) + } else { + this.setState({ isGoingValue: 0 }) + } + + } + + // 快捷注册 + shortcutIdChange = () => { + let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; + let reg1 = /^1\d{10}$/; + let reg2 = /^[a-zA-z]\w{3,14}$/; + let value = this.refs.shortcutText.value; + let valuenum = value.length; + if (valuenum > 0) { + if (!reg.test(value) && !reg1.test(value) && !reg2.test(value)) { + this.setState({ shortcutnum: 0 }) + this.setState({ disabledType: true }) + this.setState({ gaincode: 'gain-code' }) + return + } else { + this.setState({ gaincode: 'gain-code edu-back-blue' }) + this.setState({ shortcutValue: value }) + this.setState({ shortcutnum: 1 }) + this.setState({ disabledType: false }) } - } - // 快捷注册 - shortcutIdChange=()=>{ - let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; - let reg1 = /^1\d{10}$/; - let reg2=/^[a-zA-z]\w{3,14}$/; - let value=this.refs.shortcutText.value; - let valuenum= value.length; - if(valuenum>0){ - if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ - this.setState({shortcutnum:0}) - this.setState({disabledType:true}) - this.setState({gaincode : 'gain-code'}) - return - }else{ - this.setState({gaincode : 'gain-code edu-back-blue'}) - this.setState({shortcutValue:value}) - this.setState({shortcutnum:1}) - this.setState({disabledType:false}) - } - - - }else{ - this.setState({shortcutValue:value}) - - } + } else { + this.setState({ shortcutValue: value }) } - authCodeChange=()=>{ - let value=this.refs.authCodeText.value; - let valuenum= value.length; - if(valuenum>3){ - this.setState({authCodeType:false}) - this.setState({authCodeclass:'log-botton mt5 edu-back-blue'}) - }else if(valuenum==0){ - this.setState({authCodeType:true}) - this.setState({authCodeclass:'log-botton mt5'}) - } + } + authCodeChange = () => { + + let value = this.refs.authCodeText.value; + let valuenum = value.length; + if (valuenum > 3) { + this.setState({ authCodeType: false }) + this.setState({ authCodeclass: 'log-botton mt5 edu-back-blue' }) + } else if (valuenum == 0) { + this.setState({ authCodeType: true }) + this.setState({ authCodeclass: 'log-botton mt5' }) } - get_login_verification_code=()=>{ - get_login_verification_code($('#get_verification_code')[0]) - } - dragWrapper=() =>{ - const $ = window.$ - $.fn.drag = function(options) { + } + get_login_verification_code = () => { + get_login_verification_code($('#get_verification_code')[0]) + } + dragWrapper = () => { + const $ = window.$ + $.fn.drag = function (options) { - var x, drag = this, isMove = false, defaults = { - }; - var options = $.extend(defaults, options); - var handler = drag.find('.handler'); - var drag_bg = drag.find('.drag_bg'); - var text = drag.find('.drag_text'); - var maxWidth = 100 - //鼠标按下时候的x轴的位置 - handler.mousedown(function(e) { - isMove = true; - x = e.pageX - parseInt(handler.css('left'), 10); - maxWidth = drag.width() - handler.width() - 2; //能滑动的最大间距 - }); - $(document).mousemove(function(e) { - var _x = e.pageX - x;// _x = e.pageX - (e.pageX - parseInt(handler.css('left'), 10)) = x - if (isMove) { + var x, drag = this, isMove = false, defaults = { + }; + var options = $.extend(defaults, options); + var handler = drag.find('.handler'); + var drag_bg = drag.find('.drag_bg'); + var text = drag.find('.drag_text'); + var maxWidth = 100 + //鼠标按下时候的x轴的位置 + handler.mousedown(function (e) { + isMove = true; + x = e.pageX - parseInt(handler.css('left'), 10); + maxWidth = drag.width() - handler.width() - 2; //能滑动的最大间距 + }); + $(document).mousemove(function (e) { + var _x = e.pageX - x;// _x = e.pageX - (e.pageX - parseInt(handler.css('left'), 10)) = x + if (isMove) { - if (_x > 0 && _x <= maxWidth) { - handler.css({'left': _x}); - drag_bg.css({'width': _x}); - } else if (_x > maxWidth) { //鼠标指针移动距离达到最大时清空事件 - dragOk(); - } + if (_x > 0 && _x <= maxWidth) { + handler.css({ 'left': _x }); + drag_bg.css({ 'width': _x }); + } else if (_x > maxWidth) { //鼠标指针移动距离达到最大时清空事件 + dragOk(); } - }).mouseup(function(e) { - isMove = false; - var _x = e.pageX - x; - if (_x < maxWidth) { //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 - handler.css({'left': 0}); - drag_bg.css({'width': 0}); - } - }); - - //清空事件 - function dragOk() { - handler.removeClass('handler_bg').addClass('handler_ok_bg'); - text.removeClass('slidetounlock').text('验证通过').css({'color':'#fff'}); //modify - // drag.css({'color': '#fff !important'}); - - handler.css({'left': maxWidth}); // add - drag_bg.css({'width': maxWidth}); // add - - handler.unbind('mousedown'); - $(document).unbind('mousemove'); - $(document).unbind('mouseup'); - - } - } - - setTimeout(()=>{ - $('#quick-drag').drag(); - }, 4000) - } - - componentWillReceiveProps(nextProps) { - - this.setState({ - isRender:nextProps.isRender - }) - // console.log(nextProps.isRender); - - } - IsPC=()=>{ - var userAgentInfo = navigator.userAgent; - var Agents = ["Android", "iPhone", - "SymbianOS", "Windows Phone", - "iPad", "iPod"]; - var flag = true; - for (var v = 0; v < Agents.length; v++) { - if (userAgentInfo.indexOf(Agents[v]) > 0) { - flag = false; - break; - } - } - return flag; - } - componentDidMount() { - let flag = this.IsPC(); //true为PC端,false为手机端 - this.setState({ - isphone:flag - }) - - if(this.props.isRender!=undefined){ - this.setState({ - isRender:this.props.isRender - }) } - this.dragWrapper(); + }).mouseup(function (e) { + isMove = false; + var _x = e.pageX - x; + if (_x < maxWidth) { //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 + handler.css({ 'left': 0 }); + drag_bg.css({ 'width': 0 }); + } + }); - axios.interceptors.response.use((response) => { - if(response!=undefined) - if (response&&response.data.status === 401) { - document.title = "提示"; - this.setState({ - isRender: true - }) - } - return response; - }, (error) => { - }); - } - handleDialogClose = () => { - this.setState({ - isRender: false - }) - this.props.Modifyloginvalue(); - } + //清空事件 + function dragOk() { + handler.removeClass('handler_bg').addClass('handler_ok_bg'); + text.removeClass('slidetounlock').text('验证通过').css({ 'color': '#fff' }); //modify + // drag.css({'color': '#fff !important'}); - loginEDU=()=>{ + handler.css({ 'left': maxWidth }); // add + drag_bg.css({ 'width': maxWidth }); // add + + handler.unbind('mousedown'); + $(document).unbind('mousemove'); + $(document).unbind('mouseup'); - let {loginValue,passValue,regular,isGoingValue}=this.state; - if(regular===1){ - return } - let newloginValue=loginValue.replace(/(^\s*)|(\s*$)/g, ""); - let newpassValue=passValue.replace(/(^\s*)|(\s*$)/g, ""); + } - let url='/accounts/login.json' - axios.post(url, { - login:newloginValue, - password:newpassValue, - autologin:isGoingValue - } - ).then((response) => { + setTimeout(() => { + $('#quick-drag').drag(); + }, 4000) + } - if(response===undefined){ - return - } + componentWillReceiveProps(nextProps) { - if(response.status===200){ - if (response.data.status === 402) { - // window.location.href = response.data.url; - }else if (response.data.status === -2) { - if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") { - const messge = ( -
    -

    - 登录密码出错已达上限,账号已被锁定; -

    -

    - 请10分钟后重新登录或找回密码 -

    -
    - ) - this.openNotifications(messge); - } else { - notification.open({ - message: '提示', - description: response.data.message, - duration: 5, - }); - } - }else{ - broadcastChannelPostMessage('refreshPage') - this.setState({ - isRender:false - }) - this.props.Modifyloginvalue(); - console.log("login_url",this.props.location.pathname) - if(!this.props.location.pathname || this.props.location.pathname === "/"){ - this.props.history.push(`/users/${response.data && response.data.login}`) - }else{ - window.location.reload(); - } + this.setState({ + isRender: nextProps.isRender + }) + // console.log(nextProps.isRender); - } - } - }).catch((error) => { - console.log("356"); - console.log(error) + } + IsPC = () => { + var userAgentInfo = navigator.userAgent; + var Agents = ["Android", "iPhone", + "SymbianOS", "Windows Phone", + "iPad", "iPod"]; + var flag = true; + for (var v = 0; v < Agents.length; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false; + break; + } + } + return flag; + } + componentDidMount() { + let flag = this.IsPC(); //true为PC端,false为手机端 + this.setState({ + isphone: flag + }) + + if (this.props.isRender != undefined) { + this.setState({ + isRender: this.props.isRender + }) + } + this.dragWrapper(); + + axios.interceptors.response.use((response) => { + if (response != undefined) + if (response && response.data.status === 401) { + document.title = "提示"; + this.setState({ + isRender: true + }) + } + return response; + }, (error) => { + }); + } + handleDialogClose = () => { + this.setState({ + isRender: false + }) + this.props.Modifyloginvalue(); + } + + loginEDU = () => { + + let { loginValue, passValue, regular, isGoingValue } = this.state; + if (regular === 1) { + return + } + let newloginValue = loginValue.replace(/(^\s*)|(\s*$)/g, ""); + let newpassValue = passValue.replace(/(^\s*)|(\s*$)/g, ""); + + let url = '/accounts/login.json' + axios.post(url, { + login: newloginValue, + password: newpassValue, + autologin: isGoingValue + } + ).then((response) => { + if (response === undefined || response.status === 200) { + return + } + if (response.data.status === -2) { + if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") { + const messge = ( +
    +

    + 登录密码出错已达上限,账号已被锁定; +

    +

    + 请10分钟后重新登录或找回密码 +

    +
    + ) + this.openNotifications(messge); + } else { + notification.open({ + message: '提示', + description: response.data.message, + duration: 5, + }); + } + } else { + broadcastChannelPostMessage('refreshPage') + this.setState({ + isRender: false }) - - }; - setNotcompleteds=()=>{ - this.setState({ - Notcompleteds:true, - MyEduCoderModals:false + this.props.Modifyloginvalue(response.data); + window.location.reload(); + } + }).catch((error) => { + console.log(error) }) }; - setMyEduCoderModals=()=>{ + setNotcompleteds = () => { this.setState({ - MyEduCoderModals:true + Notcompleteds: true, + MyEduCoderModals: false }) }; - onKeydowns=(e)=>{ - let {disabled}=this.state; - if( disabled===false&& e.keyCode === 13){ - this.loginEDU() - console.log(1) - } - }; - getloginurl=(url)=>{ + setMyEduCoderModals = () => { + this.setState({ + MyEduCoderModals: true + }) + }; + onKeydowns = (e) => { + let { disabled } = this.state; + if (disabled === false && e.keyCode === 13) { + this.loginEDU() + console.log(1) + } + }; + getloginurl = (url) => { window.location.href = url; }; - openweixinlogin=()=>{ - this.setState({ - weixinlogin:true - }) - } - openNotifications = (btn) => { - // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 - notification.open({ - message: "提示", - description: btn, + openweixinlogin = () => { + this.setState({ + weixinlogin: true + }) + } + openNotifications = (btn) => { + // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 + notification.open({ + message: "提示", + description: btn, duration: 5, - onClick: () => { + onClick: () => { - }, - }); - } - openqqlogin=()=>{ - this.setState({ - qqlogin:true - }) - window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` - } + }, + }); + } + openqqlogin = () => { + this.setState({ + qqlogin: true + }) + window.location.href = `https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` + } - openphoneqqlogin=()=>{ - window.open( - `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` - ) - } + openphoneqqlogin = () => { + window.open( + `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` + ) + } getTContainer = () => { return document.body; } - hideweixinlogin=()=>{ - this.setState({ - weixinlogin:false, - qqlogin:false - }) - } + hideweixinlogin = () => { + this.setState({ + weixinlogin: false, + qqlogin: false + }) + } - render() { - let{qqlogin,login,isGoing,isGoingValue,disabled,bottonclass,Phonenumberisnotco, - dialogBox, isRender,weixinlogin}=this.state; + render() { + let { qqlogin, login, isGoing, isGoingValue, disabled, bottonclass, Phonenumberisnotco, + dialogBox, isRender, weixinlogin } = this.state; - if (isRender === undefined) { - isRender = false - } + if (isRender === undefined) { + isRender = false + } - return ( - this.handleDialogClose()} - > + return ( + this.handleDialogClose()} + > {this.setNotcompleteds()}} + setNotcompleteds={() => { this.setNotcompleteds() }} /> - - {isRender===true? + } + + {isRender === true ?
    -
    {this.handleDialogClose()}}> - +
    { this.handleDialogClose() }}> +
    - {weixinlogin===true?"":
    - ); -} + : ""} +
    + ); + } } -export default LoginDialog ; +export default LoginDialog; diff --git a/src/modules/projectPackages/PackageIndex/PackageBanner.js b/src/modules/projectPackages/PackageIndex/PackageBanner.js deleted file mode 100644 index bc5aee524..000000000 --- a/src/modules/projectPackages/PackageIndex/PackageBanner.js +++ /dev/null @@ -1,25 +0,0 @@ -import React, {Component} from 'react'; -import {Link} from "react-router-dom"; - -class PackageBanner extends Component { - constructor(props) { - super(props) - this.state = { - - } - } - componentDidMount() { - - - } - - - render() { - return ( -
    - ) - } -} - -export default PackageBanner; - diff --git a/src/modules/projectPackages/PackageIndex/PackageConcent.js b/src/modules/projectPackages/PackageIndex/PackageConcent.js deleted file mode 100644 index ed592dcf3..000000000 --- a/src/modules/projectPackages/PackageIndex/PackageConcent.js +++ /dev/null @@ -1,374 +0,0 @@ -import React, {Component} from 'react'; -import {Link} from "react-router-dom"; -import axios from 'axios'; -import { Input ,Icon,Button,Pagination,Spin} from 'antd'; -import moment from 'moment'; -import '../packageconcnet.css'; -import AccountProfile from"../../user/AccountProfile"; -import LoginDialog from '../../login/LoginDialog'; - - -const { Search } = Input; -let categorylist=[ - {name:"全部",value:undefined}, - {name:"前端开发",value:"front"}, - {name:"后端开发",value:"backend"}, - {name:"移动开发",value:"mobile"}, - {name:"数据库",value:"database"}, - {name:"云计算和大数据",value:"cloud_compute_and_big_data"}, - {name:"人工智能",value:"ai"}, - {name:"运维与测试",value:"devops_and_test"}, - {name:"其它",value:"other"}, -] -// -function setcategorylist(val){ - let vals="" - categorylist.some((item,key)=> { - if (item.name === val) { - vals=item.value - return true - } - } - ) - return vals -} - - - -class PackageConcent extends Component { - constructor(props) { - super(props) - this.state = { - data:undefined, - project_packages:undefined, - category:undefined, - keyword:undefined, - sort_by:"recently", - sort_direction:"desc", - page:1, - per_page:20, - categories:[], - isRender:false, - AccountProfiletype:false, - isSpin:false - } - } - //desc’, ‘desc’, ‘asc’ - //否 string 排序,默认最新, ‘recently’, ‘price’ - // 否 string 类型, front,backend,mobile,database, cloud_compute_and_big_data,devops_and_test,ai,other - componentDidMount() { - window.document.title = '众包创新' - let {category,keyword,sort_by,sort_direction,page}=this.state - this.setdatas(category,keyword,sort_by,sort_direction,page) - - let Url = `/project_package_categories.json`; - axios.get(Url).then((response) => { - // console.log(response) - this.setState({ - categories:response.data.categories - }) - }).catch((error) => { - console.log(error) - }) - - } - - setdatas=(category,keyword,sort_by,sort_direction,page)=>{ - this.setState({ - isSpin:true - }) - let Url = `/project_packages.json`; - axios.get(Url,{params:{ - category_id:category, - keyword:keyword, - sort_by:sort_by, - sort_direction:sort_direction, - page:page, - per_page:20, - }} - ).then((response) => { - this.setState({ - data:response.data, - isSpin:false, - project_packages:response.data.project_packages - }) - }).catch((error) => { - console.log(error) - }) - } - - setdatafuns=(value)=>{ - let {category,keyword,sort_by,sort_direction,page}=this.state - this.setState({ - keyword:value - }) - this.setdatas(category,value,sort_by,sort_direction,page) - } - - - setcategory=(value)=>{ - let {category,keyword,sort_by,sort_direction,page}=this.state - this.setState({ - category:value - }) - this.setdatas(value,keyword,sort_by,sort_direction,page) - } - - setsort_byfun=(value)=>{ - let {category,keyword,sort_by,sort_direction,page}=this.state - - this.setState({ - sort_by:value - }) - let sort_directionvalue; - if(value===sort_by){ - if(sort_direction==="desc"){ - this.setState({ - sort_direction:"asc" - }) - sort_directionvalue="asc"; - }else{ - this.setState({ - sort_direction:"desc" - }) - sort_directionvalue="desc"; - } - }else{ - this.setState({ - sort_direction:"desc" - }) - sort_directionvalue="desc"; - } - - this.setdatas(category,keyword,value,sort_directionvalue,page) - } - - onReleaseRequirements=(url)=>{ - - let{current_user} =this.props; - if(current_user===undefined){ - this.setState({ - isRender:true - }) - return - } - if(current_user&¤t_user.login===""){ - this.setState({ - isRender:true - }) - return; - } - - if(current_user&¤t_user.profile_completed===false){ - this.setState({ - AccountProfiletype:true - }) - return; - } - if(url !== undefined || url!==""){ - window.location.href = url; - } - - } - - // 登录 - Modifyloginvalue=()=>{ - this.setState({ - isRender:false, - }) - } - - hideAccountProfile=()=>{ - this.setState({ - AccountProfiletype:false - }) - } - - onChangePagelist=(pageNum)=> { - - this.setState({ - page: pageNum - }) - let {category, keyword, sort_by, sort_direction} = this.state; - this.setdatas(category, keyword, sort_by, sort_direction, pageNum) - - } - - - render() { - let {data,page,category,sort_by,sort_direction,project_packages, - isRender,AccountProfiletype - }=this.state; - - return ( -
    - {isRender===true?this.Modifyloginvalue()} - {...this.props} - {...this.state} - />:""} - - {AccountProfiletype===true?this.hideAccountProfile()} - {...this.props} - {...this.state} - />:""} -
    -
    -
    -
    -
    - - - {/*concent*/} -
    -
    -

    -

    - 搜索} - onSearch={ (value)=>this.setdatafuns(value)} /> - -

    -

    -
    -
    - -
    -

    -

    - 类型: -

    -
  • this.setcategory(undefined)}>全部
  • - {this.state.categories.map((item,key)=>{ - return( -
  • this.setcategory(item.id)}>{item.name}
  • - ) - })} - - -

    - -

    - 排序: -

    -
  • this.setsort_byfun("recently")}> - 最新 - - - - -
  • - -
  • this.setsort_byfun("price")}> - 价格 - - - - -
  • -
    -

    -

    - - - - {project_packages&&project_packages.map((item,key)=>{ - return( -
    - -
    - -
    - -
    - -
    - -
    - - - -
    - -
    - {item.min_price===null?"":¥{item.min_price}} - {item.max_price===null||item.min_price===null?"":~} - {item.max_price===null?"":¥{item.max_price}} - {item.min_price===null&&item.max_price===null?可议价:""} -
    - -
    - -
    -
    {item.category_name}
    -
    - -
    -
    - - {item.visit_count}人浏览 -
    -
    - - - {moment(item.deadline_at).format("YYYY-MM-DD HH:mm")}竞标截止 - -
    -
    - - - {item.bidding_users_count}人竞标 - -
    - {/*
    */} -
    - {item.published_at===null?更新于:{moment(item.updated_at).format("YYYY-MM-DD HH:mm")} : - 发布于:{moment(item.published_at).format("YYYY-MM-DD HH:mm")} } -
    -
    - -
    - -
    -
    - ) - })} -
    - - {project_packages&&project_packages.length===0?
    -
    - -

    暂无数据哦~

    -
    :""} - -
    - -
    - - - - - - - - - ) - } -} - -export default PackageConcent; - diff --git a/src/modules/projectPackages/PackageIndex/PackageIndex.js b/src/modules/projectPackages/PackageIndex/PackageIndex.js deleted file mode 100644 index e6c7cdc98..000000000 --- a/src/modules/projectPackages/PackageIndex/PackageIndex.js +++ /dev/null @@ -1,30 +0,0 @@ -import React, { Component } from 'react'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; - -//业务组件 -import PackageBanner from "./PackageBanner"; -import PackageConcent from "./PackageConcent"; - -class PackageIndex extends Component{ - constructor(props) { - super(props) - } - - componentDidMount(){ - window.document.title = '众包创新' - } - - render() { - return ( -
    -
    - {/*头部banner*/} - - {/*内容banner*/} - -
    -
    - ) - } -} -export default PackageIndex; \ No newline at end of file diff --git a/src/modules/projectPackages/PackageIndexNEITaskDetails/NEITaskDetailsModel.js b/src/modules/projectPackages/PackageIndexNEITaskDetails/NEITaskDetailsModel.js deleted file mode 100644 index 16e22dae0..000000000 --- a/src/modules/projectPackages/PackageIndexNEITaskDetails/NEITaskDetailsModel.js +++ /dev/null @@ -1,41 +0,0 @@ -import React, { Component } from 'react'; -import { Spin, Icon , Modal,Input,Button} from 'antd'; -class NEITaskDetailsModel extends Component { - - constructor(props) { - super(props); - this.state = { - - } - } - - render() { - - return( - -
    -

    -

    {this.props.applyvalue}
    -
    {this.props.applybottom}
    -

    -
    - 取消 - 确定 -
    - -
    -
    - ) - } -} - -export default NEITaskDetailsModel; \ No newline at end of file diff --git a/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js deleted file mode 100644 index 60394d52b..000000000 --- a/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ /dev/null @@ -1,492 +0,0 @@ -import React, {Component} from 'react'; -import {Link} from "react-router-dom"; -import axios from 'axios'; -import { Input ,Icon,Button,Pagination,DatePicker,Breadcrumb} from 'antd'; -import { handleDateString,markdownToHTML,bytesToSize,getImageUrl} from 'educoder'; -import NEITaskDetailsModel from './NEITaskDetailsModel'; -import moment from 'moment'; -import '../packageconcnet.css'; -import './pds.css' -import gouxuan from './img/gouxuan.png' -import weigouxuan from './img/weigouxuan.png' -const { Search } = Input; -// let categorylist=[ -// {name:"全部",value:undefined}, -// {name:"前端开发",value:"front"}, -// {name:"后端开发",value:"backend"}, -// {name:"移动开发",value:"mobile"}, -// {name:"数据库",value:"database"}, -// {name:"云计算和大数据",value:"cloud_compute_and_big_data"}, -// {name:"人工智能",value:"ai"}, -// {name:"其他",value:"other"}, -// ] -// -// function setcategorylist(val){ -// let vals="" -// categorylist.some((item,key)=> { -// if (item.value === val) { -// vals=item.name -// return true -// } -// } -// ) -// -// return vals -// } - -class PackageIndexNEITaskDetails extends Component { - constructor(props) { - super(props) - this.contentMdRef = React.createRef(); - this.state = { - data:undefined, - modalCancel: false, - overtype:false, - setbiddingmantype:false, - datalist:[] - } - } - - componentDidMount() { - this.getdatas() - window.document.title = '众包创新' - } - - getdatas=()=>{ - let url =`/project_packages/${this.props.match.params.id}.json`; - axios.get(url).then((response) => { - if(response.data.status!=401&&response.data.status!=403&&response.data.status!=408&&response.data.status!=409)[ - this.setState({ - data:response.data - }) - ] - }).catch((error) => { - console.log(error); - - }) - } - - setbiddingman=()=>{ - this.setState({ - setbiddingmantype:true - }) - } - - notsetbiddingman=()=>{ - let {data} =this.state; - let gouxuans2=data.bidding_users - for (var i=0;i{ - this.setState({ - modalCancel:false - }) - } - - setbiddingusers=()=>{ - let{datalist}=this.state; - if(datalist.length>0){ - this.setState({ - applytype:true, - applyvalue:`选择的${datalist.length}个竞标者将被设定为“中标”`, - applybottom:"是否确认执行?", - applycancel:this.setApplycancel, - applyconfirm:this.setApplysumbit - }) - } - - } - - setApplysumbit=()=>{ - this.setState({ - applytype:false, - }) - let{datalist}=this.state; - let newlist=[]; - datalist.map((item,key)=>{ - newlist.push(item.id) - }) - - - let url=`/project_packages/${this.props.match.params.id}/bidding_users/win.json`; - axios.post(url,{ - user_ids:newlist - }).then((response) => { - if(response.data.status===0){ - this.props.showSnackbar("提交成功"); - this.setState({ - setbiddingmantype:false - }) - this.getdatas() - }else if(response.data.status===-1){ - this.props.showSnackbar(response.data.message); - } - }).catch((error) => { - console.log(error) - }) - - } - - - - Clickteacher2=(e)=>{ - let {data} =this.state; - let newlist=[] - let gouxuans2=data.bidding_users - for (var i=0;i{ - this.setState({ - overtype:true - }) - } - - setout=()=>{ - this.setState({ - overtype:false - }) - } - - deletePackages=()=>{ - this.setState({ - applytype:true, - applyvalue:"是否确认删除?", - applycancel:this.setApplycancel, - applyconfirm:this.setApplydelect - }) - } - - setApplydelect=()=>{ - this.setState({ - applytype:false, - }) - let url=`/project_packages/${this.props.match.params.id}.json`; - axios.delete(url ).then((response) => { - // const status = response.data.status - // console.log(response) - this.props.showSnackbar('删除成功'); - }).catch((error) => { - console.log(error) - }) - } - - setBiddingApply=()=>{ - this.setState({ - applytype:true, - applyvalue:"是否确认报名?", - applycancel:this.setApplycancel, - applyconfirm:this.setApplyconfirm - }) - } - - setApplycancel=()=>{ - this.setState({ - applytype:false, - }) - } - - setApplyconfirm=()=>{ - this.setState({ - applytype:false, - }) - let url=`/project_packages/${this.props.match.params.id}/bidding_users.json`; - axios.post(url).then((response) => { - if(response.data.status===0){ - this.props.showSnackbar("报名成功"); - this.getdatas() - }else if(response.data.status===-1){ - this.props.showSnackbar(response.data.message); - } - }).catch((error) => { - console.log(error) - }) - - } - goback = () => { - // window.history.go(-1) - // window.location.href="/crowdsourcing"; - this.props.history.goBack() - } - - render() { - let {overtype,data}=this.state; - // console.log(data&&data.creator.id) - let datalogin=data&&data.creator.id; - let userlogin=this.props.current_user&&this.props.current_user.user_id; - - console.log(datalogin===userlogin) - // console.log(this.props.current_user&&this.props.current_user.user_id) - return ( - data===undefined?"":
    -
    - -
    - - '} className={"fl"}> - {/*{this.props.current_user.username}*/} - - 众包创新 - - {data&&data.title} - - - 返回 -
    -

    -

    -
    - -
    - {data&&data.status==="pending"?
    -
    - - 未申请 -
    :data&&data.status==="applying"?
    -
    - - 待发布 -
    :""} - -
    -
    -
    - - - -
    - {data&&data.creator.name} -
    - - {datalogin===userlogin===true?"":
    - {overtype===false? 头像联系TA: - 头像联系TA} -
    } -
    - - -
    - -
    - -
    - -
    - {data&&data.title} - -
    - -
    - {data&&data.min_price===null?"":{data&&data.min_price}} - {data&&data.max_price===null||data&&data.min_price===null?"":~} - {data&&data.max_price===null?"":{data&&data.max_price}} - {data&&data.min_price===null&&data&&data.max_price===null?可议价:""} -
    - -
    - -
    -
    {data&&data.category_name}
    -
    - -
    -
    - {data&&data.published_at===null? - 更新时间:{moment(data&&data.updated_at).format("YYYY-MM-DD HH:mm")} - : - 发布时间:{moment(data&&data.published_at).format("YYYY-MM-DD HH:mm")} - } -
    -
    - 竞标截止时间:{moment(data&&data.deadline_at).format("YYYY-MM-DD HH:mm")} -
    -
    - -
    - -
    -
    - -
    -
    - - {/*详情*/} -
    -
    -
    - 需求详情: - - {data&&data.status==="pending"&&data&&data.operation.can_select_bidding_user===true?
    - 编辑 - 删除 -
    :""} - -
    -
    -
    -
    - -
    - - {data&&data.attachments.length>0?
    -
    - 需求文件: -
    - {data&&data.attachments.map((item,key)=>{ - return( - - )})} -
    :""} -
    - - - - {/*发布者和竞选者状态show*/} - {this.state.setbiddingmantype===false&&data&&data.published_at!=null?
    - {/*下面是头像*/} -
    -
    -
    - 报名列表({data&&data.bidding_users.length}) -
    -
    - {data&&data.operation.can_bidding===true?:""} - {data&&data.operation.can_select_bidding_user===true?:""} -
    -
    -
    - -
    -
    -
    -
    - - {data&&data.bidding_users.map((item,key)=>{ - return( -
    - {item.status==="bidding_won"?:""} - -

    {item.name}

    - {this.props.current_user&&this.props.current_user.login!=item.login? - 头像联系TA - :""} -
    - ) - })} - - {data&&data.bidding_users.length===0?
    -
    - -

    暂无人员竞标~

    -
    :""} - - -
    -
    -
    -
    :""} - - - {this.state.setbiddingmantype===true?
    - {/*发布人选择状态*/} - {/*下面是头像*/} -
    -
    -
    - 报名列表({data&&data.bidding_users.length}) -
    - -
    -
    - 已选 ({this.state.datalist.length}) -
    - 取消 - -
    -
    -
    -
    -
    -
    -
    - {data&&data.bidding_users.map((item,key)=>{ - return( -
    - ) - })} - - {data&&data.bidding_users.length===0?
    -
    - -

    暂无人员竞标~

    -
    :""} - -
    -
    -
    -
    :""} - -

    - -
    - - -
    -
    -
    - ) - } -} - -export default PackageIndexNEITaskDetails; - - - diff --git a/src/modules/projectPackages/PackageIndexNEITaskDetails/img/gouxuan.png b/src/modules/projectPackages/PackageIndexNEITaskDetails/img/gouxuan.png deleted file mode 100644 index 5bc53f007..000000000 Binary files a/src/modules/projectPackages/PackageIndexNEITaskDetails/img/gouxuan.png and /dev/null differ diff --git a/src/modules/projectPackages/PackageIndexNEITaskDetails/img/weigouxuan.png b/src/modules/projectPackages/PackageIndexNEITaskDetails/img/weigouxuan.png deleted file mode 100644 index 40ca55728..000000000 Binary files a/src/modules/projectPackages/PackageIndexNEITaskDetails/img/weigouxuan.png and /dev/null differ diff --git a/src/modules/projectPackages/PackageIndexNEITaskDetails/newsone.png b/src/modules/projectPackages/PackageIndexNEITaskDetails/newsone.png deleted file mode 100755 index 9aadd57c2..000000000 Binary files a/src/modules/projectPackages/PackageIndexNEITaskDetails/newsone.png and /dev/null differ diff --git a/src/modules/projectPackages/PackageIndexNEITaskDetails/newstwo.png b/src/modules/projectPackages/PackageIndexNEITaskDetails/newstwo.png deleted file mode 100755 index 8ac58b2c4..000000000 Binary files a/src/modules/projectPackages/PackageIndexNEITaskDetails/newstwo.png and /dev/null differ diff --git a/src/modules/projectPackages/PackageIndexNEITaskDetails/pds.css b/src/modules/projectPackages/PackageIndexNEITaskDetails/pds.css deleted file mode 100644 index 504a78bed..000000000 --- a/src/modules/projectPackages/PackageIndexNEITaskDetails/pds.css +++ /dev/null @@ -1,57 +0,0 @@ -.ysldivhome2s{ - display: flex; - flex-flow: row wrap; - align-content:stretch; - flex-direction: row; - margin-bottom: 20px; -} - -.ysllogin_register_contentss{ - margin-top:0px !important; - padding-top: 10px; - padding-bottom: 10px; - display: flex; - margin-top: 20px; - /*justify-content: center;*/ - background: #fff; -} - -.ysldivhomediv1s{ - width: 80px; - height: 130px; - display: flex; - flex-direction:column; - margin-left: 48px; - margin-top: 20px; -} -.yslgouxuanimg{ - width: 20px; - height: 20px; - margin-left: 64px; - -} -.yslgouxuanimg2s{ - height: 20px; -} -.div1imgs{ - display: flex; - justify-content:center; - width: 80px; - height: 80px; - border-radius:50%; - -} -.textall{ - text-align: center; - font-size: 13px; - color: #4B4B4B; - -} -.ptext{ - width: 80px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -} -.ysllogin_sections { - display: flex; - align-items: center; - flex-direction: column; -} \ No newline at end of file diff --git a/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBanner.js b/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBanner.js deleted file mode 100644 index 283445ea1..000000000 --- a/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBanner.js +++ /dev/null @@ -1,41 +0,0 @@ -import React, {Component} from 'react'; -import {Link} from "react-router-dom"; -import { Steps, Divider } from 'antd'; -const { Step } = Steps; - -class PackageIndexNEIBanner extends Component { - constructor(props) { - super(props) - this.state = { - current:0 - } - } - componentDidMount() { - - - } - - onChange=(current)=>{ - - console.log('onChange:', current); - this.setState({ current }); - }; - - render() { - const { current } = this.state; - return ( -
    -

    - - - - - -

    -
    - ) - } -} - -export default PackageIndexNEIBanner; - diff --git a/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js b/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js deleted file mode 100644 index 7ce8b99d3..000000000 --- a/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js +++ /dev/null @@ -1,954 +0,0 @@ -import React, {Component} from 'react'; -import {Link} from "react-router-dom"; -import axios from 'axios'; -import { Input , Spin, Icon ,Button,Pagination,DatePicker} from 'antd'; -import { handleDateString,getUrl,setmiyah} from 'educoder'; -import locale from 'antd/lib/date-picker/locale/zh_CN'; -import MDEditors from '../MDEditors'; -import PhoneModel from './PhoneModel'; -import moment from 'moment'; -import '../packageconcnet.css'; -const { Search } = Input; -const $ = window.$; -let origin = getUrl(); - -// load -if (!window.postUpMsg) { - $.getScript( - `${origin}/javascripts/attachments.js`, - (data, textStatus, jqxhr) => { - - }); -} - - -function checkPhone(phone){ - - if(!(/^1[3456789]\d{9}$/.test(phone))){ - // alert("手机号码有误,请重填"); - return false; - } -} - -function range(start, end) { - const result = []; - for (let i = start; i < end; i++) { - result.push(i); - } - return result; -} - -function disabledDateTime() { - return { - disabledMinutes: () => range(1, 30).concat(range(31, 60)), - }; -} - -function disabledDate(current) { - return current && current < moment().endOf('day').subtract(1, 'days'); -} - - -class PackageIndexNEIBannerConcent extends Component { - constructor(props) { - super(props) - this.contentMdRef = React.createRef(); - this.state = { - modalCancel:false, - getverificationcodes:true, - seconds:60, - springtype:false, - category:undefined, - title:undefined, - content:undefined, - attachment_ids:undefined, - deadline_at:undefined, - min_price:undefined, - max_price:undefined, - contact_name:undefined, - contact_phone:undefined, - code:undefined, - publish:false, - categories:[] - } - } - - - componentDidMount() { - window.document.title = '众包创新' - if(this.props.match.params.id!=undefined){ - - let url=`/project_packages/${this.props.match.params.id}.json` - axios.get((url)).then((response) => { - - let data=response.data - this.setState({ - category:data.category_id, - title:data.title, - content:data.content, - deadline_at:moment(data.deadline_at), - min_price:data.min_price, - max_price:data.max_price, - contact_name:data.contact_name==null||data.contact_name==undefined?this.props.current_user.real_name:data.contact_name, - phones:data.contact_phone, - attachments:data.attachments, - - }) - }).catch((error) => { - console.log(error); - - }) - }else{ - console.log(this.props.current_user&&this.props.current_user.real_name) - } - - let Url = `/project_package_categories.json`; - axios.get(Url).then((response) => { - // console.log(response) - if(response.data.status===-1){ - - }else{ - this.setState({ - categories:response.data.categories - }) - } - - }).catch((error) => { - console.log(error) - }) - - this.setState({ - contact_name:this.props.current_user&&this.props.current_user.real_name - }) - - // this.contentMdRef.current.setValue("测试赋值") - } - - componentDidUpdate = (prevProps) => { - - if(prevProps.current_user!=this.props.current_user){ - if(this.props.current_user!=undefined){ - this.setState({ - contact_name:this.props.current_user.real_name - }) - } - } - - } - //获取验证码; - getverificationcode =()=>{ - // if (this.state.logins&&this.state.logins.length === 0) { - // // 判断没有输入手机号 - // return - // } - if(this.state.getverificationcodes === undefined){ - console.log("undefined"); - return; - } - if (this.state.getverificationcodes === true) { - this.setState({ - getverificationcodes: undefined, - }) - let timer = setInterval(() => { - this.setState((preState) => ({ - seconds: preState.seconds - 1, - }), () => { - if (this.state.seconds == 0) { - clearInterval(timer); - this.setState({ - getverificationcodes: false, - seconds: 60, - }) - } - }); - }, 1000) - //其他的网络请求也可以 - this.SMSverification(); - } else { - this.setState({ - getverificationcodes: undefined, - }) - let timer = setInterval(() => { - this.setState((preState) => ({ - seconds: preState.seconds - 1, - }), () => { - if (this.state.seconds == 0) { - clearInterval(timer); - this.setState({ - getverificationcodes: false, - seconds: 60, - - }) - } - }); - }, 1000) - //其他的网络请求也可以 - this.SMSverification(); - } - } - //短信验证 - SMSverification = () => { - let {contact_phone,code}=this.state; - var url = `/accounts/get_verification_code.json`; - axios.get((url), { - params: { - login: contact_phone, - type: 5, - smscode:setmiyah(contact_phone) - } - }).then((result) => { - //验证有问题{"status":1,"message":"success"} - // console.log(result); - // this.openNotification("验证码已发送,请注意查收"); - - if(result.data.status===1){ - this.openNotification("验证码已发送,请注意查收"); - }else if(result.data.status===-2){ - this.openNotification(result.data.message); - } - }).catch((error) => { - console.log(error); - - }) - } - - - onChangeTimePicker = (value, dateString) => { - if(value===null){ - this.setState({ - deadline_at:"" - }) - }else{ - if(moment(handleDateString(dateString))===undefined||moment(handleDateString(dateString))===null||moment(handleDateString(dateString))===""){ - this.setState({ - deadline_attypes:true - }) - }else{ - this.setState({ - deadline_attypes:false - }) - } - if(moment(handleDateString(dateString)){ - const content = this.contentMdRef.current.getValue().trim(); - if(content===undefined||content===null||content===""){ - this.setState({ - contenttypes:true - }) - }else{ - this.setState({ - contenttypes:false - }) - } - } - - - setcheckout=(min_price,max_price)=>{ - // if(min_price===undefined){ - // this.setState({ - // min_pricetype:true - // }) - // }else{ - // this.setState({ - // min_pricetype:false - // }) - // } - - - // if(parseInt(min_price)===undefined||parseInt(min_price)===null||parseInt(min_price)===""){ - // - // this.setState({ - // min_pricetype:true - // }) - // }else{ - // this.setState({ - // min_pricetype:false - // }) - // } - - // if(parseInt(max_price)===undefined||parseInt(max_price)===null||parseInt(max_price)===""){ - // - // this.setState({ - // min_pricetype:true - // }) - // - // }else{ - // this.setState({ - // min_pricetype:false - // }) - // } - - if(parseInt(min_price)<=0){ - this.setState({ - smallstype:true - }) - }else{ - this.setState({ - smallstype:false - }) - } - - if(parseInt(max_price){ - const content = this.contentMdRef.current.getValue().trim(); - // console.log(content) - // console.log(this.state.deadline_at._i) - this.setState({ - publish:type - }) - let types=type; - let {category,title,attachment_ids,deadline_at,min_price,max_price,contact_name,contact_phone,code,modalCancel}=this.state; - - if(category===undefined||category===null||category===""){ - this.setState({ - categorytypes:true - }) - this.scrollToAnchor("publishtimestart"); - return - } - - if(title===undefined||title===null||title===""){ - this.setState({ - titletypes:true - }) - this.scrollToAnchor("publishtimestart"); - return - } - - if(content===undefined||content===null||content===""){ - this.setState({ - contenttypes:true - }) - this.scrollToAnchor("publishtimestart"); - return - } - - if(deadline_at===undefined||deadline_at===null||deadline_at===""){ - this.setState({ - deadline_attypes:true - }) - this.scrollToAnchor("publishtime"); - return - } - - - if(moment(deadline_at) { - if(response.data.status===0){ - if(type===true){ - this.props.setPublicationfun(response.data.id) - }else{ - window.location.href="/crowdsourcing/"+response.data.id - } - this.setState({ - springtype:false - }) - }else if(response.data.status===-1){ - if(response.data.message==="无效的验证码"){ - this.setState({ - codeypesno:true, - springtype:false - }) - } - } - this.setState({ - springtype:false - }) - }).catch((error) => { - console.log(error) - this.setState({ - springtype:false - }) - }) - - - }else{ - - // edit - - const url = `/project_packages/${this.props.match.params.id}.json`; - - axios.put(url, { - category_id: category, - title: title, - content: content, - attachment_ids: attachment_ids, - deadline_at:deadline_at._i, - min_price:parseInt(min_price), - max_price:parseInt(max_price), - contact_name: contact_name===null||contact_name===undefined?this.props.current_user.real_name:contact_name, - contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone, - code:code, - publish:types - } - ).then((response) => { - if(response.data.status===0){ - if(type===true){ - this.props.setPublicationfun(response.data.id) - }else{ - window.location.href="/crowdsourcing/"+response.data.id - } - this.setState({ - springtype:false - }) - }else if(response.data.status===-1){ - if(response.data.message==="无效的验证码"){ - this.setState({ - codeypesno:true, - springtype:false - }) - } - } - this.setState({ - springtype:false - }) - }).catch((error) => { - console.log(error) - this.setState({ - springtype:false - }) - }) - - - } - - - - } - - modalCancel=()=>{ - this.setState({ - modalCancel:false, - contact_phone:undefined, - code:undefined, - }) - } - - editmodels=()=>{ - this.setState({ - modalCancel:true - }) - } - - - setcategory=(value)=>{ - if(value===undefined||value===null||value===""){ - this.setState({ - categorytypes:true - }) - }else{ - this.setState({ - categorytypes:false - }) - } - this.setState({ - category:value - }) - } - - settitlefun=(e)=>{ - - if(e.target.value===undefined||e.target.value===null||e.target.value===""){ - this.setState({ - titletypes:true - }) - }else{ - this.setState({ - titletypes:false - }) - } - - this.setState({ - title:e.target.value - }) - } - - - onChangemin_prices=(e)=>{ - let{max_price}=this.state; - this.setState({ - min_price:e.target.value - }) - this.setcheckout(e.target.value,max_price) - - - } - onChangemax_prices=(e)=>{ - let{min_price}=this.state; - this.setState({ - max_price:e.target.value - }) - this.setcheckout(min_price,e.target.value) - - } - - onChangeContact_name=(e)=>{ - - if(e.target.value===undefined||e.target.value===""||e.target.value===null){ - this.setState({ - contact_nametype:true - }) - }else{ - this.setState({ - contact_nametype:false - }) - } - - - this.setState({ - contact_name:e.target.value - }) - } - - onChangeContact_phone=(e)=>{ - let {modalCancel}=this.state; - // if(modalCancel===false){ - // if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){ - // this.setState({ - // current_userphonetype:true - // }) - // }else{ - // this.setState({ - // current_userphonetype:false - // }) - // } - // } - if(this.props.current_user&&this.props.current_user.phone===null||modalCancel===true){ - if(e.target.value===undefined||e.target.value===null||e.target.value===""){ - this.setState({ - contact_phonetype:true - }) - }else{ - this.setState({ - contact_phonetype:false - }) - } - - if(checkPhone(e.target.value)===false){ - this.setState({ - contact_phonetypes:true - }) - }else{ - this.setState({ - contact_phonetypes:false - }) - } - } - - - this.setState({ - contact_phone:e.target.value - }) - } - - onChangeCode=(e)=>{ - if(e.target.value===undefined||e.target.value===""||e.target.value===null){ - this.setState({ - codeypes:true - }) - }else{ - this.setState({ - codeypes:false - }) - } - this.setState({ - code:e.target.value - }) - } - - //跳转道描点的地方 - scrollToAnchor = (anchorName) => { - if (anchorName) { - // 找到锚点 - let anchorElement = document.getElementById(anchorName); - // 如果对应id的锚点存在,就跳转到锚点 - if(anchorElement) { anchorElement.scrollIntoView(); } - } - } - - render() { - let {modalCancel,seconds,getverificationcodes,attachments, - category,title}=this.state; - let categorylist=[ - {name:"前端开发",value:"front"}, - {name:"后端开发",value:"backend"}, - {name:"移动开发",value:"mobile"}, - {name:"数据库",value:"database"}, - {name:"云计算和大数据",value:"cloud_compute_and_big_data"}, - {name:"人工智能",value:"ai"}, - {name:"其他",value:"other"}, - ] - - - return ( - -
    - {/**/} - -

    - -

    -
    -
    - -
    - -

    -

    - {this.state.categories.map((item,key)=>{ - return( -
  • this.setcategory(item.id)}>{item.name}
  • - ) - })} -
    -

    - - {this.state.categorytypes===true?
    请选择类型
    :""} - -
    - -
    - - - {this.state.titletypes===true?
    不能为空
    :""} - this.setcheckoutcontent()}> - {/* 请求status 422 */} - {this.state.contenttypes===true?
    不能为空
    :""} - {/*
    */} - {/* window.$('#_file').click()}*/} - {/*data-tip-down="请选择文件上传">*/} - {/*/!**!/*/} - {/*上传附件*/} - {/**/} - {/*(最多可添加 5 个图片/文件,每个大小不超过 10MB)*/} - {/*
    */} - {/*{attachments&&attachments.map((item,key)=>{*/} - {/*return(*/} - {/**/} - {/*)})}*/} - {/*
    */} - {/**/} - {/**/} - {/**/} - {/* {*/} - {/*;*/} - {/*console.log(window.$('.file_selector')[0])*/} - {/*window.addInputFiles(window.$('.file_selector')[0])*/} - {/*}}*/} - {/*style={{'display': 'none'}}*/} - {/*type="file">*/} - {/**/} - {/**/} - {/*
    */} - - -
    -
    - -
    -
    -
    - -
    -

    - 竞标截止: - - - {this.state.deadline_attypes===true?

    不能为空
    :""} - - {this.state.deadline_attypexy===true?
    不能早于当前时间
    :""} -

    -

    - 支付费用: - this.onChangemin_prices(e)} - suffix={ - ¥ - } - /> - - this.onChangemax_prices(e)} - suffix={ - ¥ - } - />不填,则表示可议价 - {this.state.min_pricetype===true?

    不能为空
    :""} - {this.state.smallstype===true?
    不能小于零
    :""} - {this.state.minmaxtype===true?
    最高费用不能小于最低费用
    :""} -

    -
    - -
    -

    - 姓名: - this.onChangeContact_name(e)} - /> - {this.state.contact_nametype===true?

    不能为空
    :""} -

    - - {this.props.current_user&&this.props.current_user.phone!=null&&modalCancel===false?

    - 手机号: - - - this.editmodels()}> - -

    :""} - {/*{this.state.current_userphonetype===true?
    不能为空
    :""}*/} - {this.props.current_user&&this.props.current_user.phone===null||modalCancel===true?

    - - - {/*未注册才显示!*/} - - 手机号: - this.onChangeContact_phone(e)} - /> - {this.state.contact_phonetype===true?

    不能为空
    :""} - {this.state.contact_phonetypes===true?
    请输入正确的手机号
    :""} - - - - - 重新发送 ({seconds}s): getverificationcodes === true ?获取验证码 :重新发送} - onSearch={()=>this.getverificationcode()} - onInput={(e)=>this.onChangeCode(e)} - /> - {this.state.codeypes===true?
    验证码不能为空
    :""} - {this.state.codeypesno===true?
    验证码不正确
    :""} -
    - - {/**/} - - - - this.modalCancel()}>X - -

    :""} - - -
    -
    -

    - -
    - - this.setPublication(false)}>保存 -
    -
    -
    - - ) - } -} - -export default PackageIndexNEIBannerConcent; - -// attachments:[ -// { -// id: 206525, -// title: "412420b57ed8c141963d4c548bde551f", -// filesize: 18523, -// description: null, -// url: "/api/attachments/206525" -// } -// ] - diff --git a/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js b/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js deleted file mode 100644 index e44e654b9..000000000 --- a/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js +++ /dev/null @@ -1,49 +0,0 @@ -import React, {Component} from 'react'; -import {Link} from "react-router-dom"; -import { Icon ,Button} from 'antd'; - -class PackageIndexNEISubmit extends Component { - constructor(props) { - super(props) - this.state = { - current:0 - } - } - componentDidMount() { - window.document.title = '众包创新' - } - setageload=(sum)=>{ - if(sum===undefined){ - window.location.href="/crowdsourcing/new" - }else{ - // this.props.history.push("/project_packages/"+sum) - window.location.href="/crowdsourcing/"+sum - } - - } - render() { - - return ( - - ) - } -} - -export default PackageIndexNEISubmit; - diff --git a/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js b/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js deleted file mode 100644 index f7495595b..000000000 --- a/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js +++ /dev/null @@ -1,69 +0,0 @@ -import React, { Component } from 'react'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; - -//业务组件 -import PackageIndexNEIBanner from "./PackageIndexNEIBanner"; - -import PackageIndexNEIBannerConcent from "./PackageIndexNEIBannerConcent" - -import PackageIndexNEISubmit from './PackageIndexNEISubmit' -import '../packageconcnet.css'; -class PackageIndexNewandEditIndex extends Component{ - constructor(props) { - super(props) - this.state = { - setPublication:false, - id:undefined - } - } - - componentDidMount(){ - window.document.title = '众包创新' - } - - setPublicationfun=(ids)=>{ - this.setState({ - setPublication:true, - id:ids - }) - } - - goback = () => { - // window.history.go(-1) - // window.location.href="/crowdsourcing"; - this.props.history.goBack() - } - - render() { - let {setPublication}=this.state; - return ( - - ) - } -} -export default PackageIndexNewandEditIndex; \ No newline at end of file diff --git a/src/modules/projectPackages/PackageIndexNewandEdit/PhoneModel.js b/src/modules/projectPackages/PackageIndexNewandEdit/PhoneModel.js deleted file mode 100644 index d918111d7..000000000 --- a/src/modules/projectPackages/PackageIndexNewandEdit/PhoneModel.js +++ /dev/null @@ -1,140 +0,0 @@ -import React, { Component } from 'react'; -import { Spin, Icon , Modal,Input,Button} from 'antd'; -class PhoneModel extends Component { - //getverificationcodes 是否是重新发送或者是获取验证码 - //多少秒 - constructor(props) { - super(props); - this.state = { - funmodalsType:false, - istype:false, - getverificationcodes:true, - seconds:35, - } - } - //获取验证码 - getverificationcode =()=>{ - // if (this.state.logins&&this.state.logins.length === 0) { - // 判断没有输入手机号 - // return - // } - - if (this.state.getverificationcodes === true) { - this.setState({ - getverificationcodes: undefined, - }) - let timer = setInterval(() => { - this.setState((preState) => ({ - seconds: preState.seconds - 1, - }), () => { - if (this.state.seconds == 0) { - clearInterval(timer); - this.setState({ - getverificationcodes: false, - seconds: 35, - }) - } - }); - }, 1000) - //其他的网络请求也可以 - this.SMSverification(); - } else { - this.setState({ - getverificationcodes: undefined, - }) - let timer = setInterval(() => { - this.setState((preState) => ({ - seconds: preState.seconds - 1, - }), () => { - if (this.state.seconds == 0) { - clearInterval(timer); - this.setState({ - getverificationcodes: false, - seconds: 35, - - }) - } - }); - }, 1000) - //其他的网络请求也可以 - this.SMSverification(); - } - } - //短信验证 - SMSverification = () => { - // var url = `/accounts/get_verification_code.json`; - // axios.get((url), { - // params: { - // login: this.state.logins, - // type: 1, - // } - // }).then((result) => { - // //验证有问题{"status":1,"message":"success"} - // // console.log(result); - // this.openNotification("验证码已发送,请注意查收"); - // - // - // }).catch((error) => { - // console.log(error); - // - // }) - } - render() { - let{getverificationcodes,seconds} =this.state; - const antIcons = - return( - -
    -

    - 手机号码: - - -

    -

    - - - 验证码: - - - - - { - getverificationcodes === undefined ? - - : getverificationcodes === true ? - - : - - - } - {/**/} - - - -

    - -
    - 取消 - 确定 -
    - -
    -
    - ) - } -} - -export default PhoneModel; \ No newline at end of file diff --git a/src/modules/projectPackages/ProjectPackageIndex.js b/src/modules/projectPackages/ProjectPackageIndex.js deleted file mode 100644 index 097e012e0..000000000 --- a/src/modules/projectPackages/ProjectPackageIndex.js +++ /dev/null @@ -1,76 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import Loading from '../../Loading' - -import Loadable from 'react-loadable'; -import { TPMIndexHOC } from '../tpm/TPMIndexHOC' -import { SnackbarHOC } from 'educoder' - - -const PackageIndex = Loadable({ - loader: () => import('./PackageIndex/PackageIndex'), - loading: Loading, -}) - -const PackageIndexNewandEdit = Loadable({ - loader: () => import('./PackageIndexNewandEdit/PackageIndexNewandEditIndex'), - loading: Loading, -}) - -const PackageIndexNEITaskDetails = Loadable({ - loader: () => import('./PackageIndexNEITaskDetails/PackageIndexNEITaskDetails'), - loading: Loading, -}) - -class ProjectPackageIndex extends Component { - constructor(props) { - super(props) - } - - componentDidMount(){ - window.document.title = '众包创新' - } - - render() { - - return ( -
    - - - {/*众包首页*/} - - () - } - > - - () - } - > - - () - } - > - - () - } - > - - -
    - ); - } -} - -export default SnackbarHOC() (TPMIndexHOC (ProjectPackageIndex)) ; \ No newline at end of file diff --git a/src/modules/projectPackages/packageconcnet.css b/src/modules/projectPackages/packageconcnet.css deleted file mode 100644 index 22dd4ebc8..000000000 --- a/src/modules/projectPackages/packageconcnet.css +++ /dev/null @@ -1,369 +0,0 @@ -.width1240{ - width:1240px; -} -.packinput .ant-input{ - height: 50px; - width:749px; - border-color: #E1EDF8 !important; -} - -.packinput{ - width:749px; -} - - -.packinput .ant-input-group-addon .ant-btn{ - width:140px !important; - font-size: 18px; - height: 50px; - background:rgba(76,172,255,1); -} - -.setissues{ - width:280px; - height:50px; - background:rgba(76,172,255,1); - border-radius:4px; - margin-left: 15px; -} - -.pagetype li{ - color:#8F8F8F !important; -} - -.maxwidth670{ - max-width: 670px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.mbf10{ - margin-bottom:-10px; -} - -.PackageIndexNEIBanner{ - width:1200px; - height:110px; - background:rgba(255,255,255,1); - box-shadow:0px 2px 6px 0px rgba(125,125,125,0.26); - border-radius:8px; -} - -.padding110{ - padding: 39px 110px 0px; - box-sizing: border-box; -} - -.borderccc{ - border: 1px solid #ccc; -} - -.input-100-40s{ - width: 100%; - padding: 5px; - box-sizing: border-box; -} - -.fafafas{ - background-color: #fafafa!important; - height: 40px; -} - -.fafafas:focus{ - background-color: #fff!important; -} - -.fafas .ant-input{ - background-color: #fafafa!important; - height: 40px; -} - -.fafas .ant-input:focus{ - background-color: #fff!important; -} -.fafas .ant-input-group-addon .ant-btn{ - width:140px !important; - font-size: 14px; - height: 40px; - background:rgba(76,172,255,1); -} - -.newFormbox .upload_filename{ - line-height: 32px; -} - -.newFormbox .attachment span{ - line-height: 23px; -} - -.newFormbox .attachment .remove-upload{ - line-height: 28px; -} - -.pd26a0{ - padding: 26px 26px 16px 26px; -} - -.newFormbox .attachment .icon-fujian{ - font-size: 14px !important; - line-height: 14px; - margin-top: 9px; -} - -.newFormbox{ - height:20px -} - -.ml24{ - margin-left:24px; -} - -.defalutCancelbtns{ - display: block; - border: 1px solid #4CACFF !important; - background-color: #fff; - color: #4CACFF !important; - width:130px; - height:40px; - text-align: center; - line-height: 40px; - border-radius: 4px; -} - -.defalutSubmitbtns{ - background-color: #4CACFF; - height:40px; -} - -.defalutSubmitbtnmodels{ - width:127px; - height:30px; - background-color: #4CACFF; -} - -.ant-steps-item-process .ant-steps-item-icon{ - background-color: #4CACFF !important; -} - -.ant-steps-item-process .ant-steps-item-icon{ - background-color: #4CACFF !important; -} - -.padding200{ - padding: 115px 200px 215px 200px; -} - -.fontcircle{ - font-size: 80px; - display: inherit; -} - -.sumbtongs{ - font-size: 24px; - display: inherit; - text-align: center; -} - -.terraces{ - font-size: 16px; - display: inherit; - text-align: center; - color:#999; -} -.padding251{ - padding: 0px 245px; -} - -.ant-modal-title{ - text-align: center; -} -.ml17{ - margin-left: 17px; -} - -.project-package-items{ - display: -webkit-flex; - display: flex; - flex-direction: row; - margin:0px !important; - padding: 20px; - background: white; - margin-bottom:0px !important; - box-shadow: none !important; -} - -.mtf7{ - margin-top:-7px; -} - -.publicpart.orangeGreen { - border-left: 80px solid #29BD8B; -} - -.publicwords{ - left: 3px; - top: 18px; -} - -.project-packages-list .project-package-items .item-image{ - width:100px !important; -} - -.height185{ - height: 185px; -} - -.ContacttheTA{ - width: 80px; - height: 26px; - font-size: 14px; - line-height: 26px; - display: block; - border: 1px solid #4CACFF !important; - background-color: #fff; - color: #4CACFF !important; - text-align: center; - border-radius: 4px; -} -.ContacttheTAs{ - width: 80px; - height: 26px; - font-size: 14px; - line-height: 24px; - /*display: block;*/ - border: 1px solid #fff !important; - background-color: #4CACFF; - color: #fff !important; - text-align: center; - border-radius: 4px; -} -.ml28{ - margin-left: 28px; -} - -.longboxs{ - font-size: 16px; - font-family: MicrosoftYaHei-Bold; - font-weight: bold; - color: rgba(5,16,26,1); - border-left: 4px solid rgba(76,172,255,1); - padding-left: 10px; - margin-bottom: 20px; -} - -.padding020{ - padding: 0px 20px 20px; -} - -.mtf3{ - margin-top:-3px; -} - -.task-btn-nebules{ - background: #fff!important; - color: #4CACFF!important; - border: 1px solid #4CACFF!important; - margin-left: 20px; - cursor: pointer; - display: inline-block; - padding: 0 12px; - letter-spacing: 1px; - text-align: center; - font-size: 14px; - height: 30px; - line-height: 30px; - border-radius: 2px; -} - -.packageabsolute{ - position: absolute; - right: -16px; - top: -7px; -} -.relativef{ - position: relative; -} - -.homehove:hover .ptext{ - color: #4CACFF!important; -} - -.homehove:hover .ContacttheTAs{ - display: block; -} - -.topsj{ - position: absolute; - top: -3px; -} -.bottomsj{ - position: absolute; - bottom: -5px; -} -.touchSelect .ant-spin-dot-spin{ - margin-top: 30% !important; -} - -.pagenoedits{ - margin-left: 20px; - color: #ccc; -} - -.pagemancenter{ - text-align: center; -} - -.ml0{ - margin-left: 0px; -} -.tabelcli{ - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - max-width: 850px; - display: table-cell; -} - -.mtf10{ - margin-top:-10px; -} - -.padding26{ - padding: 26px; - box-sizing: border-box; -} - -.pd26{ - padding: 26px; -} -.pd30a0{ - padding: 30px 30px 16px 30px; -} - -.shaiContent li.shaiItem:hover span{ - color: #fff !important; -} - -.shaiContent li.shaiItem:hover i.iconfont{ - color: #4CACFF!important -} - -.ant-form-item-requireds::before { - display: inline-block; - margin-right: 4px; - color: #f5222d; - font-size: 14px; - font-family: SimSun,sans-serif; - line-height: 1; - content: '*'; -} - -*, *::before, *::after { - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -.mtf12{ - margin-top: -12px; -} \ No newline at end of file diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index e21c5eb40..074b2b6c7 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -734,9 +734,9 @@ class NewHeader extends Component {
    {isRender === true ? this.Modifyloginvalue()} {...this.props} {...this.state} + Modifyloginvalue={() => this.Modifyloginvalue()} /> : ""} {AccountProfiletype === true ? @@ -756,9 +756,9 @@ class NewHeader extends Component { this.headtypesonClick("/", false)} className={"fl mr30"}> { mygetHelmetapi2 && mygetHelmetapi2.nav_logo_url && mygetHelmetapi2.nav_logo_url ? - 高校智能化教学与实训平台 - : - 高校智能化教学与实训平台 + 高校智能化教学与实训平台 + : + 高校智能化教学与实训平台 } { @@ -816,34 +816,34 @@ class NewHeader extends Component {
    : "" } - +
    { this.props.user && this.props.user.login ? -
    - -
    -
    -
      +
      + +
      +
      +
        + { + mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.new_syllabuses && +
      • 新建课程
      • + } + { + mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.new_course && +
      • 新建班级
      • + } +
      { - mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.new_syllabuses && -
    • 新建课程
    • + coursestypes === true && this.props.user && this.props.user.main_site === false ? "" : +
        +
      • 新建镜像项目
      • +
      • 新建托管项目
      • +
      } - { - mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.new_course && -
    • 新建班级
    • - } -
    - { - coursestypes === true && this.props.user && this.props.user.main_site === false ? "" : -
      -
    • 新建镜像项目
    • -
    • 新建托管项目
    • -
    - } +
    -
    - : "" + : "" } { this.props.user && this.props.user.login ? @@ -892,39 +892,39 @@ class NewHeader extends Component { mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.register_url && 注册 } - - : user.login === "" ? - - this.educoderlogin()} className="mr5 color-grey-3">登录 - { - mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.register_url && - 注册 - } - : -
    - - - - - -
    + + : +
    + + + + + +
    } diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index 42b79d77c..4886031a6 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -42,7 +42,7 @@ export function TPMIndexHOC(WrappedComponent) { }) } - + keyupListener = (e) => { if (e.key === "Escape") { this.setState({ globalLoading: false }) @@ -51,7 +51,7 @@ export function TPMIndexHOC(WrappedComponent) { componentWillUnmount() { window.removeEventListener('keyup', this.keyupListener) } - componentWillMount(){ + componentWillMount() { this.fetchUsers(); }