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
d5771090
Commit
d5771090
authored
Aug 19, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
myCourses
parent
1e1965e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
src/components/study/myCourses/actions.js
+2
-2
src/components/study/myCourses/index.js
+5
-5
src/components/study/myCourses/reducers.js
+3
-0
No files found.
src/components/study/myCourses/actions.js
View file @
d5771090
...
...
@@ -26,11 +26,11 @@ export const getMyCourses = payload => dispatch => {
return
http
.
get
(
`
${
API
.
home
}
/m/my_course/
${
payload
.
page
}
/
${
payload
.
num
}
`
)
.
then
(
res
=>
{
const
{
data
,
code
,
msg
}
=
res
.
data
if
(
data
.
length
===
0
)
{
if
(
code
==
200
&&
data
.
length
===
0
)
{
dispatch
(
nomoreCourse
())
return
}
if
(
data
.
length
%
10
!==
0
)
{
if
(
code
==
200
&&
data
.
length
%
10
!==
0
)
{
dispatch
(
nomoreCourse
())
}
dispatch
(
receiveMyCourses
({
...
...
src/components/study/myCourses/index.js
View file @
d5771090
...
...
@@ -99,15 +99,15 @@ class MyCourses extends PureComponent {
},
200
)
render
()
{
let
list
=
this
.
props
.
courseList
let
{
courseList
,
user
}
=
this
.
props
return
<
Loading
isLoading
=
{
this
.
props
.
isLoading
}
>
{
list
&&
l
ist
.
length
!==
0
courseList
&&
courseL
ist
.
length
!==
0
?
<>
<
div
className
=
"my-course-uid"
>
{
`加群请备注您的学号:
${
this
.
props
.
user
.
data
.
uid
}
`
}
{
`加群请备注您的学号:
${
!
user
.
hasError
&&
this
.
props
.
user
.
data
.
uid
}
`
}
<
/div
>
<
InfiniteScroll
pageStart
=
{
0
}
...
...
@@ -117,7 +117,7 @@ class MyCourses extends PureComponent {
>
<
ul
ref
=
{
el
=>
this
.
list
=
el
}
>
{
l
ist
.
map
((
item
,
index
)
=>
{
courseL
ist
.
map
((
item
,
index
)
=>
{
const
Info
=
(
<
div
className
=
"info"
>
...
...
@@ -159,7 +159,7 @@ class MyCourses extends PureComponent {
<
/ul
>
<
/InfiniteScroll
>
{
l
ist
.
length
%
10
!==
0
?
courseL
ist
.
length
%
10
!==
0
?
<
AddCourse
addCourseClick
=
{
this
.
addCourseClick
}
/
>
:
null
}
...
...
src/components/study/myCourses/reducers.js
View file @
d5771090
...
...
@@ -4,6 +4,7 @@ import {
NOMORE_COURSE
,
START_FETCHING_COURSES
}
from
'./actions'
import
{
SET_CURRENT_USER
}
from
'@/store/userAction'
const
initialState
=
{
switchTab
:
false
,
...
...
@@ -31,6 +32,8 @@ export default function myCourses(state = initialState, action) {
return
{...
state
,
switchTab
:
action
.
payload
}
case
NOMORE_COURSE
:
return
{...
state
,
noMore
:
true
}
case
SET_CURRENT_USER
:
return
action
.
payload
.
hasError
?
initialState
:
{...
state
,
page
:
0
}
default
:
return
state
}
...
...
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