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
7026926b8881988d9d2cf404c9a782aadc1b9456
1 parent
29af28d7
Fix bug on order and good goods recommends. reviewed by redding.
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
5 deletions
js/goodGoodsRecommend/components/list/List.js
js/goodGoodsRecommend/components/list/ListCell.js
js/order/components/detail/Detail.js
js/order/containers/DetailContainer.js
js/goodGoodsRecommend/components/list/List.js
View file @
7026926
...
...
@@ -77,7 +77,15 @@ export default class List extends Component {
return
(
<
View
style
=
{
styles
.
container
}
>
{
Platform
.
OS
===
'ios'
?
<
ListView
contentContainerStyle
=
{
styles
.
contentContainer
}
enableEmptySections
=
{
true
}
showsVerticalScrollIndicator
=
{
false
}
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataBlob
)}
renderRow
=
{
this
.
renderRow
}
enablePullToRefresh
=
{
true
}
isOnPullToRefresh
=
{
isProductListFetching
&&
products
.
ptr
}
onRefreshData
=
{()
=>
{
?
<
ListView
contentContainerStyle
=
{
styles
.
contentContainer
}
enableEmptySections
=
{
true
}
showsVerticalScrollIndicator
=
{
false
}
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataBlob
)}
renderRow
=
{
this
.
renderRow
}
enablePullToRefresh
=
{
true
}
isOnPullToRefresh
=
{
isProductListFetching
&&
products
.
ptr
}
onRefreshData
=
{()
=>
{
this
.
props
.
onRefresh
&&
this
.
props
.
onRefresh
();
}}
onEndReached
=
{()
=>
{
if
(
list
&&
list
.
length
)
{
...
...
@@ -90,7 +98,14 @@ export default class List extends Component {
return
null
;
}
}}
/
>
:
<
ListView
contentContainerStyle
=
{
styles
.
contentContainer
}
enableEmptySections
=
{
true
}
showsVerticalScrollIndicator
=
{
false
}
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataBlob
)}
renderRow
=
{
this
.
renderRow
}
enablePullToRefresh
=
{
true
}
refreshControl
=
{
<
YH_PtrRefresh
refreshing
=
{
:
<
ListView
contentContainerStyle
=
{
styles
.
contentContainer
}
enableEmptySections
=
{
true
}
showsVerticalScrollIndicator
=
{
false
}
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataBlob
)}
renderRow
=
{
this
.
renderRow
}
enablePullToRefresh
=
{
true
}
refreshControl
=
{
<
YH_PtrRefresh
refreshing
=
{
isFetchingAndroid
}
onRefresh
=
{
...
...
@@ -109,6 +124,9 @@ export default class List extends Component {
}
}}
/
>
}
<
LoadingIndicator
isVisible
=
{
isProductListFetching
&&
!
list
.
length
}
/
>
<
/View
>
);
}
...
...
js/goodGoodsRecommend/components/list/ListCell.js
View file @
7026926
...
...
@@ -44,7 +44,7 @@ export default class ListCell extends Component {
likeImgSource
=
require
(
'../../image/unlike.png'
)
likeTextColor
=
'#b0b0b0'
;
}
let
showPraiseButton
=
is_praised
&&
total_praised
;
return
(
<
TouchableOpacity
style
=
{
styles
.
container
}
onPress
=
{()
=>
{
this
.
props
.
onPressDetail
&&
this
.
props
.
onPressDetail
(
product_skn
,
this
.
props
.
index
,
is_praised
,
total_praised
)
...
...
@@ -57,12 +57,14 @@ export default class ListCell extends Component {
<
View
style
=
{
styles
.
rightPannel
}
>
<
Text
numberOfLines
=
{
2
}
style
=
{
styles
.
title
}
>
{
product_name
}
<
/Text
>
<
Text
numberOfLines
=
{
4
}
style
=
{
styles
.
phrase
}
>
{
phrase
}
<
/Text
>
<
TouchableOpacity
style
=
{
styles
.
likeButton
}
activeOpacity
=
{
1
}
onPress
=
{()
=>
{
{
showPraiseButton
?
<
TouchableOpacity
style
=
{
styles
.
likeButton
}
activeOpacity
=
{
1
}
onPress
=
{()
=>
{
this
.
props
.
onPressLike
&&
this
.
props
.
onPressLike
(
this
.
props
.
index
);
}}
>
<
Image
style
=
{
styles
.
likeImage
}
source
=
{
likeImgSource
}
/
>
<
Text
style
=
{[
styles
.
likeText
,
{
color
:
likeTextColor
}]}
>
{
total_praised
}
人说赞
<
/Text
>
<
/TouchableOpacity
>
:
null
}
<
/View
>
<
/View
>
<
/TouchableOpacity
>
...
...
js/order/components/detail/Detail.js
View file @
7026926
...
...
@@ -77,7 +77,7 @@ export default class Detail extends Component {
}}
/>
)
;
break
;
case
'productList'
:
return
(
<
ProductListCell
data
=
{
rowData
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
/>
)
;
return
(
<
ProductListCell
data
=
{
rowData
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
_onPressDelayNotice
=
{
this
.
props
.
_onPressDelayNotice
}
/>
)
;
break
;
case
'paymentInfo'
:
return
(
<
PaymentInfoCell
data
=
{
rowData
}
/>
)
;
...
...
js/order/containers/DetailContainer.js
View file @
7026926
...
...
@@ -53,6 +53,7 @@ class DetailContainer extends Component {
this
.
onPressProduct
=
this
.
onPressProduct
.
bind
(
this
);
this
.
pushMultiPackageWithPackages
=
this
.
pushMultiPackageWithPackages
.
bind
(
this
);
this
.
onPressReturnOrderCode
=
this
.
onPressReturnOrderCode
.
bind
(
this
);
this
.
showDelayDeliveryNotice
=
this
.
showDelayDeliveryNotice
.
bind
(
this
);
this
.
subscription
=
NativeAppEventEmitter
.
addListener
(
'YHNotificationChangeOnLinePayToCodPay'
,
(
reminder
)
=>
{
...
...
@@ -101,6 +102,10 @@ class DetailContainer extends Component {
ReactNative
.
NativeModules
.
YH_OrderHelper
.
onPressReturnOrderCode
();
}
showDelayDeliveryNotice
(
noticeString
){
NativeModules
.
YH_OrderHelper
.
deliveryDelayNotice
(
noticeString
);
}
render
()
{
let
{
detail
,
app
}
=
this
.
props
;
return
(
...
...
@@ -114,6 +119,7 @@ class DetailContainer extends Component {
onPressExpress
=
{
this
.
onPressExpress
}
pushMultiPackageWithPackages
=
{
this
.
pushMultiPackageWithPackages
}
onPressReturnOrderCode
=
{
this
.
onPressReturnOrderCode
}
_onPressDelayNotice
=
{
this
.
showDelayDeliveryNotice
}
/
>
);
}
...
...
Please
register
or
login
to post a comment