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
88418b6c
Commit
88418b6c
authored
Jun 11, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分销排行榜接口调试
parent
6cb99529
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
43 deletions
+55
-43
src/components/scholarship/CategoryItem/CategoryItem.js
+2
-2
src/components/scholarship/SortItem/SortItem.js
+7
-7
src/components/scholarship/index.js
+46
-34
No files found.
src/components/scholarship/CategoryItem/CategoryItem.js
View file @
88418b6c
...
...
@@ -7,7 +7,7 @@ export default class CategoryItem extends Component {
super
(
props
);
}
render
()
{
const
{
c
ategory_nam
e
,
price1
,
price0
,
first_level_tip
,
image_name
,
upgrade
,
upgradeImg
}
=
this
.
props
;
const
{
c
ourse_titl
e
,
price1
,
price0
,
first_level_tip
,
image_name
,
upgrade
,
upgradeImg
}
=
this
.
props
;
return
(
<
WingBlank
>
<
div
className
=
{
'category'
}
>
...
...
@@ -21,7 +21,7 @@ export default class CategoryItem extends Component {
<
/div
>
<
div
className
=
{
'content'
}
>
<
Flex
direction
=
'column'
justify
=
'around'
align
=
'start'
style
=
{{
height
:
'90px'
}}
>
<
p
className
=
{
'text-overflow-one'
}
>
{
c
ategory_nam
e
}
<
/p
>
<
p
className
=
{
'text-overflow-one'
}
>
{
c
ourse_titl
e
}
<
/p
>
<
p
><
span
className
=
{
'priceNow'
}
>
{
`¥
${
price1
}
`
}
<
/span><span className={'pricePrimary'}>{`¥${price0}`}</
span
><
/p
>
<
div
className
=
{
'shareMoney'
}
>
{
`分享赚
${
first_level_tip
}
元`
}
<
/div
>
<
/Flex
>
...
...
src/components/scholarship/SortItem/SortItem.js
View file @
88418b6c
...
...
@@ -12,15 +12,15 @@ export default class SortItem extends Component {
super
(
props
);
}
render
()
{
const
{
sortNum
,
avatar
,
shareName
,
money
}
=
this
.
props
;
const
{
sortNum
,
avatar
_file
,
user_name
,
total_account
}
=
this
.
props
;
let
sortImgSrc
=
''
;
if
(
sortNum
===
'1'
)
{
if
(
sortNum
===
1
)
{
sortImgSrc
=
FIRST
;
}
if
(
sortNum
===
'2'
)
{
if
(
sortNum
===
2
)
{
sortImgSrc
=
SECOND
;
}
if
(
sortNum
===
'3'
)
{
if
(
sortNum
===
3
)
{
sortImgSrc
=
THIRD
;
}
return
(
...
...
@@ -35,12 +35,12 @@ export default class SortItem extends Component {
<
/div
>
<
div
className
=
{
'avatar'
}
>
<
Flex
justify
=
'start'
>
<
img
src
=
{
avatar
}
className
=
{
'avatarImg'
}
><
/img
>
<
span
className
=
{
'text-overflow-one'
}
style
=
{{
color
:
'#333333'
}}
>
{
shareN
ame
}
<
/span
>
<
img
src
=
{
avatar
_file
}
className
=
{
'avatarImg'
}
><
/img
>
<
span
className
=
{
'text-overflow-one'
}
style
=
{{
color
:
'#333333'
}}
>
{
user_n
ame
}
<
/span
>
<
/Flex
>
<
/div
>
<
div
className
=
{
'money'
}
>
<
Flex
justify
=
'center'
>
{
`
${
money
}
元`
}
<
/Flex
>
<
Flex
justify
=
'center'
>
{
`
${
total_account
}
元`
}
<
/Flex
>
<
/div
>
<
/Flex
>
<
/div
>
...
...
src/components/scholarship/index.js
View file @
88418b6c
...
...
@@ -96,21 +96,34 @@ class _Scholarship extends Component {
isLoading
:
true
,
});
http
.
get
(
`
${
api
.
home
}
/m/dist/course_list`
).
then
((
res
)
=>
{
let
apiUrl
=
`
${
api
.
home
}
/m/dist/course_list`
;
if
(
this
.
tabIndex
===
1
)
{
apiUrl
=
`
${
api
.
home
}
/m/dist/commission_ranking_list`
};
http
.
get
(
apiUrl
).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
code
!==
200
)
{
this
.
setState
({
isLoading
:
false
});
return
;
}
if
(
!
res
.
data
.
data
.
list
||
res
.
data
.
data
.
list
.
length
===
0
)
{
this
.
setState
({
isLoading
:
false
,
hasMore
:
false
,
showNoData
:
this
.
searchObject
.
page
===
1
});
return
;
let
newData
=
[];
if
(
this
.
tabIndex
===
0
)
{
if
(
!
res
.
data
.
data
.
list
||
res
.
data
.
data
.
list
.
length
===
0
)
{
this
.
setState
({
isLoading
:
false
,
hasMore
:
false
,
showNoData
:
this
.
searchObject
.
page
===
1
});
return
;
}
newData
=
res
.
data
.
data
.
list
;
}
else
{
if
(
!
res
.
data
.
data
||
res
.
data
.
data
.
length
===
0
)
{
this
.
setState
({
isLoading
:
false
,
hasMore
:
false
,
showNoData
:
this
.
searchObject
.
page
===
1
});
return
;
}
newData
=
res
.
data
.
data
;
}
console
.
log
(
res
);
this
.
searchObject
.
page
++
;
const
newData
=
res
.
data
.
data
.
list
;
this
.
rData
=
[...
this
.
rData
,
...
newData
];
this
.
setState
({
...
...
@@ -133,7 +146,6 @@ class _Scholarship extends Component {
this
.
onEndReached
();
}
render
()
{
console
.
log
(
this
.
props
);
const
row
=
(
rowData
,
rowID
...
...
@@ -142,10 +154,10 @@ class _Scholarship extends Component {
};
const
row1
=
(
rowData
,
rowData
,
rowID
)
=>
{
return
<
SortItem
{...
rowData
}
key
=
{
rowID
}
/>
;
return
<
SortItem
{...
rowData
}
sortNum
=
{
this
.
rData
.
indexOf
(
rowData
)
+
1
}
key
=
{
rowID
}
/>
;
};
const
separator
=
(
sectionID
,
rowID
)
=>
(
...
...
@@ -162,6 +174,7 @@ class _Scholarship extends Component {
waitMoneyDetail
,
codeSrc
,
}
=
this
.
state
;
const
{
hasError
}
=
this
.
props
.
user
;
return
(
<
div
className
=
{
'scholarship'
}
>
<
div
className
=
{
'account-container'
}
>
...
...
@@ -181,7 +194,7 @@ class _Scholarship extends Component {
<
/WingBlank
>
<
WhiteSpace
><
/WhiteSpace
>
{
this
.
tabIndex
===
0
?
(
hasError
?
(
<>
<
WhiteSpace
><
/WhiteSpace
>
<
Flex
justify
=
'center'
>
...
...
@@ -205,7 +218,7 @@ class _Scholarship extends Component {
<
div
className
=
{
'over-am-list-item'
}
>
{
this
.
tabIndex
===
0
?
(
null
)
:
(
hasError
?
(
null
)
:
(
<>
<
div
>
<
List
>
...
...
@@ -225,7 +238,7 @@ class _Scholarship extends Component {
<
/
>
)
}
<
div
style
=
{{
backgroundColor
:
'#FFF'
}}
>
<
div
style
=
{{
backgroundColor
:
'#FFF'
}}
>
<
Tabs
tabs
=
{
this
.
tabList
}
initialPage
=
{
0
}
// onChange={this.changeTab}
...
...
@@ -235,18 +248,18 @@ class _Scholarship extends Component {
this
.
rData
=
[];
this
.
searchObject
.
page
=
1
;
this
.
setState
(
{
isLoading
:
false
,
hasMore
:
true
,
dataSource
:
this
.
state
.
dataSource
.
cloneWithRows
(
this
.
rData
),
},
()
=>
{
this
.
onEndReached
();
}
{
isLoading
:
false
,
hasMore
:
true
,
dataSource
:
this
.
state
.
dataSource
.
cloneWithRows
(
this
.
rData
),
},
()
=>
{
this
.
onEndReached
();
}
);
}}
}}
>
<
div
style
=
{{
marginTop
:
'15px'
,
backgroundColor
:
'#FFF'
}}
>
<
div
style
=
{{
marginTop
:
'15px'
,
backgroundColor
:
'#FFF'
}}
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
...
...
@@ -355,19 +368,18 @@ class _Scholarship extends Component {
}
}
const
mapStateToProps
=
(
state
)
=>
{
console
.
log
(
state
);
return
{
user
:
{
},
user
:
{
...
state
.
user
},
};
};
const
mapDispatchToProps
=
(
dispatch
)
=>
{
};
const
mapDispatchToProps
=
(
dispatch
)
=>
{
return
{};
};
export
const
Scholarship
=
connect
(
};
export
const
Scholarship
=
connect
(
mapStateToProps
,
mapDispatchToProps
)(
_Scholarship
);
)(
_Scholarship
);
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