Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
e1acf99d
Commit
e1acf99d
authored
Aug 23, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cart jump function in header-search component
parent
26714acd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
15 deletions
+33
-15
src/common/HeaderSearch/index.js
+18
-11
src/components/classify/courselist.js
+9
-2
src/components/preferential/index.js
+6
-2
No files found.
src/common/HeaderSearch/index.js
View file @
e1acf99d
...
@@ -4,32 +4,36 @@ import './index.scss'
...
@@ -4,32 +4,36 @@ import './index.scss'
class
HeaderBar
extends
Component
{
class
HeaderBar
extends
Component
{
toSearch
()
{
toSearch
()
{
window
.
location
.
href
=
'/search'
window
.
location
.
href
=
'/search'
;
}
}
return
()
{
return
()
{
window
.
location
.
href
=
'/'
window
.
location
.
href
=
'/'
;
}
}
goShop
=
()
=>
{
goShop
=
()
=>
{
location
.
replace
(
'/shopcart'
)
const
{
isLogin
=
false
}
=
this
.
props
;
let
url
=
isLogin
?
'/shopcart'
:
'/passport'
;
window
.
location
.
replace
(
url
);
}
}
render
()
{
render
()
{
{
console
.
log
(
this
.
props
.
toHref
);
}
return
(
return
(
<
div
className
=
'preferential'
>
<
div
className
=
'preferential'
>
<
div
className
=
"search-nav"
>
<
div
className
=
"search-nav"
>
{
{
!
this
.
props
.
toHref
&&
!
this
.
props
.
toHref
&&
<
i
className
=
{
'iconfont iconiconfront-68 return'
}
onClick
=
{
this
.
return
.
bind
(
this
)}
><
/i
>
<
i
className
=
{
'iconfont iconiconfront-68 return'
}
onClick
=
{
this
.
return
.
bind
(
this
)}
/
>
}
}
{
{
this
.
props
.
toHref
&&
this
.
props
.
toHref
&&
<
i
className
=
{
'iconfont iconiconfront-68 return'
}
onClick
=
{
this
.
props
.
toHref
}
><
/i
>
<
i
className
=
{
'iconfont iconiconfront-68 return'
}
onClick
=
{
this
.
props
.
toHref
}
/
>
}
}
<
SearchBar
<
SearchBar
placeholder
=
"搜索课程"
placeholder
=
"搜索课程"
...
@@ -37,7 +41,10 @@ class HeaderBar extends Component {
...
@@ -37,7 +41,10 @@ class HeaderBar extends Component {
onFocus
=
{
this
.
toSearch
.
bind
(
this
)}
onFocus
=
{
this
.
toSearch
.
bind
(
this
)}
showCancelButton
=
{
false
}
showCancelButton
=
{
false
}
/
>
/
>
<
i
className
=
{
'iconfont icongouwuche-xianxing shopping-cart'
}
onClick
=
{
this
.
goShop
}
><
/i
>
<
i
className
=
{
'iconfont icongouwuche-xianxing shopping-cart'
}
onClick
=
{
this
.
goShop
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
)
...
@@ -45,4 +52,4 @@ class HeaderBar extends Component {
...
@@ -45,4 +52,4 @@ class HeaderBar extends Component {
}
}
export
default
HeaderBar
export
default
HeaderBar
;
src/components/classify/courselist.js
View file @
e1acf99d
...
@@ -10,7 +10,9 @@ import Loading from '@/common/Loading'
...
@@ -10,7 +10,9 @@ import Loading from '@/common/Loading'
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
getCourses
}
from
'./../detail/actions'
;
import
{
getCourses
}
from
'./../detail/actions'
;
@
connect
()
@
connect
(({
user
})
=>
({
user
}))
class
Classify
extends
Component
{
class
Classify
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
...
@@ -117,6 +119,8 @@ class Classify extends Component {
...
@@ -117,6 +119,8 @@ class Classify extends Component {
}
}
render
()
{
render
()
{
const
{
user
=
{}
}
=
this
.
props
;
let
isLogin
=
user
.
data
&&
user
.
data
.
uid
?
true
:
false
;
const
bottom
=
(
const
bottom
=
(
<
i
className
=
{
'iconfont iconiconfront-69 pull-down'
}
><
/i
>
<
i
className
=
{
'iconfont iconiconfront-69 pull-down'
}
><
/i
>
)
)
...
@@ -128,7 +132,10 @@ class Classify extends Component {
...
@@ -128,7 +132,10 @@ class Classify extends Component {
return
(
return
(
<
div
className
=
'class-child'
>
<
div
className
=
'class-child'
>
<
HeaderSearch
toHref
=
{
this
.
toClassify
}
><
/HeaderSearch
>
<
HeaderSearch
isLogin
=
{
isLogin
}
toHref
=
{
this
.
toClassify
}
/
>
<
Loading
isLoading
=
{
this
.
state
.
isLoading
}
>
<
Loading
isLoading
=
{
this
.
state
.
isLoading
}
>
<
div
className
=
'class-content'
>
<
div
className
=
'class-content'
>
<
WhiteSpace
/>
<
WhiteSpace
/>
...
...
src/components/preferential/index.js
View file @
e1acf99d
...
@@ -10,7 +10,9 @@ import {bindActionCreators} from 'redux';
...
@@ -10,7 +10,9 @@ import {bindActionCreators} from 'redux';
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
getCourses
}
from
'./../detail/actions'
;
import
{
getCourses
}
from
'./../detail/actions'
;
@
connect
()
@
connect
(({
user
})
=>
({
user
}))
class
Preferential
extends
Component
{
class
Preferential
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
...
@@ -91,9 +93,11 @@ class Preferential extends Component {
...
@@ -91,9 +93,11 @@ class Preferential extends Component {
{
title
:
'砍价专区'
},
{
title
:
'砍价专区'
},
{
title
:
'一键拼团'
}
{
title
:
'一键拼团'
}
]
]
const
{
user
=
{}
}
=
this
.
props
;
let
isLogin
=
user
.
data
&&
user
.
data
.
uid
?
true
:
false
;
return
(
return
(
<
div
className
=
'preferential'
>
<
div
className
=
'preferential'
>
<
HeaderSearch
><
/HeaderSearch
>
<
HeaderSearch
isLogin
=
{
isLogin
}
/
>
<
Loading
isLoading
=
{
this
.
state
.
isLoading
}
>
<
Loading
isLoading
=
{
this
.
state
.
isLoading
}
>
<
div
className
=
'class-content'
>
<
div
className
=
'class-content'
>
<
WhiteSpace
/>
<
WhiteSpace
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment