index.js 1004 Bytes
Newer Older
xuzhenghua committed
1 2 3 4 5 6
import React, {Component} from 'react'
import {SearchBar} from 'antd-mobile'
import './index.scss'

class HeaderBar extends Component {
    toSearch() {
xuzhenghua committed
7
        window.location.href = '/search'
xuzhenghua committed
8
    }
xuzhenghua committed
9

xuzhenghua committed
10
    return() {
xuzhenghua committed
11 12 13 14 15
        window.location.href = '/'
    }

    goShop = () => {
        location.replace('/shopcart');
xuzhenghua committed
16 17
    }

xuzhenghua committed
18

xuzhenghua committed
19 20 21 22 23 24 25 26 27 28 29
    render() {
        return (
            <div className='preferential'>
                <div className="search-nav">
                    <i className={'iconfont iconiconfront-68 return'} onClick={this.return.bind(this)}></i>
                    <SearchBar
                        placeholder="搜索课程"
                        cancelText={" "}
                        onFocus={this.toSearch.bind(this)}
                        showCancelButton={false}
                    />
xuzhenghua committed
30
                    <i className={'iconfont icongouwuche-xianxing shopping-cart'} onClick={this.goShop}></i>
xuzhenghua committed
31 32 33 34 35 36 37 38
                </div>
            </div>
        )
    }

}

export default HeaderBar