Commit 02eb0beb by FE

Merge branch 'issue-20190920' into pre

parents 6eb3f339 fe5c1adc
......@@ -670,7 +670,7 @@ function BargainSecond(props) {
<div className='bargain-second'>
<img className='top-img' src={require('./image/kanjia_cg_icon.png')} alt=""/>
<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>
)
}
......@@ -681,7 +681,7 @@ function NotBargain(props) {
<img className='middle-img' src={require('./image/kanjia_no_iccon.png')} alt=""/>
<p className='status-title'>你的好友用【砍价神器】把我砍蒙圈了<br/>不能再砍了哦~</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>
)
}
......
......@@ -6,7 +6,7 @@ import HeaderSearch from '../../common/HeaderSearch/index'
import { http, getParam } from "@/utils"
import Loading from '@/common/Loading'
import { connect } from 'react-redux';
import { StickyContainer } from "react-sticky";
import { StickyContainer, Sticky } from "react-sticky";
function stopScroll(e) {
......@@ -149,12 +149,12 @@ class Classify extends Component {
/>
<Loading isLoading={this.state.isLoading}>
<div className='class-content'>
<WhiteSpace/>
{/* <WhiteSpace/> */}
<div onClick={this.pulldown.bind(this)}>
{this.state.ispull ? top : bottom}
</div>
<StickyContainer>
<Tabs
{/* <Tabs
tabs={this.state.allClass}
animated={false}
page={page}
......@@ -162,6 +162,25 @@ class Classify extends Component {
renderTabBar={props => <div className={'custom-render-bar'}>
<Tabs.DefaultTabBar {...props}/>
</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'>
<ul>
......
......@@ -16,7 +16,8 @@ html,body,#root {
}
.class-content {
padding: 88px 12px 0;
padding: 44px 12px 0;
// padding: 88px 12px 0;
position: relative;
.custom-render-bar{
......
......@@ -12,16 +12,19 @@ class Search extends PureComponent {
state = {
searchHistory: JSON.parse(localStorage.getItem('searchHistory')) || [],
hot_words: [],
defaultWord: '',
searchList: [],
value: '',
isLoading: true
}
async componentDidMount() {
const res = await http.get(`${API['search-api']}/search_hot_word`)
if (res.data.errno === 0) {
const res = await http.get(`${API['search-api']}/search_hot_word`);
const { errno, data } = res.data;
if (errno === 0) {
this.setState({
hot_words: res.data.data.info.hot_words,
hot_words: data.info.hot_words,
defaultWord: data.info.recommend_word,
isLoading: false
})
}
......@@ -39,11 +42,15 @@ class Search extends PureComponent {
}
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 => {
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 {
<div className="search-page">
<SearchHead
searchHistory={this.state.searchHistory}
value={this.state.value}
value={this.state.value || this.state.defaultWord}
handleChange={this.handleChange}
handleSearch={this.handleSearch}
/>
......
......@@ -25,8 +25,10 @@ class SearchHead extends PureComponent {
}
storeKeyword = () => {
let {searchHistory = [], value} = this.props
value && localStorage.setItem('searchHistory', JSON.stringify([...searchHistory, value]))
const {searchHistory = [], value} = this.props;
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) => {
......
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