Commit d97bd399 by baiguangyao
parents f1cb286c 817baa6d
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { LocaleProvider } from 'antd-mobile'
import { HashRouter } from 'react-router-dom'
import Routes from './routes'
import '@/common/styles/common.scss'
class App extends Component {
render() {
return (
<LocaleProvider>
<HashRouter>
<Routes></Routes>
</HashRouter>
</LocaleProvider>
);
}
}
export default connect()(App);
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { LocaleProvider } from 'antd-mobile'
import { HashRouter } from 'react-router-dom'
import Routes from './routes'
// import '@/common/styles/common.scss'
class App extends Component {
render() {
return (
<LocaleProvider>
<HashRouter>
<Routes></Routes>
</HashRouter>
</LocaleProvider>
);
}
}
export default connect()(App);
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { LocaleProvider } from 'antd-mobile'
import { HashRouter } from 'react-router-dom'
import Routes from './router'
// import '@/common/styles/common.scss'
class App extends Component {
render() {
return (
<LocaleProvider>
<HashRouter>
<Routes></Routes>
</HashRouter>
</LocaleProvider>
);
}
}
export default connect()(App);
import React, { Component } from 'react'
import './tag.scss'
export default class Tag extends Component {
render() {
return (
<span className="tag" {...this.props}>
{this.props.children}
</span>
)
}
}
.tag{
display: block;
max-width: 100%;
overflow: hidden;
margin-right: 10px;
margin-bottom: 10px;
font-size:12px;
padding:4px 10px;
color:#555;
border-radius: 3px;
float: left;
background-color: #f0f2f5;
line-height: 20px;
}
\ No newline at end of file
import React, { Component } from 'react';
import { Flex, WhiteSpace, NavBar, List } from 'antd-mobile';
import './index.scss';
import Avatar from './image/avatar.png';
import Vip from './image/vip.png';
// import UnVip from './image/unVIP.png';
const Item = List.Item;
const Brief = Item.Brief;
class Search extends Component {
render() {
return (
<div className="flex-container">
<Flex>
<Flex.Item>
</Flex.Item>
</Flex>
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import { Flex, WhiteSpace, NavBar, List } from 'antd-mobile';
import './index.scss';
class Search extends Component {
render() {
return (
<div className="flex-container">
<Flex>
<Flex.Item>
</Flex.Item>
</Flex>
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import { Flex, WhiteSpace, NavBar, List } from 'antd-mobile';
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} goto={this.gotoList.bind(this)}></SearchHead>
{
this.props.searchVal.length < 1
? null : null
}
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<img src={require(`@common/images/delete.png`)} alt="delete" onClick={() => {
this.removeHistory()
}} />
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
{/* <div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div> */}
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} goto={this.gotoList.bind(this)}></SearchHead>
{
this.props.searchVal.length < 1
? null : null
}
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<img src={require(`@common/images/delete.png`)} alt="delete" onClick={() => {
this.removeHistory()
}} />
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
{/* <div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div> */}
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} goto={this.gotoList.bind(this)}></SearchHead>
{
this.props.searchVal.length < 1
? null : null
}
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<img src={require(`@common/images/delete.png`)} alt="delete" onClick={() => {
this.removeHistory()
}} />
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
{/* <div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div> */}
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} goto={this.gotoList.bind(this)}></SearchHead>
{
this.props.searchVal.length < 1
? null : null
}
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<img src={require(`@common/images/delete.png`)} alt="delete" onClick={() => {
this.removeHistory()
}} />
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
{/* <div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div> */}
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
{/* <SearchHead value={querystring} returnbtn={true} goto={this.gotoList.bind(this)}></SearchHead> */}
{
this.props.searchVal.length < 1
? null : null
}
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<img src={require(`@common/images/delete.png`)} alt="delete" onClick={() => {
this.removeHistory()
}} />
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
{/* <div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div> */}
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
// import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
{/* <SearchHead value={querystring} returnbtn={true} goto={this.gotoList.bind(this)}></SearchHead> */}
{
this.props.searchVal.length < 1
? null : null
}
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<img src={require(`@common/images/delete.png`)} alt="delete" onClick={() => {
this.removeHistory()
}} />
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
{/* <div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div> */}
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
// import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
{/* <SearchHead value={querystring} returnbtn={true} goto={this.gotoList.bind(this)}></SearchHead> */}
{
this.props.searchVal.length < 1
? null : null
}
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
{/* <div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div> */}
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
// import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
{/* <div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div> */}
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
// import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
// import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
.search-page{
.search-main{
background-color: #fff;
padding:10px;
.search-land{
label{
margin-bottom:10px;
display: flex;
justify-content: space-between;
span{
font-size:16px;
}
img{
width:16px;
height:16px;
display: block;
}
}
.search-tag{
overflow: hidden;
}
}
.search-hot{
margin-top:10px;
}
ul,li{
list-style: none;
padding:0;
margin:0;
}
.list{
padding:10px 0;
border-bottom:1px solid #eee;
}
.list:last-child{
border-bottom:0;
}
}
.searct-lists{
padding:0 10px;
}
}
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead></SearchHead>
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
// let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead></SearchHead>
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead></SearchHead>
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} goto={this.gotoList.bind(this)}></SearchHead>
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} ></SearchHead>
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} ></SearchHead>
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{/* {
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
} */}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} ></SearchHead>
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
{/* <div className="search-main searct-lists">
<ul>
{
this.state.searchList.length>0?
this.state.searchList.map((v,i)=>{
return (
<li key={i} className="list" onClick={()=>{
this.gotoList(v)
}}>{v}</li>
)
})
:
<li style={{textAlign:'center',padding:'20px'}}>暂时数据</li>
}
</ul>
</div> */}
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react';
import SearchHead from './searchHead'
import Tag from '@base/Tag/index.js'
import './index.scss';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
history: JSON.parse(localStorage.getItem('history')) || [],
searchHot: ['rec', '电脑', '照片扫描仪', '智能手表', '功夫茶杯', '广角镜头手机'],
searchList: []
}
}
render() {
let querystring = this.props.location.query ? this.props.location.query.s : '';
return (
<div className="search-page">
<SearchHead value={querystring} returnbtn={true} ></SearchHead>
<div className="search-main">
<div className="search-land search-history">
<label>
<span>最近搜索</span>
<i className="iconfont iconiconfront-56" onClick={() => {
this.removeHistory()
}} >
</i>
</label>
<div className="search-tag">
{
this.state.history.length > 0 ?
this.state.history.map((v, i) => {
return (<Tag key={i} onClick={() => {
this.gotoList(v)
}}>{v}</Tag>)
})
: <div style={{ textAlign: 'center', padding: '20px' }}>暂无历史</div>
}
</div>
</div>
<div className="search-land search-hot">
<label>
<span>热门搜索</span>
</label>
<div className="search-tag">
{
this.state.searchHot.length>0?
this.state.searchHot.map((v,i)=>{
return (<Tag key={i} onClick={()=>{
this.gotoList(v)
}}>{v}</Tag>)
})
:<div style={{textAlign:'center',padding:'20px'}}>暂无热门</div>
}
</div>
</div>
</div>
</div>
)
}
}
export default Search;
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from '@actions/searchAction'
//引入antd-mobile组件
import { SearchBar, Toast } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
<img src={require("@common/images/return.png")} alt="return" />
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar, Toast } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
<img src={require("@common/images/return.png")} alt="return" />
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar, Toast } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store/reducer'
//引入antd-mobile组件
import { SearchBar, Toast } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store/reducer'
//引入antd-mobile组件
import { SearchBar, Toast } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
console.log(searchReducer)
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store/reducer'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
console.log(searchReducer)
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
console.log(searchReducer)
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
// this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
console.log(searchReducer)
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
// this.props.search.changeVal(this.state.val)
}
submit() {
if (this.state.val === "") {
this.props.goto(null)
} else {
this.props.goto(this.state.val)
}
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onSubmit={() => {
this.submit()
}}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<button className="submit-btn" onClick={() => {
this.submit()
}}>搜索</button>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
// this.props.search.changeVal(this.state.val)
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<div className="submit-btn"
>搜索</div>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
// this.props.search.changeVal(this.state.val)
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索"></SearchBar>
</div>
<div className="right right-btn">
<div className="submit-btn"
>搜索课程</div>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
// this.props.search.changeVal(this.state.val)
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索课程"></SearchBar>
</div>
<div className="right right-btn">
<div className="submit-btn"
>搜索</div>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
let prevPath = sessionStorage.getItem('__search_prev_path__');
if (this.props.location.pathname === prevPath) {
this.props.history.push('/index');
sessionStorage.setItem('__search_prev_path__', '/');
} else {
this.props.history.push(prevPath)
}
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
// this.props.search.changeVal(this.state.val)
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
<i className="iconfont iconiconfront-68"></i>
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索课程"></SearchBar>
</div>
<div className="right right-btn">
<div className="submit-btn"
>搜索</div>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
<i className="iconfont iconiconfront-68"></i>
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索课程"></SearchBar>
</div>
<div className="right right-btn">
<div className="submit-btn"
>搜索</div>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
import React, { Component } from 'react'
//引入redux
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as searchAction from './store'
//引入antd-mobile组件
import { SearchBar } from 'antd-mobile'
//引入路由跳转装饰器
import { withRouter } from 'react-router-dom'
import './search_header.scss'
class SearchHead extends Component {
//默认参数
static defaultProps = {
returnbtn: false
}
// 构造函数
constructor(props) {
super(props);
this.state = {
visible: false,
selected: '',
val: this.props.value || ''
}
}
// 返回某个页面
returnPage() {
console.log(111);
}
//组件装载完毕
componentDidMount() {
this.refs.search.focus();
}
render() {
return (
<div className="search-head">
{
this.props.returnbtn
?
<div className="left" onClick={() => {
// 返回某个页面
this.returnPage()
}}>
{/* <img src={require("@common/images/return.png")} alt="return" /> */}
<i className="iconfont iconiconfront-68"></i>
</div>
: null
}
<div className="center">
<SearchBar
value={this.state.val}
showCancelButton
cancelText={" "}
ref="search"
focus={true}
onChange={(val) => {
this.setState({ val })
this.props.search.changeVal(val)
}}
placeholder="搜索课程"></SearchBar>
</div>
<div className="right right-btn">
<div className="submit-btn"
>搜索</div>
</div>
</div>
)
}
}
export default connect(
({ searchReducer }) => {
return {
searchVal: searchReducer.val
}
},
(dispatch) => {
return {
search: bindActionCreators(searchAction, dispatch)
}
}
)(withRouter(SearchHead))
\ No newline at end of file
.search-head{
height:44px;
display: flex;
background-color: #fff;
border-bottom: 1px solid #eee;
.left{
width:44px;
height:44px;
line-height:44px;
text-align: center;
img{
width:14px;
height:14px;
display: block;
padding:15px;
}
}
.center{
flex: 1;
.am-search{
background-color: #fff;
.am-search-input{
background-color: #f7f7f7;
border-radius:44px;
}
}
}
.right{
width:44px;
height:44px;
line-height:44px;
.am-icon-md{
padding:11px;
}
}
.right-btn{
width:auto;
.submit-btn{
line-height: 30px;
border:0;
height:30px;
margin:7px 10px;
margin-left:0;
border-radius:3px;
background-color:rgb(255, 91, 5);
color:#fff;
}
}
}
\ No newline at end of file
.search-head{
height:44px;
display: flex;
background-color: #fff;
border-bottom: 1px solid #eee;
.left{
width:44px;
height:44px;
line-height:44px;
text-align: center;
img{
width:14px;
height:14px;
display: block;
padding:15px;
}
}
.center{
flex: 1;
.am-search{
background-color: #fff;
.am-search-input{
background-color: #f7f7f7;
border-radius:44px;
}
}
}
.right{
width:44px;
height:44px;
line-height:44px;
.am-icon-md{
padding:11px;
}
}
.right-btn{
width:auto;
.submit-btn{
line-height: 30px;
border:0;
height:30px;
margin:7px 10px;
padding: 0 12px;
margin-left:0;
border-radius:3px;
background-color:rgb(255, 91, 5);
color:#fff;
}
}
}
\ No newline at end of file
.search-head{
height:44px;
display: flex;
background-color: #fff;
border-bottom: 1px solid #eee;
.left{
width:44px;
height:44px;
line-height:44px;
text-align: center;
img{
width:14px;
height:14px;
display: block;
padding:15px;
}
}
.center{
flex: 1;
.am-search{
background-color: #fff;
.am-search-input{
background-color: #f7f7f7;
border-radius:44px;
}
}
}
.right{
width:44px;
height:44px;
line-height:44px;
.am-icon-md{
padding:11px;
}
}
.right-btn{
width:auto;
.submit-btn{
line-height: 30px;
border:0;
height:30px;
margin:7px 10px;
padding: 0 12px;
margin-left:0;
border-radius:3px;
color:#fff;
}
}
}
\ No newline at end of file
.search-head{
height:44px;
display: flex;
background-color: #fff;
border-bottom: 1px solid #eee;
.left{
width:44px;
height:44px;
line-height:44px;
text-align: center;
img{
width:14px;
height:14px;
display: block;
padding:15px;
}
}
.center{
flex: 1;
.am-search{
background-color: #fff;
.am-search-input{
background-color: #f7f7f7;
border-radius:44px;
}
}
}
.right{
width:44px;
height:44px;
line-height:44px;
.am-icon-md{
padding:11px;
}
}
.right-btn{
width:auto;
.submit-btn{
line-height: 30px;
border:0;
height:30px;
margin:7px 10px;
padding: 0 12px;
margin-left:0;
border-radius:3px;
color: $color_333;
}
}
}
\ No newline at end of file
.search-head{
height:44px;
display: flex;
background-color: #fff;
border-bottom: 1px solid #eee;
.left{
width:44px;
height:44px;
line-height:44px;
text-align: center;
img{
width:14px;
height:14px;
display: block;
padding:15px;
}
}
.center{
flex: 1;
.am-search{
background-color: #fff;
.am-search-input{
background-color: #f7f7f7;
border-radius:44px;
}
}
}
.right{
width:44px;
height:44px;
line-height:44px;
.am-icon-md{
padding:11px;
}
}
.right-btn{
width:auto;
.submit-btn{
line-height: 30px;
border:0;
height:30px;
margin:7px 10px;
padding: 0 12px;
margin-left:0;
border-radius:3px;
font-size: $font_14;
color: $color_333;
}
}
}
\ No newline at end of file
.search-head{
height:44px;
display: flex;
background-color: #fff;
border-bottom: 1px solid #eee;
.left{
width:44px;
height:44px;
line-height:44px;
text-align: center;
img{
width:14px;
height:14px;
display: block;
padding:15px;
}
}
.center{
flex: 1;
.am-search{
background-color: #fff;
.am-search-input{
background-color: #f7f7f7;
border-radius:44px;
}
}
}
.right{
width:44px;
height:44px;
line-height:44px;
.am-icon-md{
padding:11px;
}
}
.right-btn{
width:auto;
.submit-btn{
line-height: 30px;
border:0;
height:30px;
margin:7px 10px;
padding: 0 12px;
margin-left:0;
border-radius:3px;
font-size: $font_14;
color: $color_333;
}
}
}
.am-search{
height: 43px;
}
\ No newline at end of file
.search-head{
height:44px;
display: flex;
background-color: #fff;
border-bottom: 1px solid #eee;
.left{
width:44px;
height:44px;
line-height:44px;
text-align: center;
img{
width:14px;
height:14px;
display: block;
padding:15px;
}
}
.center{
flex: 1;
.am-search{
background-color: #fff;
.am-search-input{
background-color: #f7f7f7;
border-radius:44px;
}
}
}
.right{
width:44px;
height:44px;
line-height:44px;
.am-icon-md{
padding:11px;
}
}
.right-btn{
width:auto;
.submit-btn{
line-height: 30px;
border:0;
height:30px;
margin:7px 0px;
padding: 0 12px;
margin-left:0;
border-radius:3px;
font-size: $font_14;
color: $color_333;
}
}
}
.am-search{
height: 43px;
}
\ No newline at end of file
.search-head{
height:44px;
display: flex;
background-color: #fff;
border-bottom: 1px solid #eee;
.left{
width:44px;
height:44px;
line-height:44px;
text-align: center;
img{
width:14px;
height:14px;
display: block;
padding:15px;
}
}
.center{
flex: 1;
.am-search{
background-color: #fff;
.am-search-input{
background-color: #f7f7f7;
border-radius:44px;
}
}
}
.right{
width:44px;
height:44px;
line-height:44px;
.am-icon-md{
padding:11px;
}
}
.right-btn{
width:auto;
.submit-btn{
line-height: 30px;
border:0;
height:30px;
margin:7px 0px;
padding: 0 12px;
margin-left:0;
border-radius:3px;
font-size: $font_14;
color: $color_333;
}
}
}
.am-search{
height: 43px;
padding: 0;
}
\ No newline at end of file
export const CHANGEVAL = 'CHANGEVAL'
\ No newline at end of file
import { CHANGEVAL } from '@types/searchType'
export const changeVal = (val) => {
return { type: CHANGEVAL, val }
}
\ No newline at end of file
import { CHANGEVAL } from './constants'
export const changeVal = (val) => {
return { type: CHANGEVAL, val }
}
\ No newline at end of file
import reducer from './reducer';
import * as constants from './constants';
export { reducer, actionCreators, constants };
\ No newline at end of file
import reducer from './reducer';
import * as constants from './constants';
export { reducer, constants };
\ No newline at end of file
import reducer from './reducer';
import * as constants from './constants';
export { reducer, constants };
\ No newline at end of file
const initState = {
}
export default (state = initState, actions) => {
switch (actions.type) {
default:
return state
}
}
\ No newline at end of file
const initState = {
}
export default (state = initState, actions) => {
console.log(state);
switch (actions.type) {
default:
return state
}
}
\ No newline at end of file
const initState = {
}
export default (state = initState, actions) => {
switch (actions.type) {
default:
return state
}
}
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
var devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
var store = createStore(reducer, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
var store = createStore(reducer, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
let devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
let store = createStore(reducer, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
let store = createStore(reducer, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
let devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
let store = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
let store = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
// let devTools = window.devToolsExtension ? window.devToolsExtension() : null
// // var store = createStore(reducer,compose(
// // applyMiddleware(thunk,logger),
// // devTools
// // ))
// if (window.devToolsExtension) {
// let store = createStore(store, compose(
// applyMiddleware(thunk, logger),
// devTools
// ))
// } else {
// let store = createStore(store, compose(
// applyMiddleware(thunk, logger)
// ))
// }
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
let devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
let store = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
let store = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
// let devTools = window.devToolsExtension ? window.devToolsExtension() : null
// // var store = createStore(reducer,compose(
// // applyMiddleware(thunk,logger),
// // devTools
// // ))
// if (window.devToolsExtension) {
// let store = createStore(store, compose(
// applyMiddleware(thunk, logger),
// devTools
// ))
// } else {
// let store = createStore(store, compose(
// applyMiddleware(thunk, logger)
// ))
// }
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
let devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
let store = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
let store = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
// import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
let devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
let store = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
let store = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
// import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
var devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
var tooltore = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
var tooltore = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={tooltore}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
// import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
var devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
var tooltore = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
var tooltore = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={tooltore}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
// import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
var devTools = window.devToolsExtension ? window.devToolsExtension() : null
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
var tooltore = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
var tooltore = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={tooltore}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
// import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
var devTools = window.devToolsExtension ? window.devToolsExtension() : null;
var tooltore = '';
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
tooltore = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
tooltore = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={tooltore}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
// import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
var devTools = window.devToolsExtension ? window.devToolsExtension() : null;
var tooltore = '';
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
console.log(store);
tooltore = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
tooltore = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={tooltore}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
// import Router from './router';
import store from './store'
import App from './App';
import './index.css'
// 默认样式
import './styles/index.scss';
// iconfont
import './font/iconfont.css';
var devTools = window.devToolsExtension ? window.devToolsExtension() : null;
var tooltore = '';
// var store = createStore(reducer,compose(
// applyMiddleware(thunk,logger),
// devTools
// ))
if (window.devToolsExtension) {
tooltore = createStore(store, compose(
applyMiddleware(thunk, logger),
devTools
))
} else {
tooltore = createStore(store, compose(
applyMiddleware(thunk, logger)
))
}
// ReactDOM.render(
// <Router />,
// document.getElementById('root'));
ReactDOM.render(
<Provider store={tooltore}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import React from 'react';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import Menu from './menu';
import Index from './components/Index';
import Classify from './components/classify';
import Study from './components/study';
import My from './components/my';
import CourseList from './components/classify/courselist';
import Search from './components/search/index'
const router = () => (
<Router>
<Switch>
<Route exact path="/" component={Index}></Route>
<Route path="/index" component={Index}></Route>
<Route path='/classify' component={Classify}></Route>
<Route path='/study' component={Study}></Route>
<Route path='/my' component={My}></Route>
<Route path='/courselist' component={CourseList}></Route>
<Route path='/search' component={Search}></Route>
</Switch>
<Menu />
</Router>
)
export default router;
\ No newline at end of file
import { createStore, compose, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import reducer from './reducer';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducer, composeEnhancers(
applyMiddleware(thunk)
));
export default store;
\ No newline at end of file
import { createStore, compose, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import reducer from './reducer';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducer, composeEnhancers(
applyMiddleware(thunk)
));
export default store;
\ No newline at end of file
import { combineReducers } from 'redux';
import loginReducer from '@/components/search/store/reducer';
const reducer = combineReducers({
loginReducer
});
export default reducer;
import { combineReducers } from 'redux';
import loginReducer from '@/components/search/store/reducer';
const reducer = combineReducers({
loginReducer
});
export default reducer;
import { combineReducers } from 'redux';
import searchReducer from '@/components/search/store/reducer';
const reducer = combineReducers({
searchReducer
});
export default reducer;
import { combineReducers } from 'redux-immutable';
import { reducer as loginReducer } from '@/components/search/store';
const reducer = combineReducers({
login: loginReducer
});
export default reducer;
import { combineReducers } from 'redux-immutable';
import { reducer as loginReducer } from '@/components/search/store/reducer';
const reducer = combineReducers({
login: loginReducer
});
export default reducer;
import { combineReducers } from 'redux-immutable';
import loginReducer from '@/components/search/store/reducer';
const reducer = combineReducers({
loginReducer
});
export default reducer;
import { combineReducers } from 'redux';
import loginReducer from '@/components/search/store/reducer';
const reducer = combineReducers({
loginReducer
});
export default reducer;
......@@ -274,6 +274,10 @@ module.exports = function(webpackEnv) {
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
'@': path.resolve(__dirname, '../src'),
'@common': path.resolve(__dirname, '../src/common'),
'@components': path.resolve(__dirname, '../src/components'),
'@base': path.resolve(__dirname, '../src/base')
},
plugins: [
// Adds support for installing with Plug'n'Play, leading to faster installs and adding
......
......@@ -50,6 +50,9 @@
"react-redux": "^7.0.2",
"react-router-dom": "^5.0.0",
"redux": "^4.0.1",
"redux-immutable": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"resolve": "1.10.0",
"sass-loader": "^7.1.0",
"sass-resources-loader": "^2.0.0",
......
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { LocaleProvider } from 'antd-mobile'
import { HashRouter } from 'react-router-dom'
import Routes from './router'
// import '@/common/styles/common.scss'
class App extends Component {
render() {
return (
<LocaleProvider>
<HashRouter>
<Routes></Routes>
</HashRouter>
</LocaleProvider>
);
}
}
export default connect()(App);
import React, { Component } from 'react'
import './tag.scss'
export default class Tag extends Component {
render() {
return (
<span className="tag" {...this.props}>
{this.props.children}
</span>
)
}
}
.tag{
display: block;
max-width: 100%;
overflow: hidden;
margin-right: 10px;
margin-bottom: 10px;
font-size:12px;
padding:4px 10px;
color:#555;
border-radius: 3px;
float: left;
background-color: #f0f2f5;
line-height: 20px;
}
\ No newline at end of file
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