Commit 02eb0beb by FE

Merge branch 'issue-20190920' into pre

parents 6eb3f339 fe5c1adc
...@@ -670,7 +670,7 @@ function BargainSecond(props) { ...@@ -670,7 +670,7 @@ function BargainSecond(props) {
<div className='bargain-second'> <div className='bargain-second'>
<img className='top-img' src={require('./image/kanjia_cg_icon.png')} alt=""/> <img className='top-img' src={require('./image/kanjia_cg_icon.png')} alt=""/>
<p className='status-title'>厉害了,又帮好友砍掉<span className='ff4'>{props.money}</span>!</p> <p className='status-title'>厉害了,又帮好友砍掉<span className='ff4'>{props.money}</span>!</p>
<Link className='bargain-href' to='#bargainCourse' onClick={props.close}>我也要砍价</Link> <a className='bargain-href' href='#bargainCourse' onClick={props.close}>我也要砍价</a>
</div> </div>
) )
} }
...@@ -681,7 +681,7 @@ function NotBargain(props) { ...@@ -681,7 +681,7 @@ function NotBargain(props) {
<img className='middle-img' src={require('./image/kanjia_no_iccon.png')} alt=""/> <img className='middle-img' src={require('./image/kanjia_no_iccon.png')} alt=""/>
<p className='status-title'>你的好友用【砍价神器】把我砍蒙圈了<br/>不能再砍了哦~</p> <p className='status-title'>你的好友用【砍价神器】把我砍蒙圈了<br/>不能再砍了哦~</p>
<p className='status-dec'>邀请{props.limitPeople}位以上好友帮忙砍价可获得【砍价神器】</p> <p className='status-dec'>邀请{props.limitPeople}位以上好友帮忙砍价可获得【砍价神器】</p>
<Link className='bargain-href' to='#bargainCourse' onClick={props.close}>我也要砍价</Link> <a className='bargain-href' href='#bargainCourse' onClick={props.close}>我也要砍价</a>
</div> </div>
) )
} }
......
...@@ -6,7 +6,7 @@ import HeaderSearch from '../../common/HeaderSearch/index' ...@@ -6,7 +6,7 @@ import HeaderSearch from '../../common/HeaderSearch/index'
import { http, getParam } from "@/utils" import { http, getParam } from "@/utils"
import Loading from '@/common/Loading' import Loading from '@/common/Loading'
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { StickyContainer } from "react-sticky"; import { StickyContainer, Sticky } from "react-sticky";
function stopScroll(e) { function stopScroll(e) {
...@@ -149,12 +149,12 @@ class Classify extends Component { ...@@ -149,12 +149,12 @@ class Classify extends Component {
/> />
<Loading isLoading={this.state.isLoading}> <Loading isLoading={this.state.isLoading}>
<div className='class-content'> <div className='class-content'>
<WhiteSpace/> {/* <WhiteSpace/> */}
<div onClick={this.pulldown.bind(this)}> <div onClick={this.pulldown.bind(this)}>
{this.state.ispull ? top : bottom} {this.state.ispull ? top : bottom}
</div> </div>
<StickyContainer> <StickyContainer>
<Tabs {/* <Tabs
tabs={this.state.allClass} tabs={this.state.allClass}
animated={false} animated={false}
page={page} page={page}
...@@ -162,6 +162,25 @@ class Classify extends Component { ...@@ -162,6 +162,25 @@ class Classify extends Component {
renderTabBar={props => <div className={'custom-render-bar'}> renderTabBar={props => <div className={'custom-render-bar'}>
<Tabs.DefaultTabBar {...props}/> <Tabs.DefaultTabBar {...props}/>
</div>} </div>}
> */}
<Tabs
tabs={this.state.allClass}
animated={false}
page={page}
onChange={(tab) => this.ontabclick(tab)}
renderTabBar={props => {
return (
<Sticky>
{({ style }) => {
return (
<div style={{ ...style, top: '44px', zIndex: 1 }}>
<Tabs.DefaultTabBar {...props} />
</div>
)
}}
</Sticky>
)
}}
> >
<div className='tabs'> <div className='tabs'>
<ul> <ul>
......
...@@ -16,7 +16,8 @@ html,body,#root { ...@@ -16,7 +16,8 @@ html,body,#root {
} }
.class-content { .class-content {
padding: 88px 12px 0; padding: 44px 12px 0;
// padding: 88px 12px 0;
position: relative; position: relative;
.custom-render-bar{ .custom-render-bar{
......
...@@ -12,16 +12,19 @@ class Search extends PureComponent { ...@@ -12,16 +12,19 @@ class Search extends PureComponent {
state = { state = {
searchHistory: JSON.parse(localStorage.getItem('searchHistory')) || [], searchHistory: JSON.parse(localStorage.getItem('searchHistory')) || [],
hot_words: [], hot_words: [],
defaultWord: '',
searchList: [], searchList: [],
value: '', value: '',
isLoading: true isLoading: true
} }
async componentDidMount() { async componentDidMount() {
const res = await http.get(`${API['search-api']}/search_hot_word`) const res = await http.get(`${API['search-api']}/search_hot_word`);
if (res.data.errno === 0) { const { errno, data } = res.data;
if (errno === 0) {
this.setState({ this.setState({
hot_words: res.data.data.info.hot_words, hot_words: data.info.hot_words,
defaultWord: data.info.recommend_word,
isLoading: false isLoading: false
}) })
} }
...@@ -39,11 +42,15 @@ class Search extends PureComponent { ...@@ -39,11 +42,15 @@ class Search extends PureComponent {
} }
handleSearch = () => { handleSearch = () => {
this.state.value && this.props.history.push(`/search-result?word=${encodeURIComponent(this.state.value)}`) const { defaultWord, value } = this.state;
const val = value || defaultWord;
val && this.props.history.push(`/search-result?word=${encodeURIComponent(val)}`)
} }
storeHistory = keyword => { storeHistory = keyword => {
localStorage.setItem('searchHistory', JSON.stringify([...this.state.searchHistory, keyword])) const { searchHistory } = this.state;
const data = searchHistory.some(item => item === keyword)? searchHistory : searchHistory.concat([keyword]);
localStorage.setItem('searchHistory', JSON.stringify(data));
} }
...@@ -53,7 +60,7 @@ class Search extends PureComponent { ...@@ -53,7 +60,7 @@ class Search extends PureComponent {
<div className="search-page"> <div className="search-page">
<SearchHead <SearchHead
searchHistory={this.state.searchHistory} searchHistory={this.state.searchHistory}
value={this.state.value} value={this.state.value || this.state.defaultWord}
handleChange={this.handleChange} handleChange={this.handleChange}
handleSearch={this.handleSearch} handleSearch={this.handleSearch}
/> />
......
...@@ -25,8 +25,10 @@ class SearchHead extends PureComponent { ...@@ -25,8 +25,10 @@ class SearchHead extends PureComponent {
} }
storeKeyword = () => { storeKeyword = () => {
let {searchHistory = [], value} = this.props const {searchHistory = [], value} = this.props;
value && localStorage.setItem('searchHistory', JSON.stringify([...searchHistory, value])) const data = searchHistory.some(item =>item === value)? searchHistory : searchHistory.concat([value]);
// value && localStorage.setItem('searchHistory', JSON.stringify([...searchHistory, value]))
localStorage.setItem('searchHistory', JSON.stringify(data));
} }
changeFontColor = (isFocus) => { changeFontColor = (isFocus) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment