competitions
杨树林 6 years ago
parent 1139e68a16
commit 7a24b1fa70

@ -1,76 +1,75 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames' import classNames from 'classnames'
import { getImageUrl, toPath, LinkAfterLogin } from 'educoder' import { getImageUrl, toPath, LinkAfterLogin } from 'educoder'
import match_adImg from '../../images/ad/match_ad.jpg' import match_adImg from '../../images/ad/match_ad.jpg'
const $ = window.$ const $ = window.$
class RightMyPublish extends Component { class RightMyPublish extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
} }
} }
handleKeyPress = (event) => { handleKeyPress = (event) => {
if(event.type !== 'keypress' || event.key == 'Enter'){ if(event.type !== 'keypress' || event.key == 'Enter'){
this.props.setSearchValue( this.props.searchValue, true); this.props.setSearchValue( this.props.searchValue, true);
// $(window).trigger('setSearchValue', $('#shixun_search_input').val()) // $(window).trigger('setSearchValue', $('#shixun_search_input').val())
} }
} }
handleInput = (event) => { handleInput = (event) => {
this.props.setSearchValue(event.target.value); this.props.setSearchValue(event.target.value);
} }
render() { render() {
const { match, history, currentPage, my_memos_count, setSearchValue, searchValue } = this.props const { match, history, currentPage, my_memos_count, setSearchValue, searchValue } = this.props
return ( return (
<React.Fragment> <React.Fragment>
<div className="clearfix edu-back-white padding40-20 publishMemoSection"> <div className="clearfix edu-back-white padding40-20 publishMemoSection">
{/*<div className="searchFor h40 mt15 mb5 ml20"> {/*<div className="searchFor h40 mt15 mb5 ml20">
<div className="searchCon fl"> <div className="searchCon fl">
<input type="text" className="searchinput" name="search" value="" placeholder="请输入帖子标题的关键字进行搜索"> <input type="text" className="searchinput" name="search" value="" placeholder="请输入帖子标题的关键字进行搜索">
</input> </input>
<span className="search_close" onclick="colse_searchbox();" data-tip-down="清除">×</span> <span className="search_close" onclick="colse_searchbox();" data-tip-down="清除">×</span>
</div> </div>
<i className="fa fa-search mr5 fl color-dark-grey search_icon" <i className="fa fa-search mr5 fl color-dark-grey search_icon"
onClick="$('#search_memos').submit();" style={{margin:'8px'}} data-tip-down="搜索"></i> onClick="$('#search_memos').submit();" style={{margin:'8px'}} data-tip-down="搜索"></i>
</div>*/} </div>*/}
<div className="search-new">
<div className="search-new"> <input type="text" className="search-new-input fl" placeholder="搜索您想了解的话题" id="shixun_search_input"
<input type="text" className="search-new-input fl" placeholder="搜索您想了解的话题" id="shixun_search_input" onKeyPress={this.handleKeyPress} onChange={ this.handleInput } value={searchValue}
onKeyPress={this.handleKeyPress} onChange={ this.handleInput } value={searchValue} >
> </input>
</input> <span className="search-span"></span>
<span className="search-span"></span> <img src={getImageUrl("images/educoder/icon/search.svg")} className="fl mt5"
<img src={getImageUrl("images/educoder/icon/search.svg")} className="fl mt5" onClick={ this.handleKeyPress }>
onClick={ this.handleKeyPress }>
</img>
</img> </div>
</div> <LinkAfterLogin {...this.props} to={'/forums/new'} className="sendMyQuestion edu-default-btn edu-blueback-btn edu-txt-center font-16 mb30">发布话题</LinkAfterLogin>
<LinkAfterLogin {...this.props} to={'/forums/new'} className="sendMyQuestion edu-default-btn edu-blueback-btn edu-txt-center font-16 mb30">发布话题</LinkAfterLogin> {/*<p className="edu-txt-center font-16">
{/*<p className="edu-txt-center font-16"> <span>我的发布</span><br/>
<span>我的发布</span><br/> <Link to={`/forums/categories/my_published`} className="color-blue">{my_memos_count}</Link>
<Link to={`/forums/categories/my_published`} className="color-blue">{my_memos_count}</Link> </p>*/}
</p>*/} </div>
</div>
<div className="clearfix edu-back-white advertisement" >
<div className="clearfix edu-back-white advertisement" > <a href="/competitions" target="_blank"><img src={match_adImg}></img></a>
<a href="/competitions" target="_blank"><img src={match_adImg}></img></a> </div>
</div> </React.Fragment>
</React.Fragment> );
); }
} }
}
export default RightMyPublish;
export default RightMyPublish;

Loading…
Cancel
Save