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
090df82de8eb5332d5b748a9fc1c0b53250917df
2 parents
d92942c3
6a7b968d
Merge branch '5.5.2' into 5.6.0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
66 deletions
js/mine/containers/MineContainer.js
js/newArrival/components/newArrival/NewArrival.js
js/newArrival/containers/NewArrivalContainer.js
js/newArrival/containers/RecForYouContainer.js
js/mine/containers/MineContainer.js
View file @
090df82
...
...
@@ -84,6 +84,22 @@ class MineContainer extends Component {
this
.
props
.
actions
.
onMineCenterRefresh
();
}
);
this
.
subscription6
=
NativeAppEventEmitter
.
addListener
(
'ProfilesInfoEvent'
,
(
reminder
)
=>
{
if
(
reminder
)
{
let
profilesInfo
=
reminder
.
profilesInfo
;
let
memberBillNew
=
reminder
.
memberBillNew
;
if
(
profilesInfo
)
{
profilesInfo
=
JSON
.
parse
(
profilesInfo
);
}
profilesInfo
&&
this
.
props
.
actions
.
getMineUserInfoSuccess
(
profilesInfo
);
this
.
props
.
actions
.
getMemberBillTaskRedDotSuccess
(
memberBillNew
);
}
}
);
}
componentDidMount
()
{
...
...
@@ -100,6 +116,7 @@ class MineContainer extends Component {
this
.
subscription3
&&
this
.
subscription3
.
remove
();
this
.
subscription4
&&
this
.
subscription4
.
remove
();
this
.
subscription5
&&
this
.
subscription5
.
remove
();
this
.
subscription6
&&
this
.
subscription6
.
remove
();
}
_onPressItem
(
viewId
,
data
)
{
...
...
js/newArrival/components/newArrival/NewArrival.js
View file @
090df82
...
...
@@ -9,6 +9,7 @@ import ReactNative, {
StyleSheet
,
Dimensions
,
TouchableOpacity
,
TouchableHighlight
,
InteractionManager
,
Platform
,
}
from
'react-native'
;
...
...
@@ -32,12 +33,8 @@ export default class NewArrival extends Component {
super
(
props
);
this
.
_renderRow
=
this
.
_renderRow
.
bind
(
this
);
this
.
trigggePullToRefresh
=
this
.
trigggePullToRefresh
.
bind
(
this
);
this
.
_renderSectionHeader
=
this
.
_renderSectionHeader
.
bind
(
this
);
this
.
_onPressProductFilter
=
this
.
_onPressProductFilter
.
bind
(
this
);
this
.
_onChangeVisibleRows
=
this
.
_onChangeVisibleRows
.
bind
(
this
);
this
.
_onMomentumScrollBegin
=
this
.
_onMomentumScrollBegin
.
bind
(
this
);
this
.
_onMomentumScrollEnd
=
this
.
_onMomentumScrollEnd
.
bind
(
this
);
this
.
dataSource
=
new
ListView
.
DataSource
({
rowHasChanged
:
(
r1
,
r2
)
=>
!
Immutable
.
is
(
r1
,
r2
),
...
...
@@ -46,26 +43,11 @@ export default class NewArrival extends Component {
this
.
state
=
{
showBackToTopButton
:
false
,
selectedVisibleIndex
:
-
1
,
scrollEnd
:
false
,
}
}
componentDidMount
()
{
}
componentWillReceiveProps
(
nextProps
)
{
}
trigggePullToRefresh
()
{
if
(
Platform
.
OS
===
'ios'
)
{
InteractionManager
.
runAfterInteractions
(()
=>
{
this
.
listView
&&
this
.
listView
.
getScrollResponder
().
startPullToRefresh
();
});
}
else
{
this
.
props
.
onRefresh
&&
this
.
props
.
onRefresh
();
}
}
_onPressProductFilter
(
value
){
...
...
@@ -256,10 +238,7 @@ export default class NewArrival extends Component {
productList
,
}
=
this
.
props
;
let
similarIndex
=
productList
.
get
(
'similarIndex'
);
let
showSimilarGuider
=
this
.
props
.
showSimilarGuider
&&
this
.
state
.
scrollEnd
&&
rowID
==
this
.
state
.
selectedVisibleIndex
&&
rowID
!=
similarIndex
;
return
(
<
BrandProductListCell
style
=
{[
styles
.
listContainer
,
customStyle
]}
...
...
@@ -270,7 +249,6 @@ export default class NewArrival extends Component {
onPressProduct
=
{
this
.
props
.
onPressProductListProduct
}
onLongPressProduct
=
{
this
.
props
.
onLongPressProduct
}
onPressFindSimilar
=
{
this
.
props
.
onPressFindSimilar
}
showSimilarGuider
=
{
showSimilarGuider
}
/
>
);
}
...
...
@@ -325,37 +303,6 @@ export default class NewArrival extends Component {
return
null
;
}
_onChangeVisibleRows
(
visibleRows
,
changedRows
)
{
if
(
Object
.
keys
(
visibleRows
).
length
==
0
)
{
return
;
}
let
selectedIndex
=
-
1
;
let
sectionIDs
=
Object
.
keys
(
visibleRows
);
let
targetSection
=
'latest'
;
if
(
!
sectionIDs
.
includes
(
targetSection
))
{
return
;
}
let
rowIndexs
=
Object
.
keys
(
visibleRows
[
targetSection
]);
if
(
rowIndexs
.
length
>
0
)
{
selectedIndex
=
rowIndexs
[
0
];
}
if
(
rowIndexs
.
length
>
3
)
{
selectedIndex
=
rowIndexs
[
2
];
}
this
.
setState
({
selectedVisibleIndex
:
selectedIndex
});
}
_onMomentumScrollBegin
(
event
)
{
this
.
setState
({
scrollEnd
:
false
});
}
_onMomentumScrollEnd
(
event
)
{
this
.
setState
({
scrollEnd
:
true
});
}
render
()
{
let
{
...
...
@@ -396,7 +343,6 @@ export default class NewArrival extends Component {
renderRow
=
{
this
.
_renderRow
}
enableEmptySections
=
{
true
}
renderSectionHeader
=
{
this
.
_renderSectionHeader
}
removeClippedSubviews
=
{
true
}
renderFooter
=
{()
=>
{
if
(
endReached
)
{
return
<
View
style
=
{
styles
.
placeholder
}
/>
;
...
...
@@ -422,6 +368,7 @@ export default class NewArrival extends Component {
this
.
setState
({
showBackToTopButton
:
true
});
}
}}
onEndReachedThreshold
=
{
2000
}
/
>
{
productList
.
isFilter
?
<
NewArrivalCategoryList
...
...
@@ -443,14 +390,21 @@ export default class NewArrival extends Component {
onPressCloseMoreFilter
=
{
this
.
props
.
onPressCloseMoreFilter
}
onPressMoreFilter
=
{
this
.
props
.
onPressMoreFilter
}
/> : null
}
{
this
.
state
.
showBackToTopButton
?
<
TouchableOpacity
style
=
{
styles
.
backToTopButton
}
onPress
=
{()
=>
{
this
.
listView
&&
this
.
listView
.
scrollTo
({
x
:
0
,
y
:
0
,
animated
:
true
});
this
.
setState
({
showBackToTopButton
:
false
});
}}
>
<
TouchableHighlight
style
=
{
styles
.
backToTopButton
}
activeOpacity
=
{
1
}
delayLongPress
=
{
1000000
}
onPress
=
{()
=>
{
this
.
listView
&&
this
.
listView
.
scrollTo
({
x
:
0
,
y
:
0
,
animated
:
true
});
this
.
setState
({
showBackToTopButton
:
false
});
}}
onLongPress
=
{()
=>
{
this
.
listView
&&
this
.
listView
.
scrollTo
({
x
:
0
,
y
:
0
,
animated
:
true
});
this
.
setState
({
showBackToTopButton
:
false
});
}}
>
<
Image
style
=
{{
flex
:
1
}}
source
=
{
require
(
'../../image/backtop.png'
)}
/
>
<
/Touchable
Opacity
>: nul
l
<
/Touchable
Highlight
>: nul
l
}
<
LoadingIndicator
...
...
js/newArrival/containers/NewArrivalContainer.js
View file @
090df82
...
...
@@ -299,12 +299,13 @@ class NewArrivalContainer extends Component {
shops_id
,
brand_id
,
shop_template_type
,
is_red_shop
,
}
=
data
.
toJS
();
if
(
!
shops_id
||!
shop_name
)
{
return
;
}
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"${shop_template_type}","shop_name":"${shop_name}"}}`;
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"${shop_template_type}","shop_name":"${shop_name}"
,"is_red_shop":"${is_red_shop}","brand_id":"${brand_id}"
}}`;
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
let
I_INDEX
=
parseInt
(
index
)
+
1
;
...
...
@@ -340,12 +341,13 @@ class NewArrivalContainer extends Component {
shops_id
,
brand_id
,
shop_template_type
,
is_red_shop
,
}
=
data
.
toJS
();
if
(
!
shops_id
||!
shop_name
)
{
return
;
}
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"${shop_template_type}","shop_name":"${shop_name}"}}`;
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"${shop_template_type}","shop_name":"${shop_name}"
,"is_red_shop":"${is_red_shop}","brand_id":"${brand_id}"
}}`;
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
let
I_INDEX
=
parseInt
(
index
)
+
1
;
...
...
js/newArrival/containers/RecForYouContainer.js
View file @
090df82
...
...
@@ -68,6 +68,7 @@ class NewArrivalContainer extends Component {
F_NM
,
I_INDEX
,
shop_template_type
,
is_red_shop
,
}
=
data
;
if
(
!
shops_id
||!
shop_name
)
{
return
;
...
...
@@ -84,7 +85,7 @@ class NewArrivalContainer extends Component {
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_RECOMMEND_FLR_C'
,
param
);
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"${shop_template_type}","shop_name":"${shop_name}"}}`;
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"${shop_template_type}","shop_name":"${shop_name}"
,"is_red_shop":"${is_red_shop}","brand_id":"${brand_id}"
}}`;
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
}
...
...
Please
register
or
login
to post a comment