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
Plain Diff
Browse Files
Authored by
于良
8 years ago
Commit
5bef1f2a29a7b2b5164836d42ff51b0ce3bf949a
2 parents
d68fe584
4c76c14a
Merge branch '5.4.1' of
http://git.yoho.cn/mobile/YH_RNComponent
into 5.4.1
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
279 additions
and
139 deletions
js/blk/components/brand/BLKChannelSelector.js
js/blk/components/brand/Brand.js
js/blk/reducers/brand/brandActions.js
js/common/components/ListCell/ProductListCell.js
js/common/components/ListCell/SimilarProductAnim.js
js/common/components/YH_Image.js
js/home/components/floor/AppIconList.js
js/home/components/floor/HotCategoryIndividualization.js
js/home/components/floor/RecommendContentThree.js
js/home/components/home/Home.js
js/home/components/home/RecommendPopView.js
js/home/constants/actionTypes.js
js/home/containers/HomeContainer.js
js/home/reducers/home/homeActions.js
js/home/reducers/home/homeInitialState.js
js/home/reducers/home/homeReducer.js
js/newArrival/containers/NewArrivalContainer.js
js/outlet/components/outlet/ActivityCell.js
js/outlet/components/outlet/Outlet.js
js/outlet/components/outlet/OutletDoubleImage.js
js/outlet/components/outlet/OutletPageListView.js
js/outlet/constants/actionTypes.js
js/outlet/containers/OutletContainer.js
js/outlet/reducers/outlet/outletActions.js
js/outlet/reducers/outlet/outletInitialState.js
js/outlet/reducers/outlet/outletReducer.js
js/redPersonBrand/components/redBrand/Header.js
js/blk/components/brand/BLKChannelSelector.js
View file @
5bef1f2
...
...
@@ -40,12 +40,6 @@ export default class BLKChannelSelector extends React.Component {
id
:
2
,
isSelect
:
false
,
},
{
name
:
'LIFESTYLE生活'
,
value
:
'lifestyle'
,
id
:
4
,
isSelect
:
false
,
},
];
}
...
...
@@ -134,7 +128,7 @@ let styles = StyleSheet.create({
flexDirection
:
'row'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
width
:
Math
.
ceil
(
width
/
3
),
width
:
Math
.
ceil
(
width
/
2
),
height
:
viewHeight
,
backgroundColor
:
'white'
,
},
...
...
js/blk/components/brand/Brand.js
View file @
5bef1f2
...
...
@@ -76,21 +76,6 @@ export default class Brand extends Component {
renderHeader
()
{
return
(
<
View
style
=
{
styles
.
header
}
>
<
TouchableOpacity
activeOpacity
=
{
1
}
onPress
=
{()
=>
{
this
.
props
.
onPressSearch
&&
this
.
props
.
onPressSearch
();
}}
>
<
YH_SearchBar
ref
=
{(
c
)
=>
{
this
.
searchBar
=
c
;
}}
placeholder
=
{
"搜索品牌"
}
editable
=
{
false
}
/
>
<
/TouchableOpacity
>
<
BrandHeader
selectedChannelId
=
{
this
.
props
.
selectedChannelId
}
reourceForBoy
=
{
this
.
props
.
reourceForBoy
}
...
...
js/blk/reducers/brand/brandActions.js
View file @
5bef1f2
...
...
@@ -332,10 +332,10 @@ export function getBrandResource(channel) {
let
content_code
;
if
(
channel
==
1
)
{
dispatch
(
getBrandResourceForBoyRequest
());
content_code
=
'
ce6ac059493ec26241a8cbe0bfa1b17a
'
;
content_code
=
'
7317a4701a1d3ddc8d93a5df77a63b75
'
;
}
else
if
(
channel
==
2
)
{
dispatch
(
getBrandResourceForGirlRequest
());
content_code
=
'
dac99cdedc1f948e84c145aca561f7d2
'
;
content_code
=
'
84313c4b293a1c0aea985aa16a42a6b5
'
;
}
else
if
(
channel
==
3
)
{
dispatch
(
getBrandResourceForKidRequest
());
content_code
=
'713784f93f52bb1a7b93916b2bb15510'
;
...
...
js/common/components/ListCell/ProductListCell.js
View file @
5bef1f2
...
...
@@ -69,10 +69,11 @@ export default class ProductListCell extends Component {
return
(
<
View
style
=
{
styles
.
imageContainer
}
>
<
YH_Image
style
=
{
styles
.
image
}
url
=
{
url
}
>
<
YH_Image
style
=
{
styles
.
image
}
url
=
{
url
}
isBackground
=
{
true
}
>
{
rowID
==
similarIndex
?
<
SimilarProductAnim
onPressFindSimilar
=
{
this
.
props
.
onPressFindSimilar
}
product
=
{
data
}
onPressDislike
=
{
this
.
props
.
onPressDislike
}
/
>
:
null
}
...
...
js/common/components/ListCell/SimilarProductAnim.js
View file @
5bef1f2
...
...
@@ -58,7 +58,7 @@ export default class SimilarProductAnim extends Component {
justifyContent
:
'center'
,
alignItems
:
'center'
,
}}
onPress
=
{()
=>
{
this
.
props
.
onPressFindSimilar
&&
this
.
props
.
onPressFindSimilar
();}}
onPress
=
{()
=>
{
this
.
props
.
onPressFindSimilar
&&
this
.
props
.
onPressFindSimilar
(
this
.
props
.
product
);}}
>
<
Text
style
=
{{
fontSize
:
14
,
color
:
'white'
}}
>
找相似
<
/Text
>
<
/TouchableOpacity
>
...
...
@@ -72,7 +72,7 @@ export default class SimilarProductAnim extends Component {
alignItems
:
'center'
,
marginTop
:
15
,
}}
onPress
=
{()
=>
{
this
.
props
.
onPressDislike
&&
this
.
props
.
onPressDislike
();}}
onPress
=
{()
=>
{
this
.
props
.
onPressDislike
&&
this
.
props
.
onPressDislike
(
this
.
props
.
product
);}}
>
<
Text
style
=
{{
fontSize
:
14
,
color
:
'white'
}}
>
不喜欢
<
/Text
>
<
/TouchableOpacity
>
...
...
js/common/components/YH_Image.js
View file @
5bef1f2
...
...
@@ -8,9 +8,12 @@ const {
const
{
Image
,
PixelRatio
,
Platform
,
}
=
ReactNative
;
const
YH_ImageView
=
ReactNative
.
requireNativeComponent
(
'YH_ImageView'
,
null
);
const
YH_BackgroundView
=
(
Platform
.
OS
===
'ios'
)
?
null
:
ReactNative
.
requireNativeComponent
(
'YH_BackgroundView'
,
null
);
/**
...
...
@@ -49,10 +52,31 @@ export default class YH_Image extends Component {
}
render
()
{
return
(
<
YH_ImageView
{...
this
.
props
}
/
>
);
if
(
Platform
.
OS
===
'ios'
)
{
return
(
<
YH_ImageView
{...
this
.
props
}
/
>
);
}
else
{
let
{
isBackground
}
=
this
.
props
;
if
(
isBackground
&&
isBackground
==
true
){
// return null;
return
(
<
YH_BackgroundView
{...
this
.
props
}
/
>
);
}
else
{
return
(
<
YH_ImageView
{...
this
.
props
}
/
>
);
}
}
}
}
...
...
js/home/components/floor/AppIconList.js
View file @
5bef1f2
...
...
@@ -71,7 +71,7 @@ export default class AppIconList extends React.Component {
listContainerStyle
=
styles
.
brandContainer4
}
return
(
<
YH_Image
style
=
{[
styles
.
container
,
{
height
:
containerHeight
}]}
url
=
{
this
.
props
.
backImage
}
>
<
YH_Image
style
=
{[
styles
.
container
,
{
height
:
containerHeight
}]}
url
=
{
this
.
props
.
backImage
}
isBackground
=
{
true
}
>
<
ListView
contentContainerStyle
=
{
listContainerStyle
}
enableEmptySections
=
{
true
}
...
...
js/home/components/floor/HotCategoryIndividualization.js
View file @
5bef1f2
...
...
@@ -25,73 +25,70 @@ import YH_Image from '../../../common/components/YH_Image';
export
default
class
HotCategoryIndividualization
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
_renderRow
=
this
.
_renderRow
.
bind
(
this
);
this
.
dataSource
=
new
ListView
.
DataSource
({
rowHasChanged
:
(
r1
,
r2
)
=>
!
Immutable
.
is
(
r1
,
r2
),
});
}
_renderRow
(
rowData
,
sectionID
,
rowID
,
highlightRow
)
{
let
title
=
rowData
.
get
(
'title'
);
let
actionUrl
=
rowData
.
get
(
'url'
);
let
imgUrl
=
SlicedImage
.
getSlicedUrl
(
rowData
.
get
(
'src'
),
imageWidth
,
imageHeight
,
2
);
return
(
<
TouchableOpacity
style
=
{
styles
.
cellContainer
}
onPress
=
{()
=>
this
.
props
.
onPressVipBannerItem
&&
this
.
props
.
onPressVipBannerItem
(
actionUrl
,
rowID
)}
>
<
YH_Image
style
=
{
styles
.
image
}
url
=
{
imgUrl
}
/
>
<
Text
style
=
{
styles
.
text
}
>
{
title
}
<
/Text
>
<
/TouchableOpacity
>
);
}
render
()
{
let
data
=
this
.
props
.
data
;
let
title
=
data
.
get
(
'title'
).
get
(
'title'
);
let
categoryData
=
data
.
get
(
'list'
);
let
rowH
=
40
+
2
+
cellHeight
*
3
;
let
title
=
this
.
props
.
data
.
get
(
'title'
);
let
data
=
this
.
props
.
data
.
get
(
'list'
).
toArray
();
let
lineNumber
=
parseInt
((
data
.
length
+
3
)
/
4
);
let
listHeight
=
Math
.
floor
(
lineNumber
*
cellHeight
);
let
containerHeight
=
listHeight
+
40
;
return
(
<
View
style
=
{{
width
:
width
,
height
:
rowH
}}
>
<
HeadTitleCell
title
=
{
title
}
/
>
<
View
style
=
{
styles
.
line
}
/
>
<
ListView
contentContainerStyle
=
{
styles
.
listContent
}
dataSource
=
{
this
.
dataSource
.
cloneWithRows
(
categoryData
.
toArray
())}
renderRow
=
{
this
.
_renderRow
}
initialListSize
=
{
12
}
showsHorizontalScrollIndicator
=
{
false
}
/
>
<
View
style
=
{
styles
.
line
}
/
>
<
View
style
=
{[
styles
.
container
,
{
height
:
containerHeight
}]}
>
<
HeadTitleCell
title
=
{
title
.
get
(
'title'
)}
moreUrl
=
{
title
.
get
(
'more_url'
)}
onPressTitleMore
=
{
this
.
props
.
onPressTitleMore
}
/
>
<
View
style
=
{[
styles
.
list
,
{
height
:
listHeight
}]}
>
{
data
.
map
((
item
,
i
)
=>
{
let
url
=
YH_Image
.
getSlicedUrl
(
item
.
get
(
'src'
),
imageWidth
,
imageHeight
,
2
);
return
(
<
TouchableOpacity
key
=
{
i
}
style
=
{
styles
.
cellContainer
}
activeOpacity
=
{
1
}
onPress
=
{()
=>
{
this
.
props
.
onPressVipBannerItem
&&
this
.
props
.
onPressVipBannerItem
(
item
.
get
(
'url'
),
i
+
1
);
}}
>
<
YH_Image
url
=
{
url
}
style
=
{
styles
.
image
}
/
>
<
Text
style
=
{
styles
.
text
}
>
{
item
.
get
(
'title'
)}
<
/Text
>
<
/TouchableOpacity
>
);
})}
<
View
style
=
{[
styles
.
vLine1
,
{
height
:
listHeight
}]}
/
>
<
View
style
=
{[
styles
.
vLine2
,
{
height
:
listHeight
}]}
/
>
<
View
style
=
{[
styles
.
vLine3
,
{
height
:
listHeight
}]}
/
>
<
View
style
=
{
styles
.
hLine1
}
/
>
<
View
style
=
{
styles
.
hLine2
}
/
>
<
/View
>
<
/View
>
);
}
}
let
{
width
,
height
}
=
Dimensions
.
get
(
'window'
);
let
cellWidth
=
width
/
4
-
0.5
;
let
cellWidth
=
width
/
4
;
let
imageWidth
=
cellWidth
-
14
*
2
;
let
imageHeight
=
imageWidth
*
168
/
126
;
let
cellHeight
=
imageHeight
+
20
;
const
styles
=
StyleSheet
.
create
({
line
:
{
height
:
0.5
,
backgroundColor
:
'#f7f7f7'
container
:
{
width
:
width
,
flexDirection
:
'column'
,
},
listContent
:
{
backgroundColor
:
'#e5e5e5'
,
list
:
{
flexDirection
:
'row'
,
flexWrap
:
'wrap'
,
justifyContent
:
'flex-start'
,
alignItems
:
'flex-start'
,
width
:
width
,
},
cellContainer
:
{
backgroundColor
:
'#f5f7f6'
,
width
:
cellWidth
,
justifyContent
:
'center'
,
height
:
cellHeight
,
alignItems
:
'center'
,
marginRight
:
0.5
,
marginBottom
:
0.5
flexDirection
:
'column'
},
image
:
{
width
:
imageWidth
,
...
...
@@ -104,5 +101,42 @@ const styles = StyleSheet.create({
textAlign
:
'center'
,
width
:
cellWidth
,
height
:
20
}
},
vLine1
:
{
position
:
'absolute'
,
backgroundColor
:
'#e5e5e5'
,
width
:
0.5
,
top
:
0
,
left
:
cellWidth
,
},
vLine2
:
{
position
:
'absolute'
,
backgroundColor
:
'#e5e5e5'
,
width
:
0.5
,
top
:
0
,
left
:
cellWidth
*
2
,
},
vLine3
:
{
position
:
'absolute'
,
backgroundColor
:
'#e5e5e5'
,
width
:
0.5
,
top
:
0
,
left
:
cellWidth
*
3
,
},
hLine1
:
{
position
:
'absolute'
,
backgroundColor
:
'#e5e5e5'
,
width
,
height
:
0.5
,
top
:
cellHeight
,
left
:
0
,
},
hLine2
:
{
position
:
'absolute'
,
backgroundColor
:
'#e5e5e5'
,
width
,
height
:
0.5
,
top
:
cellHeight
*
2
,
left
:
0
,
},
});
...
...
js/home/components/floor/RecommendContentThree.js
View file @
5bef1f2
...
...
@@ -37,9 +37,10 @@ export default class RecommendContentThree extends React.Component {
let
data
=
list
.
toArray
();
let
lineNumber
=
parseInt
((
data
.
length
+
3
)
/
4
);
let
listHeight
=
Math
.
floor
(
lineNumber
*
imageHeight
);
let
containerHeight
=
bannerHeight
+
listHeight
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
[
styles
.
container
,
{
height
:
containerHeight
}]
}
>
<
ImageSlider
resource
=
{
big_image
}
sliderWidth
=
{
width
}
...
...
@@ -68,7 +69,7 @@ export default class RecommendContentThree extends React.Component {
<
View
style
=
{
styles
.
hLine1
}
/
>
<
View
style
=
{
styles
.
hLine2
}
/
>
<
/View
>
<
/View
>
);
}
...
...
js/home/components/home/Home.js
View file @
5bef1f2
...
...
@@ -109,6 +109,8 @@ export default class Home extends Component {
case
'favorite'
:
{
let
paddingLeft
=
rowID
%
2
==
1
?
rowMarginHorizontal
*
1.5
:
rowMarginHorizontal
*
2
;
let
customStyle
=
{
paddingLeft
};
let
data
=
this
.
_currentChannelData
();
let
similarIndex
=
data
.
get
(
'similarIndex'
)
return
(
<
View
style
=
{[
styles
.
product
,]}
>
<
ProductListCell
...
...
@@ -116,7 +118,11 @@ export default class Home extends Component {
key
=
{
'row'
+
rowID
}
rowID
=
{
rowID
}
data
=
{
rowData
}
similarIndex
=
{
similarIndex
}
onPressProduct
=
{
this
.
props
.
onPressProductListProduct
}
onLongPressProduct
=
{
this
.
props
.
onLongPressProduct
}
onPressFindSimilar
=
{
this
.
props
.
onPressFindSimilar
}
onPressDislike
=
{
this
.
props
.
onPressDislike
}
/
>
<
/View
>
);
...
...
@@ -398,15 +404,24 @@ export default class Home extends Component {
_renderFooter
()
{
let
data
=
this
.
_currentChannelData
();
let
{
isFetching
,
endReached
,
list
,
cached
}
=
data
;
let
{
isFetching
,
endReached
,
list
,
cached
,
favorite
,
isListFetching
}
=
data
;
let
floorList
=
list
.
size
>
0
?
list
.
toArray
()
:
cached
.
get
(
'list'
).
toArray
();
let
isLoadingMore
=
!
endReached
&&
floorList
.
length
!=
0
;
let
isLoadingMore
=
false
;
let
animated
=
false
;
if
(
this
.
props
.
channel
==
4
)
{
isLoadingMore
=
!
endReached
&&
floorList
.
length
!=
0
&&
isListFetching
;
animated
=
isListFetching
;
}
else
{
isLoadingMore
=
!
endReached
&&
floorList
.
length
!=
0
&&
favorite
.
get
(
'isFetching'
);
animated
=
favorite
.
get
(
'isFetching'
);
}
return
(
<
LoadMoreIndicator
isVisible
=
{
isLoadingMore
}
animating
=
{
isFetching
}
animating
=
{
animated
}
/
>
);
}
...
...
js/home/components/home/RecommendPopView.js
View file @
5bef1f2
...
...
@@ -63,18 +63,18 @@ const DEVICE_WIDTH_RATIO = width / 375;
let
styles
=
StyleSheet
.
create
({
container
:
{
position
:
'absolute'
,
left
:
0
,
left
:
12
*
DEVICE_WIDTH_RATIO
,
right
:
12
*
DEVICE_WIDTH_RATIO
,
bottom
:
15
*
DEVICE_WIDTH_RATIO
,
width
,
width
:
width
-
24
*
DEVICE_WIDTH_RATIO
,
height
:
58
*
DEVICE_WIDTH_RATIO
,
flex
:
1
,
flexDirection
:
'row'
,
backgroundColor
:
'transparent'
,
},
bgImage
:
{
position
:
'absolute'
,
width
,
width
:
width
-
24
*
DEVICE_WIDTH_RATIO
,
height
:
58
*
DEVICE_WIDTH_RATIO
,
backgroundColor
:
'transparent'
,
},
...
...
@@ -84,7 +84,7 @@ let styles = StyleSheet.create({
width
:
34
*
DEVICE_WIDTH_RATIO
,
height
:
44
*
DEVICE_WIDTH_RATIO
,
alignSelf
:
'center'
,
backgroundColor
:
'
red
'
backgroundColor
:
'
transparent
'
},
titleContainer
:
{
...
...
@@ -106,6 +106,6 @@ let styles = StyleSheet.create({
downIcon
:
{
alignSelf
:
'center'
,
marginLeft
:
8
0
*
DEVICE_WIDTH_RATIO
,
marginLeft
:
5
0
*
DEVICE_WIDTH_RATIO
,
},
})
...
...
js/home/constants/actionTypes.js
View file @
5bef1f2
...
...
@@ -51,4 +51,5 @@ export default keyMirror({
HOME_RECOMMEND_PRODUCT_FAILURE
:
null
,
HOME_RECOMMEND_PRODUCT_SELECTED
:
null
,
SET_SIMILAR_PRODUCT_INDEX
:
null
,
});
...
...
js/home/containers/HomeContainer.js
View file @
5bef1f2
...
...
@@ -70,6 +70,10 @@ class HomeContainer extends Component {
this
.
onPressTitleMore
=
this
.
onPressTitleMore
.
bind
(
this
);
this
.
onClickSort
=
this
.
onClickSort
.
bind
(
this
);
this
.
onClickRecommendProduct
=
this
.
onClickRecommendProduct
.
bind
(
this
);
this
.
onLongPressProduct
=
this
.
onLongPressProduct
.
bind
(
this
);
this
.
onPressFindSimilar
=
this
.
onPressFindSimilar
.
bind
(
this
);
this
.
onPressDislike
=
this
.
onPressDislike
.
bind
(
this
);
this
.
onPressProductListProduct
=
this
.
onPressProductListProduct
.
bind
(
this
);
this
.
subscription
=
NativeAppEventEmitter
.
addListener
(
'ChannelDidChangeEvent'
,
...
...
@@ -78,35 +82,6 @@ class HomeContainer extends Component {
this
.
home
&&
this
.
home
.
trigggePullToRefresh
();
}
);
this
.
subscription2
=
NativeAppEventEmitter
.
addListener
(
'UserDidLoginEvent'
,
(
reminder
)
=>
{
this
.
home
&&
this
.
home
.
trigggePullToRefresh
();
}
);
this
.
subscription3
=
NativeAppEventEmitter
.
addListener
(
'UserDidLogoutEvent'
,
(
reminder
)
=>
{
this
.
home
&&
this
.
home
.
trigggePullToRefresh
();
}
);
this
.
subscription4
=
NativeAppEventEmitter
.
addListener
(
'ABTestDidChangeEvent'
,
(
reminder
)
=>
{
this
.
home
&&
this
.
home
.
trigggePullToRefresh
();
}
);
this
.
subscription5
=
NativeAppEventEmitter
.
addListener
(
'UserDidRegisterEvent'
,
(
reminder
)
=>
{
this
.
home
&&
this
.
home
.
trigggePullToRefresh
();
}
);
}
componentDidMount
()
{
...
...
@@ -116,19 +91,45 @@ class HomeContainer extends Component {
componentWillUnmount
()
{
this
.
subscription
&&
this
.
subscription
.
remove
();
this
.
subscription2
&&
this
.
subscription2
.
remove
();
this
.
subscription3
&&
this
.
subscription3
.
remove
();
this
.
subscription4
&&
this
.
subscription4
.
remove
();
this
.
subscription5
&&
this
.
subscription5
.
remove
();
}
onLongPressProduct
(
rowID
)
{
if
(
rowID
)
{
this
.
props
.
actions
.
setSimilarIndex
(
rowID
);
}
}
onPressFindSimilar
(
product
)
{
if
(
!
product
)
{
return
;
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpFindSimilar
(
product
);
}
onPressDislike
()
{
console
.
log
(
'dislike....'
);
}
onPressProductListProduct
(
product
,
rowId
=
0
)
{
let
productSkn
=
product
&&
product
.
get
(
'product_skn'
,
0
);
if
(
!
productSkn
)
{
return
;
}
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}"}}`;
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
}
onRefresh
()
{
InteractionManager
.
runAfterInteractions
(()
=>
{
this
.
props
.
actions
.
fetchFloor
();
});
}
onClickRecommendProduct
()
{
this
.
props
.
actions
.
selectedRecommendProduct
();
}
onEndReached
()
{
InteractionManager
.
runAfterInteractions
(()
=>
{
this
.
props
.
actions
.
fetchHomeFavoriteList
();
...
...
@@ -219,7 +220,8 @@ class HomeContainer extends Component {
onPressVipProduct
(
productId
,
productSkn
)
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpToProductDetail
(
productId
.
toString
(),
productSkn
.
toString
());
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}"}}`;
this
.
jumpWithUrl
(
url
);
}
onPressTitleMore
(
url
,
index
)
{
...
...
@@ -230,10 +232,6 @@ class HomeContainer extends Component {
this
.
props
.
actions
.
selecLifeStyleProductIndex
(
index
);
}
onClickRecommendProduct
()
{
this
.
props
.
actions
.
selectedRecommendProduct
();
}
render
()
{
let
{
app
,
home
}
=
this
.
props
;
return
(
...
...
@@ -265,6 +263,10 @@ class HomeContainer extends Component {
onPressShopFavorite
=
{
this
.
onPressShopFavorite
}
onPressTitleMore
=
{
this
.
onPressTitleMore
}
onClickSort
=
{
this
.
onClickSort
}
onLongPressProduct
=
{
this
.
onLongPressProduct
}
onPressFindSimilar
=
{
this
.
onPressFindSimilar
}
onPressDislike
=
{
this
.
onPressDislike
}
onPressProductListProduct
=
{
this
.
onPressProductListProduct
}
onClickRecommendProduct
=
{
this
.
onClickRecommendProduct
}
/
>
<
/View
>
...
...
js/home/reducers/home/homeActions.js
View file @
5bef1f2
...
...
@@ -44,6 +44,7 @@ const {
SHOP_FAV_CANCEL_REQUEST
,
SHOP_FAV_CANCEL_SUCCESS
,
SHOP_FAV_CANCEL_FAILURE
,
SET_SIMILAR_PRODUCT_INDEX
,
HOME_RECOMMEND_PRODUCT_REQUEST
,
HOME_RECOMMEND_PRODUCT_SUCCESS
,
...
...
@@ -53,6 +54,17 @@ const {
}
=
require
(
'../../constants/actionTypes'
).
default
;
export
function
setSimilarIndex
(
rowID
)
{
return
(
dispatch
,
getState
)
=>
{
let
{
app
,
home
}
=
getState
();
let
channel
=
app
.
channel
;
let
channelStr
=
channelTransfer
.
number2String
(
channel
);
dispatch
(
{
type
:
SET_SIMILAR_PRODUCT_INDEX
,
payload
:
{
channelStr
,
rowID
},
});
}
}
/**
** 加载缓存
**/
...
...
@@ -196,7 +208,8 @@ export function fetchBoyGirlFavoriteList() {
payload
.
list
=
newList
;
}
//商品列表最多分四页
payload
.
endReached
=
(
payload
.
currentPage
>
4
)
||
(
payload
.
currentPage
==
payload
.
pageCount
);
payload
.
endReached
=
(
payload
.
list
.
length
==
0
)
||
((
payload
.
currentPage
>
4
)
||
(
payload
.
currentPage
==
payload
.
pageCount
));
dispatch
(
fetchFavoriteSuccess
(
payload
,
channelStr
));
...
...
@@ -436,7 +449,7 @@ export function favoriteOperation(shopId) {
ReactNative
.
NativeModules
.
YH_CommonHelper
.
uid
()
.
then
(
uid
=>
{
shopId
=
shopId
+
''
;
let
{
app
,
home
}
=
getState
();
let
channelStr
=
channelTransfer
.
number2String
(
app
.
channel
);
let
shopState
=
home
[
channelStr
].
shop
.
get
(
'list'
);
...
...
js/home/reducers/home/homeInitialState.js
View file @
5bef1f2
...
...
@@ -50,6 +50,7 @@ let templet = new (Record({
favorite
:
favorite
,
//男, 女,潮童频道 猜你喜欢列表
content_code
:
''
,
endReached
:
false
,
similarIndex
:
-
1
,
}));
let
lifeStyle
=
new
(
Record
({
...
...
@@ -72,6 +73,7 @@ let lifeStyle = new (Record({
selectIndex
:
0
,
content_code
:
''
,
similarIndex
:
-
1
,
}));
let
InitialState
=
Record
({
...
...
js/home/reducers/home/homeReducer.js
View file @
5bef1f2
...
...
@@ -41,6 +41,7 @@ const {
SHOP_FAV_CANCEL_REQUEST
,
SHOP_FAV_CANCEL_SUCCESS
,
SHOP_FAV_CANCEL_FAILURE
,
SET_SIMILAR_PRODUCT_INDEX
,
HOME_RECOMMEND_PRODUCT_REQUEST
,
HOME_RECOMMEND_PRODUCT_SUCCESS
,
...
...
@@ -61,6 +62,11 @@ export default function homeReducer(state=initialState, action) {
let
channelStr
=
action
.
payload
;
return
state
.
setIn
([
channelStr
,
'isFetching'
],
true
);
}
case
SET_SIMILAR_PRODUCT_INDEX
:
{
let
{
channelStr
,
rowID
}
=
action
.
payload
;
let
newState
=
state
.
setIn
([
channelStr
,
'similarIndex'
],
rowID
);
return
newState
;
}
case
HOME_FLOOR_SUCCESS
:
{
let
{
channelStr
,
json
}
=
action
.
payload
;
return
state
.
setIn
([
channelStr
,
'isFetching'
],
false
)
...
...
js/newArrival/containers/NewArrivalContainer.js
View file @
5bef1f2
...
...
@@ -82,8 +82,8 @@ class NewArrivalContainer extends Component {
}
}
_onPressFindSimilar
()
{
console
.
log
(
'find similar'
);
_onPressFindSimilar
(
product
)
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpFindSimilar
(
product
);
}
_onPressDislike
()
{
...
...
js/outlet/components/outlet/ActivityCell.js
View file @
5bef1f2
...
...
@@ -137,6 +137,7 @@ export default class ActivityCell extends React.Component {
let
id
=
data
.
id
;
let
price
=
promotionName
&&
promotionName
.
length
>
2
?
promotionName
.
substring
(
0
,
promotionName
.
length
-
2
):
''
let
priceString
=
promotionName
&&
promotionName
.
length
>
2
?
promotionName
.
substring
(
promotionName
.
length
-
2
,
promotionName
.
length
):
''
let
startLeftTime
=
data
.
startLeftTime
;
return
(
<
View
style
=
{
styles
.
container
}
>
...
...
@@ -144,8 +145,16 @@ export default class ActivityCell extends React.Component {
activeOpacity
=
{
1
}
style
=
{{
width
:
backgroundWidth
,
height
:
backgroundHeight
}}
onPress
=
{()
=>
{
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.outletactivity","params":{"activity_id":"${id}"}}`;
this
.
props
.
onPressProduct
&&
this
.
props
.
onPressProduct
(
url
);
if
(
startLeftTime
<=
0
)
{
if
(
this
.
state
.
showString
==
'活动已结束'
)
{
this
.
props
.
showToast
&&
this
.
props
.
showToast
(
'活动已结束,敬请期待。'
);
}
else
{
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.outletactivity","params":{"activity_id":"${id}"}}`;
this
.
props
.
onPressProduct
&&
this
.
props
.
onPressProduct
(
url
);
}
}
else
{
this
.
props
.
showToast
&&
this
.
props
.
showToast
(
'活动还未开始,敬请期待'
);
}
}}
>
<
YH_Image
...
...
js/outlet/components/outlet/Outlet.js
View file @
5bef1f2
...
...
@@ -24,6 +24,8 @@ export default class Outlet extends Component {
let
{
categoryList
,
isShowToast
,
toastMessage
,
}
=
this
.
props
;
if
(
!
categoryList
)
{
...
...
@@ -44,6 +46,8 @@ export default class Outlet extends Component {
tabLabel
=
{
name
}
key
=
{
'OutletPageListView'
+
i
}
resource
=
{
item
}
toastMessage
=
{
toastMessage
}
isShowToast
=
{
isShowToast
}
getOutletHomeResource
=
{
this
.
props
.
getOutletHomeResource
}
getOutletActivityList
=
{
this
.
props
.
getOutletActivityList
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
...
...
@@ -51,6 +55,8 @@ export default class Outlet extends Component {
setActivityFliter
=
{
this
.
props
.
setActivityFliter
}
onPressFilter
=
{
this
.
props
.
onPressFilter
}
onEndReached
=
{
this
.
props
.
onEndReached
}
showToast
=
{
this
.
props
.
showToast
}
hideToastMessage
=
{
this
.
props
.
hideToastMessage
}
/
>
);
})}
...
...
js/outlet/components/outlet/OutletDoubleImage.js
View file @
5bef1f2
...
...
@@ -44,7 +44,7 @@ export default class OutletDoubleImage extends React.Component {
let
url1
=
data
[
1
].
url
;
return
(
<
View
style
=
{
styles
.
viewStyle
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
props
.
onPressProduct
&&
this
.
props
.
onPressProduct
(
src
0
)}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
props
.
onPressProduct
&&
this
.
props
.
onPressProduct
(
url
0
)}}
>
<
YH_Image
url
=
{
src0
}
style
=
{
styles
.
thumbnail
}
...
...
js/outlet/components/outlet/OutletPageListView.js
View file @
5bef1f2
...
...
@@ -21,6 +21,7 @@ import ProductFliter from './ProductFliter';
import
BrandProductListCell
from
'../../../common/components/ListCell/ProductListCell'
;
import
ActivityCell
from
'./ActivityCell'
;
import
NoActivityView
from
'./NoActivityView'
;
import
Prompt
from
'../../../coupon/components/coupon/Prompt'
;
export
default
class
OutletPageListView
extends
Component
{
constructor
(
props
)
{
...
...
@@ -100,7 +101,6 @@ export default class OutletPageListView extends Component {
}
renderRow
(
rowData
,
sectionID
,
rowID
,
highlightRow
)
{
// console.log(rowData.toJS());
if
(
sectionID
==
'outletHomeReource'
)
{
if
(
rowData
.
get
(
'template_name'
)
==
'NL2R'
)
{
return
(
<
OutletThreeImage
resource
=
{
rowData
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
/>
)
;
...
...
@@ -108,7 +108,7 @@ export default class OutletPageListView extends Component {
return
(
<
OutletSwiper
resource
=
{
rowData
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
/>
)
;
}
else
if
(
rowData
.
get
(
'template_name'
)
==
'single_image'
)
{
return
(
<
OutletSingleImage
resource
=
{
rowData
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
/>
)
;
}
else
if
(
rowData
.
get
(
'template_name'
)
==
'
double_image
'
)
{
}
else
if
(
rowData
.
get
(
'template_name'
)
==
'
small_pic
'
)
{
return
(
<
OutletDoubleImage
resource
=
{
rowData
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
/>
)
;
}
else
if
(
rowData
.
get
(
'template_name'
)
==
'recommend_content_five'
)
{
return
(
<
OutletRecommendFive
resource
=
{
rowData
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
/>
)
;
...
...
@@ -118,7 +118,7 @@ export default class OutletPageListView extends Component {
// return(<TripleImage resource={rowData} onPressProduct={this.props.onPressProduct}/>);
}
}
else
if
(
sectionID
==
'activityList'
)
{
return
(
<
ActivityCell
resource
=
{
rowData
}
key
=
{
rowID
+
'activityList'
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
/>
)
;
return
(
<
ActivityCell
resource
=
{
rowData
}
key
=
{
rowID
+
'activityList'
}
showToast
=
{
this
.
props
.
showToast
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
/>
)
;
}
else
if
(
sectionID
==
'activityMore'
)
{
if
(
rowData
==
'more'
)
{
let
sourceIcon
=
require
(
'../../../brandStore/image/filter/brandstore_filter_arrow_down_normal.png'
);
...
...
@@ -152,11 +152,16 @@ export default class OutletPageListView extends Component {
let
{
resource
,
tabLabel
,
toastMessage
,
isShowToast
,
}
=
this
.
props
;
if
(
!
resource
)
{
return
null
;
}
let
needShowToast
=
isShowToast
;
let
showToastMessage
=
toastMessage
;
let
title
=
tabLabel
;
let
isFetching_homeResource
=
resource
.
get
(
'isFetching'
)?
resource
.
get
(
'isFetching'
):
false
;
let
honeResource
=
resource
.
get
(
'honeResource'
);
...
...
@@ -219,6 +224,11 @@ export default class OutletPageListView extends Component {
}
}}
/
>
{
needShowToast
?
<
Prompt
text
=
{
showToastMessage
}
duration
=
{
3000
}
onPromptHidden
=
{
this
.
props
.
hideToastMessage
}
/> : null
}
<
/View
>
);
}
...
...
js/outlet/constants/actionTypes.js
View file @
5bef1f2
...
...
@@ -7,10 +7,10 @@ export default keyMirror({
SET_CHANNEL
:
null
,
SET_SERVICE_HOST
:
null
,
SET_CATEGORYID
:
null
,
HIDE_TOAST
:
null
,
SET_ACTIVITY_FLITER
:
null
,
SET_FLITER
:
null
,
SHOW_TOAST
:
null
,
GET_CATEGORY_REQUEST
:
null
,
GET_CATEGORY_SUCCESS
:
null
,
GET_CATEGORY_FAILURE
:
null
,
...
...
js/outlet/containers/OutletContainer.js
View file @
5bef1f2
...
...
@@ -47,6 +47,8 @@ class OutletContainer extends Component {
this
.
_getOutletActivityList
=
this
.
_getOutletActivityList
.
bind
(
this
);
this
.
_onEndReached
=
this
.
_onEndReached
.
bind
(
this
);
this
.
_setActivityFliter
=
this
.
_setActivityFliter
.
bind
(
this
);
this
.
_showToast
=
this
.
_showToast
.
bind
(
this
);
this
.
_hideToastMessage
=
this
.
_hideToastMessage
.
bind
(
this
);
}
componentDidMount
()
{
...
...
@@ -89,6 +91,13 @@ class OutletContainer extends Component {
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
}
_showToast
(
value
){
this
.
props
.
actions
.
showToastMessage
(
value
);
}
_hideToastMessage
(){
this
.
props
.
actions
.
hideToastMessage
();
}
_onPressFilter
(
content_code
,
value
,
categoryNavigationItem
){
this
.
props
.
actions
.
onPressFilter
(
content_code
,
value
);
...
...
@@ -102,11 +111,15 @@ class OutletContainer extends Component {
let
{
categoryList
,
isShowToast
,
toastMessage
,
}
=
this
.
props
.
outlet
;
return
(
<
Outlet
categoryList
=
{
categoryList
}
isShowToast
=
{
isShowToast
}
toastMessage
=
{
toastMessage
}
getOutletHomeResource
=
{
this
.
_getOutletHomeResource
}
setActivityFliter
=
{
this
.
_setActivityFliter
}
getOutletActivityList
=
{
this
.
_getOutletActivityList
}
...
...
@@ -114,6 +127,8 @@ class OutletContainer extends Component {
onPressProductListProduct
=
{
this
.
_onPressProductListProduct
}
onPressFilter
=
{
this
.
_onPressFilter
}
onEndReached
=
{
this
.
_onEndReached
}
showToast
=
{
this
.
_showToast
}
hideToastMessage
=
{
this
.
_hideToastMessage
}
/
>
);
}
...
...
js/outlet/reducers/outlet/outletActions.js
View file @
5bef1f2
...
...
@@ -11,7 +11,8 @@ const {
SET_ACTIVITY_FLITER
,
SET_FLITER
,
SHOW_TOAST
,
HIDE_TOAST
,
GET_CATEGORY_REQUEST
,
GET_CATEGORY_SUCCESS
,
GET_CATEGORY_FAILURE
,
...
...
@@ -261,3 +262,17 @@ export function onPressFilter(content_code,value) {
payload
:
{
'value'
:
value
,
'content_code'
:
content_code
}
};
}
export
function
showToastMessage
(
value
)
{
return
{
type
:
SHOW_TOAST
,
payload
:
value
};
}
export
function
hideToastMessage
()
{
return
{
type
:
HIDE_TOAST
,
};
}
...
...
js/outlet/reducers/outlet/outletInitialState.js
View file @
5bef1f2
...
...
@@ -9,6 +9,8 @@ let InitialState = Record({
error
:
null
,
list
:
List
(),
})),
isShowToast
:
false
,
toastMessage
:
''
,
});
export
default
InitialState
;
...
...
js/outlet/reducers/outlet/outletReducer.js
View file @
5bef1f2
...
...
@@ -6,7 +6,8 @@ import Immutable, {Map} from 'immutable';
const
{
SET_ACTIVITY_FLITER
,
SET_FLITER
,
SHOW_TOAST
,
HIDE_TOAST
,
GET_CATEGORY_REQUEST
,
GET_CATEGORY_SUCCESS
,
GET_CATEGORY_FAILURE
,
...
...
@@ -219,6 +220,10 @@ export default function outletReducer(state=initialState, action) {
})
return
state
.
setIn
([
'categoryList'
,
'list'
],
Immutable
.
fromJS
(
categoryList
.
list
))
}
case
SHOW_TOAST
:
return
state
.
set
(
'isShowToast'
,
true
).
set
(
'toastMessage'
,
action
.
payload
)
case
HIDE_TOAST
:
return
state
.
set
(
'isShowToast'
,
false
).
set
(
'toastMessage'
,
''
)
}
return
state
;
...
...
js/redPersonBrand/components/redBrand/Header.js
View file @
5bef1f2
...
...
@@ -213,7 +213,7 @@ let styles = StyleSheet.create({
height
:
imageHeigth
,
position
:
'absolute'
,
marginTop
:
-
imageHeigth
,
backgroundColor
:
'rgba(0,0,0,.
2
)'
backgroundColor
:
'rgba(0,0,0,.
15
)'
},
header
:
{
justifyContent
:
'flex-end'
,
...
...
Please
register
or
login
to post a comment