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
4ab8124c
Commit
4ab8124c
authored
Sep 27, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
精品特惠 赚奖学金 tab替换
parent
c047e3d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
86 deletions
+103
-86
src/components/preferential/index.js
+60
-54
src/components/scholarship/index.js
+43
-32
No files found.
src/components/preferential/index.js
View file @
4ab8124c
...
...
@@ -43,7 +43,8 @@ class Preferential extends Component {
http
.
get
(
`
${
API
.
home
}
/m/home/bargainZone`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
this
.
setState
({
dataList
:
res
.
data
.
data
dataList
:
res
.
data
.
data
,
isLoading
:
false
,
})
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
)
...
...
@@ -55,7 +56,8 @@ class Preferential extends Component {
http
.
get
(
`
${
API
.
home
}
/m/home/grouponList`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
this
.
setState
({
dataList
:
res
.
data
.
data
dataList
:
res
.
data
.
data
,
isLoading
:
false
,
})
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
)
...
...
@@ -64,7 +66,10 @@ class Preferential extends Component {
}
// tab 切换
ontabclick
=
(
tab
,
index
)
=>
{
this
.
state
.
courseStatus
=
index
this
.
setState
({
courseStatus
:
index
,
isLoading
:
true
,
})
switch
(
index
)
{
case
0
:
this
.
specialSale
()
...
...
@@ -104,66 +109,67 @@ class Preferential extends Component {
animated
=
{
false
}
onChange
=
{(
tab
,
index
)
=>
this
.
ontabclick
(
tab
,
index
)}
swipeable
=
{
false
}
page
=
{
this
.
state
.
courseStatus
}
renderTabBar
=
{
props
=>
<
div
className
=
{
'custom-tab-bar'
}
>
<
Tabs
.
DefaultTabBar
{...
props
}
/
>
<
/div>
}
>
<
div
className
=
'tabs'
>
<
ul
>
{
this
.
state
.
dataList
.
map
((
item
,
index
)
=>
{
const
Info
=
(
<
div
className
=
"info"
>
<
p
className
=
'title'
onClick
=
{()
=>
this
.
toCourseDetail
(
item
.
course_id
)}
>
{
/* <Link to={`/detail?id=${item.course_id}`}> */
}
{
item
.
course_title
}
{
/* </Link> */
}
<
/p
>
<
p
className
=
'contact text-overflow-2'
>
{
item
.
course_desc
}
<
/p
>
<
div
className
=
'des'
>
{
!
item
.
is_buy
&&
<
p
className
=
"course-price"
>
{
this
.
state
.
courseStatus
===
0
&&
<
span
className
=
'price'
>
特惠价:
<
/span
>
}
<
span
className
=
"new"
>
¥
{
item
.
price1
}
<
/span
>
<
span
className
=
"old"
>
¥
{
item
.
price0
}
<
/span
>
<
/p
>
}
{
item
.
is_buy
&&
<
a
className
=
"isbuy"
>
已购买
<
/a
>
<
/Tabs
>
<
div
className
=
'tabs'
>
<
ul
>
{
this
.
state
.
dataList
.
map
((
item
,
index
)
=>
{
const
Info
=
(
<
div
className
=
"info"
>
<
p
className
=
'title'
onClick
=
{()
=>
this
.
toCourseDetail
(
item
.
course_id
)}
>
{
/* <Link to={`/detail?id=${item.course_id}`}> */
}
{
item
.
course_title
}
{
/* </Link> */
}
<
/p
>
<
p
className
=
'contact text-overflow-2'
>
{
item
.
course_desc
}
<
/p
>
<
div
className
=
'des'
>
{
!
item
.
is_buy
&&
<
p
className
=
"course-price"
>
{
this
.
state
.
courseStatus
===
0
&&
<
span
className
=
'price'
>
特惠价:
<
/span
>
}
<
/div
>
<
/div
>
)
const
status
=
(
!
item
.
is_buy
&&
<
div
>
{
this
.
state
.
courseStatus
===
1
&&
<
p
className
=
'course-status'
>
砍价减
{
item
.
bargain_price
}
元
<
/p
>
}
{
this
.
state
.
courseStatus
===
2
&&
<
p
className
=
'course-status'
>
拼团价
{
item
.
price
}
元
<
/p
>
<
span
className
=
"new"
>
¥
{
item
.
price1
}
<
/span
>
<
span
className
=
"old"
>
¥
{
item
.
price0
}
<
/span
>
<
/p
>
}
{
item
.
is_aist
&&
<
span
className
=
'return_cash'
><
/span
>
{
item
.
is_buy
&&
<
a
className
=
"isbuy"
>
已购买
<
/a
>
}
<
/div
>
)
return
(
<
VList
key
=
{
index
}
img
=
{
item
.
image_name
}
id
=
{
item
.
course_id
}
status
=
{
status
}
info
=
{
Info
}
toDetail
=
{
this
.
toCourseDetail
}
/
>
)
})}
<
/ul
>
<
/div
>
)
const
status
=
(
!
item
.
is_buy
&&
<
div
>
{
this
.
state
.
courseStatus
===
1
&&
<
p
className
=
'course-status'
>
砍价减
{
item
.
bargain_price
}
元
<
/p
>
}
{
this
.
state
.
courseStatus
===
2
&&
<
p
className
=
'course-status'
>
拼团价
{
item
.
price
}
元
<
/p
>
}
{
item
.
is_aist
&&
<
span
className
=
'return_cash'
><
/span
>
}
<
/div
>
)
return
(
<
VList
key
=
{
index
}
img
=
{
item
.
image_name
}
id
=
{
item
.
course_id
}
status
=
{
status
}
info
=
{
Info
}
toDetail
=
{
this
.
toCourseDetail
}
/
>
)
})}
<
/ul
>
<
/div
>
<
/Tabs
>
<
/div
>
<
WhiteSpace
/>
<
/div
>
<
/Loading
>
...
...
src/components/scholarship/index.js
View file @
4ab8124c
...
...
@@ -31,6 +31,7 @@ class _Scholarship extends Component {
isLoading
:
false
,
showNoData
:
false
,
hasMore
:
true
,
tab
:
0
,
}
this
.
downImage
=
React
.
createRef
();
this
.
tabIndex
=
0
;
...
...
@@ -307,6 +308,7 @@ class _Scholarship extends Component {
isLoading
:
false
,
hasMore
:
true
,
dataSource
:
this
.
state
.
dataSource
.
cloneWithRows
(
this
.
rData
),
tab
:
index
,
},
()
=>
{
this
.
onEndReached
();
...
...
@@ -314,43 +316,52 @@ class _Scholarship extends Component {
);
}}
>
<
div
style
=
{{
marginTop
:
'15px'
,
backgroundColor
:
'#FFF'
}}
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
useBodyScroll
=
{
this
.
state
.
useBodyScroll
}
dataSource
=
{
this
.
state
.
dataSource
}
renderRow
=
{
row
}
renderBodyComponent
=
{()
=>
<
div
/>
}
onEndReached
=
{
this
.
onEndReached
}
pageSize
=
{
4
}
onEndReachedThreshold
=
{
100
}
/
>
)
:
(
<
/Tabs
>
{
this
.
state
.
tab
===
0
?
(
<
div
style
=
{{
marginTop
:
'15px'
,
backgroundColor
:
'#FFF'
}}
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
useBodyScroll
=
{
this
.
state
.
useBodyScroll
}
dataSource
=
{
this
.
state
.
dataSource
}
renderRow
=
{
row
}
renderBodyComponent
=
{()
=>
<
div
/>
}
onEndReached
=
{
this
.
onEndReached
}
pageSize
=
{
4
}
onEndReachedThreshold
=
{
100
}
/
>
)
:
(
null
)
}
}
<
/div
>
)
:
null
}
<
/div
>
<
div
>
<
Flex
justify
=
'center'
align
=
'center'
className
=
{
'runtimeList'
}
>
榜单实时更新,仅显示前
50
名
<
/Flex
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
useBodyScroll
=
{
this
.
state
.
useBodyScroll
}
dataSource
=
{
this
.
state
.
dataSource
}
renderRow
=
{
row1
}
renderBodyComponent
=
{()
=>
<
div
/>
}
onEndReached
=
{
this
.
onEndReached
}
pageSize
=
{
4
}
onEndReachedThreshold
=
{
100
}
/
>
)
:
(
{
this
.
state
.
tab
===
1
?
(
<
div
>
<
Flex
justify
=
'center'
align
=
'center'
className
=
{
'runtimeList'
}
>
榜单实时更新,仅显示前
50
名
<
/Flex
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
useBodyScroll
=
{
this
.
state
.
useBodyScroll
}
dataSource
=
{
this
.
state
.
dataSource
}
renderRow
=
{
row1
}
renderBodyComponent
=
{()
=>
<
div
/>
}
onEndReached
=
{
this
.
onEndReached
}
pageSize
=
{
4
}
onEndReachedThreshold
=
{
100
}
/
>
)
:
(
null
)
}
<
/div
>
<
/Tabs
>
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
...
...
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