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
d0e83641de068593fcd3468927ec4cdad1367169
2 parents
50c2d964
947a9a4b
Merge remote-tracking branch 'origin/5.5.0' into 5.5.0
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
53 additions
and
31 deletions
js/blk/components/brand/BrandSwiper.js
js/classify/components/categoryB/HotCategoryList.js
js/goodGoodsRecommend/components/detail/ContentCell.js
js/goodGoodsRecommend/components/list/List.js
js/goodGoodsRecommend/containers/ListContainer.js
js/goodGoodsRecommend/reducers/list/listActions.js
js/goodGoodsRecommend/reducers/list/listInitialState.js
js/goodGoodsRecommend/reducers/list/listReducer.js
js/vip/containers/BirthContainer.js
js/vip/containers/FastExpressContainer.js
js/vip/containers/YearActivityContainer.js
js/vip/services/yearActivityService.js
js/blk/components/brand/BrandSwiper.js
View file @
d0e8364
...
...
@@ -9,6 +9,8 @@ import Immutable, {Map} from 'immutable';
import
YH_Image
from
'../../../common/components/YH_Image'
;
import
{
getSlicedUrl
}
from
'../../utils/Utils'
;
import
DeviceInfo
from
'react-native-device-info'
;
import
RecyclerSwiper
from
'../../../common/recycler-swiper/recyclerswiper'
const
{
View
,
...
...
@@ -19,6 +21,8 @@ const {
Platform
,
}
=
ReactNative
;
const
YH_Swiper
=
(
Platform
.
OS
===
'ios'
)
?
Swiper
:
RecyclerSwiper
;
export
default
class
BrandSwiper
extends
React
.
Component
{
constructor
(
props
)
{
...
...
@@ -26,7 +30,7 @@ export default class BrandSwiper extends React.Component {
this
.
dot
=
<
View
style
=
{{
backgroundColor
:
'rgba(2
55,255,255,
.5)'
,
backgroundColor
:
'rgba(2
37, 237, 237, 0
.5)'
,
width
:
6
,
height
:
6
,
borderRadius
:
3
,
...
...
@@ -103,7 +107,7 @@ export default class BrandSwiper extends React.Component {
}
else
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
Swiper
<
YH_
Swiper
style
=
{
styles
.
banner
}
showsButtons
=
{
false
}
loop
=
{
true
}
...
...
@@ -133,7 +137,7 @@ export default class BrandSwiper extends React.Component {
<
/TouchableOpacity
>
);
})}
<
/Swiper
>
<
/
YH_
Swiper
>
<
/View
>
);
}
...
...
js/classify/components/categoryB/HotCategoryList.js
View file @
d0e8364
...
...
@@ -33,11 +33,13 @@ export default class HotCategoryList extends Component{
return
(
<
View
style
=
{
styles
.
headerContainer
}
>
<
Text
style
=
{
styles
.
headerText
}
>
{
title
}
<
/Text
>
<
TouchableOpacity
style
=
{
styles
.
headerMore
}
activeOpacity
=
{
1
}
onPress
=
{()
=>
this
.
props
.
onPressCategoryBMore
&&
this
.
props
.
onPressCategoryBMore
()}
>
<
Text
style
=
{
styles
.
headerMoreText
}
>
MORE
<
/Text
>
<
Image
style
=
{
styles
.
headerMoreArrow
}
source
=
{
require
(
"../../images/category_b_arrow.png"
)}
/
>
<
/TouchableOpacity
>
<
View
style
=
{
styles
.
headerTextContainer
}
>
<
Text
style
=
{
styles
.
headerText
}
>
{
title
}
<
/Text
>
<
TouchableOpacity
style
=
{
styles
.
headerMore
}
activeOpacity
=
{
1
}
onPress
=
{()
=>
this
.
props
.
onPressCategoryBMore
&&
this
.
props
.
onPressCategoryBMore
()}
>
<
Text
style
=
{
styles
.
headerMoreText
}
>
MORE
<
/Text
>
<
Image
style
=
{
styles
.
headerMoreArrow
}
source
=
{
require
(
"../../images/category_b_arrow.png"
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
headerLine
}
/
>
<
/View
>
);
...
...
@@ -116,18 +118,21 @@ let styles = StyleSheet.create({
backgroundColor
:
'#ffffff'
,
},
headerText
:{
headerText
Container
:{
position
:
'absolute'
,
left
:
5
*
DEVICE_WIDTH_RATIO
,
bottom
:
11
*
DEVICE_WIDTH_RATIO
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
},
headerText
:{
flex
:
1
,
fontSize
:
12
*
DEVICE_WIDTH_RATIO
,
color
:
'#B0B0B0'
,
},
headerMore
:{
position
:
'absolute'
,
right
:
5
*
DEVICE_WIDTH_RATIO
,
bottom
:
11
*
DEVICE_WIDTH_RATIO
,
flexDirection
:
'row'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
...
...
js/goodGoodsRecommend/components/detail/ContentCell.js
View file @
d0e8364
...
...
@@ -50,11 +50,13 @@ export default class Detail extends Component {
style
=
{
styles
.
tag
}
>
{
data
.
get
(
'brand_info'
).
get
(
'brand_domain'
)}
<
/Text
>
<
Text
{
data
.
get
(
'middle_sort_name'
)
&&
data
.
get
(
'middle_sort_name'
).
length
?
<
Text
onPress
=
{()
=>
{
this
.
props
.
onPressTag
&&
this
.
props
.
onPressTag
(
data
.
get
(
'middle_sort_name'
))}}
style
=
{
styles
.
tag
}
>
{
data
.
get
(
'middle_sort_name'
)}
<
/Text
>
<
/Text>:null
}
<
/View
>
<
/View
>
);
...
...
js/goodGoodsRecommend/components/list/List.js
View file @
d0e8364
...
...
@@ -52,7 +52,10 @@ export default class List extends Component {
let
{
products
,
banner
}
=
this
.
props
.
resource
;
let
isProductListFetching
=
products
.
isFetching
;
let
list
=
products
.
list
&&
products
.
list
.
toJS
();
let
list
=
[];
if
(
products
.
list
&&
products
.
list
.
toJS
())
{
list
=
products
.
list
.
toJS
();
}
let
bannerData
=
[];
if
(
banner
.
data
&&
banner
.
data
.
toJS
())
{
let
bannerDataArray
=
banner
.
data
.
toJS
();
...
...
@@ -64,8 +67,8 @@ export default class List extends Component {
'banner'
:
bannerData
.
length
?
[
bannerData
]
:
[],
'list'
:
list
?
list
:
[],
};
let
isFetching
=
(
isProductListFetching
&&
products
.
page
==
0
)
||
banner
.
isFetching
;
let
isFetching
=
(
products
.
isFetching
&&!
products
.
ptr
&&!
dataBlob
.
list
.
length
);
let
isFetchingAndroid
=
!
products
.
isFetching
&&
!
banner
.
isFetching
;
return
(
<
View
style
=
{
styles
.
container
}
>
{
...
...
@@ -77,7 +80,7 @@ export default class List extends Component {
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataBlob
)}
renderRow
=
{
this
.
renderRow
}
enablePullToRefresh
=
{
true
}
isOnPullToRefresh
=
{
is
Fetching
}
isOnPullToRefresh
=
{
is
ProductListFetching
&&
products
.
ptr
}
onRefreshData
=
{()
=>
{
this
.
props
.
onRefresh
&&
this
.
props
.
onRefresh
();
}}
...
...
@@ -106,7 +109,7 @@ export default class List extends Component {
enablePullToRefresh
=
{
true
}
refreshControl
=
{
<
YH_PtrRefresh
refreshing
=
{
isFetching
}
refreshing
=
{
isFetching
Android
}
onRefresh
=
{()
=>
{
this
.
props
.
onRefresh
&&
this
.
props
.
onRefresh
();
}}
...
...
js/goodGoodsRecommend/containers/ListContainer.js
View file @
d0e8364
...
...
@@ -55,7 +55,7 @@ class ListContainer extends Component {
componentDidMount
()
{
this
.
props
.
actions
.
fetchBanner
();
this
.
props
.
actions
.
getProductList
();
this
.
props
.
actions
.
getProductList
(
false
);
}
componentWillUnmount
()
{
...
...
@@ -111,7 +111,7 @@ class ListContainer extends Component {
_onEndReached
()
{
InteractionManager
.
runAfterInteractions
(()
=>
{
this
.
props
.
actions
.
getProductList
();
this
.
props
.
actions
.
getProductList
(
false
);
});
}
...
...
js/goodGoodsRecommend/reducers/list/listActions.js
View file @
d0e8364
...
...
@@ -16,7 +16,7 @@ const {
FETCH_BANNER_FAILURE
,
}
=
require
(
'../../constants/actionTypes'
).
default
;
export
function
getProductList
(
reload
=
false
)
{
export
function
getProductList
(
reload
)
{
return
(
dispatch
,
getState
)
=>
{
let
{
app
,
list
}
=
getState
();
let
{
products
}
=
list
;
...
...
@@ -26,10 +26,10 @@ export function getProductList(reload = false) {
}
let
fetchList
=
(
channel
,
gender
,
uid
,
page
,
pageSize
)
=>
{
dispatch
(
getProductListRequest
());
dispatch
(
getProductListRequest
(
reload
));
return
new
ListService
(
app
.
host
).
getProductListData
(
channel
,
gender
,
uid
,
page
,
pageSize
)
.
then
(
json
=>
{
let
count
=
products
.
list
&&
products
.
list
.
size
()
;
let
count
=
products
.
list
&&
products
.
list
.
size
;
let
payload
=
parseProductList
(
json
,
count
);
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_FIND_GOOD_GDS_L'
,
payload
.
logParam
);
...
...
@@ -98,9 +98,10 @@ function parseProductList(json, count) {
};
}
export
function
getProductListRequest
()
{
export
function
getProductListRequest
(
reload
)
{
return
{
type
:
GET_PRODUCT_LIST_REQUEST
,
payload
:
reload
,
};
}
...
...
js/goodGoodsRecommend/reducers/list/listInitialState.js
View file @
d0e8364
...
...
@@ -9,6 +9,7 @@ let InitialState = Record({
data
:
null
,
})),
products
:
new
(
Record
({
ptr
:
false
,
isFetching
:
false
,
error
:
null
,
list
:
null
,
...
...
js/goodGoodsRecommend/reducers/list/listReducer.js
View file @
d0e8364
...
...
@@ -17,7 +17,9 @@ const initialState = new InitialState;
export
default
function
listReducer
(
state
=
initialState
,
action
)
{
switch
(
action
.
type
)
{
case
GET_PRODUCT_LIST_REQUEST
:
{
return
state
.
setIn
([
'products'
,
'isFetching'
],
true
);
let
newState
=
state
.
setIn
([
'products'
,
'isFetching'
],
true
)
.
setIn
([
'products'
,
'ptr'
],
action
.
payload
);
return
newState
;
}
case
GET_PRODUCT_LIST_SUCCESS
:
{
let
{
...
...
@@ -26,9 +28,11 @@ export default function listReducer(state=initialState, action) {
pageCount
,
total
,
endReached
,
reload
,
}
=
action
.
payload
;
let
newState
=
state
.
setIn
([
'products'
,
'isFetching'
],
false
)
.
setIn
([
'products'
,
'ptr'
],
reload
)
.
setIn
([
'products'
,
'error'
],
null
)
.
setIn
([
'products'
,
'list'
],
Immutable
.
fromJS
(
list
))
.
setIn
([
'products'
,
'currentPage'
],
currentPage
)
...
...
@@ -40,7 +44,8 @@ export default function listReducer(state=initialState, action) {
}
case
GET_PRODUCT_LIST_FAILURE
:
{
return
state
.
setIn
([
'products'
,
'isFetching'
],
false
)
.
setIn
([
'products'
,
'error'
],
action
.
payload
);
.
setIn
([
'products'
,
'error'
],
action
.
payload
)
.
setIn
([
'products'
,
'ptr'
],
false
);
}
case
FETCH_BANNER_REQUEST
:
{
return
state
.
setIn
([
'banner'
,
'isFetching'
],
true
);
...
...
js/vip/containers/BirthContainer.js
View file @
d0e8364
...
...
@@ -85,7 +85,7 @@ class BirthContainer extends Component {
let
rec_id
=
product
&&
product
.
get
(
'rec_id'
,
""
);
let
params
=
{
TYPE_ID
:
8
,
I_INDEX
:
rowId
+
1
,
I_INDEX
:
parseInt
(
rowId
)
+
1
+
''
,
PRD_ID
:
productId
,
REC_ID
:
rec_id
,
};
...
...
js/vip/containers/FastExpressContainer.js
View file @
d0e8364
...
...
@@ -81,7 +81,7 @@ class FastExpressContainer extends Component {
let
rec_id
=
product
&&
product
.
get
(
'rec_id'
,
""
);
let
params
=
{
TYPE_ID
:
7
,
I_INDEX
:
rowId
+
1
,
I_INDEX
:
parseInt
(
rowId
)
+
1
+
''
,
PRD_ID
:
productId
,
REC_ID
:
rec_id
,
};
...
...
js/vip/containers/YearActivityContainer.js
View file @
d0e8364
...
...
@@ -80,8 +80,7 @@ class YearActivityContainer extends Component {
let
rec_id
=
product
&&
product
.
get
(
'rec_id'
,
""
);
let
params
=
{
TYPE_ID
:
11
,
ENT_ID
:
""
,
I_INDEX
:
rowId
+
1
,
I_INDEX
:
parseInt
(
rowId
)
+
1
+
''
,
PRD_ID
:
productId
,
REC_ID
:
rec_id
,
};
...
...
js/vip/services/yearActivityService.js
View file @
d0e8364
...
...
@@ -20,6 +20,8 @@ export default class yearActivityService {
select_gender
:
channel
,
limit
,
page
,
gender
:
''
,
yh_channel
:
channel
,
}
})
.
then
((
json
)
=>
{
...
...
Please
register
or
login
to post a comment