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
e1df1739
Commit
e1df1739
authored
Aug 19, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to course detail modify
parent
6e9fd950
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
11 deletions
+25
-11
src/components/classify/index.js
+25
-11
No files found.
src/components/classify/index.js
View file @
e1df1739
...
...
@@ -6,8 +6,10 @@ import {Link} from 'react-router-dom'
import
{
Toast
}
from
'antd-mobile'
import
{
HeaderBar
}
from
"@/common"
import
Loading
from
'@/common/Loading'
import
{
connet
}
from
'react-redux'
;
import
{
getCourses
}
from
'./../detail/actions'
;
@
connet
()
class
Classify
extends
Component
{
constructor
(
props
)
{
super
(
props
)
...
...
@@ -50,21 +52,31 @@ class Classify extends Component {
})
}
toCourseDetail
=
(
id
)
=>
{
const
{
dispatch
,
history
}
=
this
.
props
;
dispatch
(
getCourses
(
id
,
()
=>
{
history
.
push
(
`/detail?id=
${
id
}
`
);
return
false
;
}));
}
render
()
{
return
(
<
div
className
=
'class-box'
>
<
HeaderBar
title
=
'分类'
arrow
=
{
false
}
cart
=
{
false
}
><
/HeaderBar
>
<
Loading
isLoading
=
{
this
.
state
.
isLoading
}
>
<
ClassCourseBox
data
=
{
this
.
state
.
camp
.
list
}
title
=
{
this
.
state
.
camp
.
name
}
type
=
{
1
}
/
>
<
ClassCourseBox
data
=
{
this
.
state
.
employment
.
list
}
title
=
{
this
.
state
.
employment
.
name
}
type
=
{
1
}
/
>
<
ClassCourseBox
data
=
{
this
.
state
.
basics
.
list
}
title
=
{
this
.
state
.
basics
.
name
}
type
=
{
2
}
/
>
<
ClassCourseBox
data
=
{
this
.
state
.
advanced
.
list
}
title
=
{
this
.
state
.
advanced
.
name
}
type
=
{
2
}
/
>
<
ClassCourseBox
toDetail
=
{
this
.
toCourseDetail
}
data
=
{
this
.
state
.
camp
.
list
}
title
=
{
this
.
state
.
camp
.
name
}
type
=
{
1
}
/
>
<
ClassCourseBox
toDetail
=
{
this
.
toCourseDetail
}
data
=
{
this
.
state
.
employment
.
list
}
title
=
{
this
.
state
.
employment
.
name
}
type
=
{
1
}
/
>
<
ClassCourseBox
toDetail
=
{
this
.
toCourseDetail
}
data
=
{
this
.
state
.
basics
.
list
}
title
=
{
this
.
state
.
basics
.
name
}
type
=
{
2
}
/
>
<
ClassCourseBox
toDetail
=
{
this
.
toCourseDetail
}
data
=
{
this
.
state
.
advanced
.
list
}
title
=
{
this
.
state
.
advanced
.
name
}
type
=
{
2
}
/
>
<
div
className
=
"vip"
>
{
this
.
state
.
special
.
list
&&
this
.
state
.
special
.
list
.
length
>
0
&&
this
.
state
.
special
.
list
.
map
((
item
,
index
)
=>
{
return
(
<
Link
key
=
{
index
}
to
=
{
`/detail?id=
${
item
.
course_id
}
`
}
>
<
a
href
=
"javascript:;"
onClick
=
{()
=>
this
.
toCourseDetail
(
item
.
course_id
)}
key
=
{
index
}
>
{
/* <Link key={index} to={`/detail?id=${item.course_id}`}> */
}
<
img
src
=
{
item
.
course_img
}
alt
=
""
/>
<
/Link
>
{
/* </Link> */
}
<
/a
>
)
})
}
...
...
@@ -76,19 +88,21 @@ class Classify extends Component {
}
// 课程图片形式展示 点击图片直接跳转课程详情页面
function
ClassCourseA
({
data
})
{
function
ClassCourseA
({
data
,
toDetail
})
{
return
(
<
div
className
=
'items-box'
>
{
data
&&
data
.
length
>
0
&&
data
.
map
((
item
,
index
)
=>
{
return
(
<
Link
to
=
{
`/detail?id=
${
item
.
course_id
}
`
}
key
=
{
index
}
className
=
'item-banner'
>
<
a
href
=
"javascript:;"
onClick
=
{()
=>
toDetail
(
item
.
course_id
)}
key
=
{
index
}
className
=
'item-banner'
>
{
/* <Link to={`/detail?id=${item.course_id}`} key={index} className='item-banner'> */
}
<
img
src
=
{
item
.
course_img
}
alt
=
""
/>
{
(
item
.
is_aist
&&
<
span
className
=
'return_cash'
><
/span>
)
}
<
/Link
>
{
/* </Link> */
}
<
/a
>
)
})
}
...
...
@@ -121,7 +135,7 @@ function ClassCourseBox(props) {
{
props
.
title
}
<
/p
>
{
props
.
type
===
1
&&
<
ClassCourseA
data
=
{
props
.
data
}
/
>
<
ClassCourseA
data
=
{
props
.
data
}
toDetail
=
{
props
.
toDetail
}
/
>
}
{
props
.
type
===
2
&&
<
ClassCourseB
data
=
{
props
.
data
}
/
>
...
...
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