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 {
...
@@ -7,7 +7,7 @@ export default class CategoryItem extends Component {
super
(
props
);
super
(
props
);
}
}
render
()
{
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
(
return
(
<
WingBlank
>
<
WingBlank
>
<
div
className
=
{
'category'
}
>
<
div
className
=
{
'category'
}
>
...
@@ -21,7 +21,7 @@ export default class CategoryItem extends Component {
...
@@ -21,7 +21,7 @@ export default class CategoryItem extends Component {
<
/div
>
<
/div
>
<
div
className
=
{
'content'
}
>
<
div
className
=
{
'content'
}
>
<
Flex
direction
=
'column'
justify
=
'around'
align
=
'start'
style
=
{{
height
:
'90px'
}}
>
<
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
>
<
p
><
span
className
=
{
'priceNow'
}
>
{
`¥
${
price1
}
`
}
<
/span><span className={'pricePrimary'}>{`¥${price0}`}</
span
><
/p
>
<
div
className
=
{
'shareMoney'
}
>
{
`分享赚
${
first_level_tip
}
元`
}
<
/div
>
<
div
className
=
{
'shareMoney'
}
>
{
`分享赚
${
first_level_tip
}
元`
}
<
/div
>
<
/Flex
>
<
/Flex
>
...
...
src/components/scholarship/SortItem/SortItem.js
View file @
88418b6c
...
@@ -12,15 +12,15 @@ export default class SortItem extends Component {
...
@@ -12,15 +12,15 @@ export default class SortItem extends Component {
super
(
props
);
super
(
props
);
}
}
render
()
{
render
()
{
const
{
sortNum
,
avatar
,
shareName
,
money
}
=
this
.
props
;
const
{
sortNum
,
avatar
_file
,
user_name
,
total_account
}
=
this
.
props
;
let
sortImgSrc
=
''
;
let
sortImgSrc
=
''
;
if
(
sortNum
===
'1'
)
{
if
(
sortNum
===
1
)
{
sortImgSrc
=
FIRST
;
sortImgSrc
=
FIRST
;
}
}
if
(
sortNum
===
'2'
)
{
if
(
sortNum
===
2
)
{
sortImgSrc
=
SECOND
;
sortImgSrc
=
SECOND
;
}
}
if
(
sortNum
===
'3'
)
{
if
(
sortNum
===
3
)
{
sortImgSrc
=
THIRD
;
sortImgSrc
=
THIRD
;
}
}
return
(
return
(
...
@@ -35,12 +35,12 @@ export default class SortItem extends Component {
...
@@ -35,12 +35,12 @@ export default class SortItem extends Component {
<
/div
>
<
/div
>
<
div
className
=
{
'avatar'
}
>
<
div
className
=
{
'avatar'
}
>
<
Flex
justify
=
'start'
>
<
Flex
justify
=
'start'
>
<
img
src
=
{
avatar
}
className
=
{
'avatarImg'
}
><
/img
>
<
img
src
=
{
avatar
_file
}
className
=
{
'avatarImg'
}
><
/img
>
<
span
className
=
{
'text-overflow-one'
}
style
=
{{
color
:
'#333333'
}}
>
{
shareN
ame
}
<
/span
>
<
span
className
=
{
'text-overflow-one'
}
style
=
{{
color
:
'#333333'
}}
>
{
user_n
ame
}
<
/span
>
<
/Flex
>
<
/Flex
>
<
/div
>
<
/div
>
<
div
className
=
{
'money'
}
>
<
div
className
=
{
'money'
}
>
<
Flex
justify
=
'center'
>
{
`
${
money
}
元`
}
<
/Flex
>
<
Flex
justify
=
'center'
>
{
`
${
total_account
}
元`
}
<
/Flex
>
<
/div
>
<
/div
>
<
/Flex
>
<
/Flex
>
<
/div
>
<
/div
>
...
...
src/components/scholarship/index.js
View file @
88418b6c
...
@@ -96,21 +96,34 @@ class _Scholarship extends Component {
...
@@ -96,21 +96,34 @@ class _Scholarship extends Component {
isLoading
:
true
,
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
)
{
if
(
res
.
data
.
code
!==
200
)
{
this
.
setState
({
isLoading
:
false
});
this
.
setState
({
isLoading
:
false
});
return
;
return
;
}
}
if
(
!
res
.
data
.
data
.
list
||
res
.
data
.
data
.
list
.
length
===
0
)
{
this
.
setState
({
isLoading
:
false
,
hasMore
:
false
,
showNoData
:
this
.
searchObject
.
page
===
1
});
let
newData
=
[];
return
;
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
++
;
this
.
searchObject
.
page
++
;
const
newData
=
res
.
data
.
data
.
list
;
this
.
rData
=
[...
this
.
rData
,
...
newData
];
this
.
rData
=
[...
this
.
rData
,
...
newData
];
this
.
setState
({
this
.
setState
({
...
@@ -133,7 +146,6 @@ class _Scholarship extends Component {
...
@@ -133,7 +146,6 @@ class _Scholarship extends Component {
this
.
onEndReached
();
this
.
onEndReached
();
}
}
render
()
{
render
()
{
console
.
log
(
this
.
props
);
const
row
=
(
const
row
=
(
rowData
,
rowData
,
rowID
rowID
...
@@ -142,10 +154,10 @@ class _Scholarship extends Component {
...
@@ -142,10 +154,10 @@ class _Scholarship extends Component {
};
};
const
row1
=
(
const
row1
=
(
rowData
,
rowData
,
rowID
rowID
)
=>
{
)
=>
{
return
<
SortItem
{...
rowData
}
key
=
{
rowID
}
/>
;
return
<
SortItem
{...
rowData
}
sortNum
=
{
this
.
rData
.
indexOf
(
rowData
)
+
1
}
key
=
{
rowID
}
/>
;
};
};
const
separator
=
(
sectionID
,
rowID
)
=>
(
const
separator
=
(
sectionID
,
rowID
)
=>
(
...
@@ -162,6 +174,7 @@ class _Scholarship extends Component {
...
@@ -162,6 +174,7 @@ class _Scholarship extends Component {
waitMoneyDetail
,
waitMoneyDetail
,
codeSrc
,
codeSrc
,
}
=
this
.
state
;
}
=
this
.
state
;
const
{
hasError
}
=
this
.
props
.
user
;
return
(
return
(
<
div
className
=
{
'scholarship'
}
>
<
div
className
=
{
'scholarship'
}
>
<
div
className
=
{
'account-container'
}
>
<
div
className
=
{
'account-container'
}
>
...
@@ -181,7 +194,7 @@ class _Scholarship extends Component {
...
@@ -181,7 +194,7 @@ class _Scholarship extends Component {
<
/WingBlank
>
<
/WingBlank
>
<
WhiteSpace
><
/WhiteSpace
>
<
WhiteSpace
><
/WhiteSpace
>
{
{
this
.
tabIndex
===
0
?
(
hasError
?
(
<>
<>
<
WhiteSpace
><
/WhiteSpace
>
<
WhiteSpace
><
/WhiteSpace
>
<
Flex
justify
=
'center'
>
<
Flex
justify
=
'center'
>
...
@@ -205,7 +218,7 @@ class _Scholarship extends Component {
...
@@ -205,7 +218,7 @@ class _Scholarship extends Component {
<
div
className
=
{
'over-am-list-item'
}
>
<
div
className
=
{
'over-am-list-item'
}
>
{
{
this
.
tabIndex
===
0
?
(
null
)
:
(
hasError
?
(
null
)
:
(
<>
<>
<
div
>
<
div
>
<
List
>
<
List
>
...
@@ -225,7 +238,7 @@ class _Scholarship extends Component {
...
@@ -225,7 +238,7 @@ class _Scholarship extends Component {
<
/
>
<
/
>
)
)
}
}
<
div
style
=
{{
backgroundColor
:
'#FFF'
}}
>
<
div
style
=
{{
backgroundColor
:
'#FFF'
}}
>
<
Tabs
tabs
=
{
this
.
tabList
}
<
Tabs
tabs
=
{
this
.
tabList
}
initialPage
=
{
0
}
initialPage
=
{
0
}
// onChange={this.changeTab}
// onChange={this.changeTab}
...
@@ -235,18 +248,18 @@ class _Scholarship extends Component {
...
@@ -235,18 +248,18 @@ class _Scholarship extends Component {
this
.
rData
=
[];
this
.
rData
=
[];
this
.
searchObject
.
page
=
1
;
this
.
searchObject
.
page
=
1
;
this
.
setState
(
this
.
setState
(
{
{
isLoading
:
false
,
isLoading
:
false
,
hasMore
:
true
,
hasMore
:
true
,
dataSource
:
this
.
state
.
dataSource
.
cloneWithRows
(
this
.
rData
),
dataSource
:
this
.
state
.
dataSource
.
cloneWithRows
(
this
.
rData
),
},
},
()
=>
{
()
=>
{
this
.
onEndReached
();
this
.
onEndReached
();
}
}
);
);
}}
}}
>
>
<
div
style
=
{{
marginTop
:
'15px'
,
backgroundColor
:
'#FFF'
}}
>
<
div
style
=
{{
marginTop
:
'15px'
,
backgroundColor
:
'#FFF'
}}
>
{
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
<
ListView
...
@@ -355,19 +368,18 @@ class _Scholarship extends Component {
...
@@ -355,19 +368,18 @@ class _Scholarship extends Component {
}
}
}
}
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
console
.
log
(
state
);
return
{
return
{
user
:
{
user
:
{
...
state
.
user
},
},
};
};
};
};
const
mapDispatchToProps
=
(
dispatch
)
=>
{
const
mapDispatchToProps
=
(
dispatch
)
=>
{
return
{};
return
{};
};
};
export
const
Scholarship
=
connect
(
export
const
Scholarship
=
connect
(
mapStateToProps
,
mapStateToProps
,
mapDispatchToProps
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