Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
鹿亮亮
8 years ago
Commit
91b94470824ed4023d2d6bafaac863079a81440d
1 parent
9de4ecd5
添加新人专享楼层
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
17 deletions
js/home/components/cell/KidsBrandsCell.js → js/home/components/floor/KidsBrandsCell.js
js/home/components/floor/NewUserFloor.js
js/home/components/home/Home.js
js/home/containers/HomeContainer.js
js/home/reducers/home/homeActions.js
js/home/components/
cell
/KidsBrandsCell.js → js/home/components/
floor
/KidsBrandsCell.js
View file @
91b9447
...
...
@@ -24,7 +24,7 @@ import Immutable, {
Map
}
from
'immutable'
;
import
HeadTitleCell
from
'./HeadTitleCell'
;
import
HeadTitleCell
from
'.
./cell
/HeadTitleCell'
;
export
default
class
KidsBrandCell
extends
Component
{
constructor
(
props
)
{
...
...
@@ -51,7 +51,6 @@ export default class KidsBrandCell extends Component {
}
_renderRow
(
rowData
,
sectionID
,
rowID
,
highlightRow
){
console
.
log
(
sectionID
+
','
+
rowID
);
return
(
<
TouchableOpacity
activeOpacity
=
{
0.5
}
>
<
View
style
=
{
styles
.
row
}
>
...
...
@@ -86,6 +85,7 @@ export default class KidsBrandCell extends Component {
}
}
let
{
width
,
height
}
=
Dimensions
.
get
(
'window'
);
let
itemWidth
=
width
/
4
;
let
itemHeight
=
70
;
...
...
js/home/components/floor/NewUserFloor.js
0 → 100644
View file @
91b9447
/**
* Description:
* <p> new_user_floor:新人专享
* Author: Bruce.Lu
* Version: 1.0
* Created on 2017/2/9.
*/
import
React
,{
Component
}
from
'react'
;
import
ReactNative
,{
Image
,
Text
,
StyleSheet
,
ListView
,
View
,
TouchableOpacity
,
}
from
'react-native'
;
import
Swiper
from
'react-native-swiper'
;
import
ImmutablePropTypes
from
'react-immutable-proptypes'
;
import
SlicedImage
from
'../../../common/components/SlicedImage'
;
import
HeadTitleCell
from
'../cell/HeadTitleCell'
;
import
Banner
from
'../../../common/components/Banner'
export
default
class
NewUserFloor
extends
Component
{
constructor
(
props
){
super
(
props
);
}
render
(){
return
(
<
View
style
=
{
styles
.
container
}
>
<
HeadTitleCell
title
=
{
'新人专享'
}
/
>
<
<
/View>
)
;
}
}
const
styles
=
StyleSheet
.
create
({
container
:{
backgroundColor
:
'white'
,
flex
:
1
}
});
...
...
js/home/components/home/Home.js
View file @
91b9447
...
...
@@ -18,7 +18,8 @@ import Focus from './Focus';
import
AppIconList
from
'./AppIconList'
import
AppHotBrands
from
'./AppHotBrands'
import
TrendsetterCollocation
from
'../floor/TrendsetterCollocation'
import
KidsBrandCell
from
'../cell/KidsBrandsCell'
;
import
KidsBrandCell
from
'../floor/KidsBrandsCell'
;
import
NewUserFloor
from
'../floor/NewUserFloor'
;
export
default
class
Home
extends
Component
{
...
...
@@ -75,6 +76,7 @@ export default class Home extends Component {
_floorCellRender
(
rowData
)
{
let
template_name
=
rowData
.
get
(
'template_name'
);
console
.
log
(
'template_name='
+
template_name
);
switch
(
template_name
)
{
case
'focus'
:
{
let
data
=
rowData
.
get
(
'data'
);
...
...
@@ -107,7 +109,7 @@ export default class Home extends Component {
)
}
break
;
case
'kids
B
rands'
:
{
case
'kids
_b
rands'
:
{
return
(
<
KidsBrandCell
/>
)
...
...
@@ -129,7 +131,7 @@ export default class Home extends Component {
}
render
()
{
let
kids
=
Immutable
.
fromJS
({
template_name
:
"kids_brands"
,
data
:{}});
let
channel
=
this
.
props
.
channel
;
let
data
=
this
.
props
.
data
.
boy
;
if
(
channel
==
1
)
{
...
...
@@ -144,6 +146,7 @@ export default class Home extends Component {
let
{
list
,
isFetching
,
isFirstLoad
,
favorite
}
=
data
;
let
floorList
=
list
.
toArray
();
let
favoriteList
=
favorite
.
toJS
().
list
;
let
dataSource
=
{
...
...
js/home/containers/HomeContainer.js
View file @
91b9447
...
...
@@ -19,6 +19,8 @@ import * as homeActions from '../reducers/home/homeActions';
import
*
as
appActions
from
'../reducers/app/appActions'
;
import
Home
from
'../components/home/Home'
;
import
KidsBrandsCell
from
'../components/floor/KidsBrandsCell'
;
import
NewUserFloor
from
'../components/floor/NewUserFloor'
;
const
actions
=
[
homeActions
,
...
...
@@ -87,17 +89,18 @@ class HomeContainer extends Component {
render
()
{
let
{
app
,
home
}
=
this
.
props
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
Home
ref
=
{(
c
)
=>
{
this
.
home
=
c
;
}}
data
=
{
home
}
onRefresh
=
{
this
.
_onRefresh
}
onEndReached
=
{
this
.
_onEndReached
}
channel
=
{
app
.
channel
}
/
>
<
/View
>
// <View style={styles.container}>
<
NewUserFloor
/>
// <Home
// ref={(c) => {
// this.home = c;
// }}
// data={home}
// onRefresh={this._onRefresh}
// onEndReached={this._onEndReached}
// channel={app.channel}
// />
// </View>
);
}
}
...
...
js/home/reducers/home/homeActions.js
View file @
91b9447
...
...
@@ -62,7 +62,6 @@ export function fetchFloor() {
}
let
fetchFloorRequest
=
(
sourcePage
,
contentCode
,
gender
,
new_device
)
=>
{
console
.
log
(
"new_device="
+
new_device
+
"contentCode="
+
contentCode
);
return
new
HomeService
(
app
.
serviceHost
).
fetchHomeFloorRequest
(
contentCode
,
channel
,
gender
,
sourcePage
,
new_device
)
.
then
(
json
=>
{
let
payload
=
parseHomeFloor
(
json
)
...
...
Please
register
or
login
to post a comment