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
Yincheng
8 years ago
Commit
eddc5b5bcfff0c22fcc757a7f1d9d9ad86cd7738
1 parent
528ba5e6
发现好货资源位数据和UI更新
reviewed by gaijianqiu
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
14 deletions
js/goodGoodsRecommend/components/list/List.js
js/goodGoodsRecommend/components/list/ListBannerSwiper.js
js/goodGoodsRecommend/containers/ListContainer.js
js/goodGoodsRecommend/reducers/list/listActions.js
js/goodGoodsRecommend/services/ListService.js
js/goodGoodsRecommend/components/list/List.js
View file @
eddc5b5
...
...
@@ -34,7 +34,7 @@ export default class List extends Component {
renderRow
(
rowData
,
sectionID
,
rowID
,
highlightRow
)
{
switch
(
sectionID
)
{
case
'banner'
:
{
return
<
ListBannerSwiper
resource
=
{
rowData
}
onPress
SlideItem
=
{
this
.
props
.
onJumpWithUrl
}
/
>
return
<
ListBannerSwiper
resource
=
{
rowData
}
onPress
Banner
=
{
this
.
props
.
onPressBanner
}
/
>
}
break
;
case
'list'
:
{
...
...
@@ -51,10 +51,15 @@ export default class List extends Component {
let
isFetching
=
(
isProductListFetching
&&
products
.
page
==
0
)
||
banner
.
isFetching
;
let
list
=
products
.
list
&&
products
.
list
.
toJS
();
let
bannerList
=
banner
.
data
&&
banner
.
data
.
toJS
();
let
bannerData
=
[];
if
(
banner
.
data
&&
banner
.
data
.
toJS
())
{
let
bannerDataArray
=
banner
.
data
.
toJS
();
if
(
bannerDataArray
.
length
>
0
)
{
bannerData
=
bannerDataArray
[
0
].
data
;
}
}
let
dataBlob
=
{
'banner'
:
banner
List
?
[
bannerList
]
:
[],
'banner'
:
banner
Data
.
length
?
[
bannerData
]
:
[],
'list'
:
list
?
list
:
[],
};
...
...
js/goodGoodsRecommend/components/list/ListBannerSwiper.js
View file @
eddc5b5
...
...
@@ -65,17 +65,15 @@ export default class ListBannerSwiper extends React.Component {
height
=
{
height
}
>
{
resource
.
map
((
item
,
i
)
=>
{
let
obj
=
item
.
data
[
0
];
return
(
<
TouchableOpacity
key
=
{
i
}
activeOpacity
=
{
1
}
onPress
=
{()
=>
{
this
.
props
.
onPress
SlideItem
&&
this
.
props
.
onPressSlideItem
(
obj
.
url
);
this
.
props
.
onPress
Banner
&&
this
.
props
.
onPressBanner
(
item
.
url
);
}}
>
<
SlicedImage
source
=
{{
uri
:
obj
.
src
}}
style
=
{{
width
,
height
}}
/
>
<
SlicedImage
source
=
{{
uri
:
item
.
src
}}
style
=
{{
width
,
height
}}
/
>
<
/TouchableOpacity
>
);
})}
...
...
js/goodGoodsRecommend/containers/ListContainer.js
View file @
eddc5b5
...
...
@@ -47,6 +47,7 @@ class ListContainer extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
_onPressDetail
=
this
.
_onPressDetail
.
bind
(
this
);
this
.
_onPressBanner
=
this
.
_onPressBanner
.
bind
(
this
);
this
.
_onEndReached
=
this
.
_onEndReached
.
bind
(
this
);
}
...
...
@@ -66,8 +67,14 @@ class ListContainer extends Component {
ReactNative
.
NativeModules
.
YH_CommonHelper
.
pushGoodGoodsRecommendDetailWithProductSKN
(
product_skn
+
''
);
}
_onPressBanner
(
url
)
{
if
(
!
url
)
{
return
;
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
}
_onEndReached
()
{
console
.
log
(
'onasdfadfadfa'
);
InteractionManager
.
runAfterInteractions
(()
=>
{
this
.
props
.
actions
.
getProductList
();
});
...
...
@@ -80,6 +87,7 @@ class ListContainer extends Component {
resource
=
{
list
}
onPressDetail
=
{
this
.
_onPressDetail
}
onEndReached
=
{
this
.
_onEndReached
}
onPressBanner
=
{
this
.
_onPressBanner
}
/
>
);
}
...
...
js/goodGoodsRecommend/reducers/list/listActions.js
View file @
eddc5b5
...
...
@@ -106,8 +106,6 @@ export function fetchBanner() {
dispatch
(
fetchBannerRequest
());
return
new
ListService
(
app
.
serviceHost
).
fetchBannerData
()
.
then
(
json
=>
{
console
.
log
(
'original'
);
console
.
log
(
json
);
dispatch
(
fetchBannerSuccess
(
json
));
})
.
catch
(
error
=>
{
...
...
js/goodGoodsRecommend/services/ListService.js
View file @
eddc5b5
...
...
@@ -13,7 +13,7 @@ export default class ListService {
}
async
getProductListData
(
channel
,
gender
,
uid
,
page
,
pageSize
)
{
this
.
api
=
new
Request
(
'http://dev-api.yohops.com:9999'
);
//
this.api = new Request('http://dev-api.yohops.com:9999');
return
await
this
.
api
.
get
({
url
:
''
,
...
...
@@ -37,9 +37,9 @@ export default class ListService {
}
async
fetchBannerData
()
{
this
.
api
=
new
Request
(
'http://dev-api
.yohops.com:9999'
);
// this.api = new Request('http://service-test3
.yohops.com:9999');
let
content_code
=
'
c8dce01a202870415831ac4a553a2da9
'
;
let
content_code
=
'
efe8847a09c501c363ed94f87e32c0d7
'
;
let
fromPage
=
''
;
return
await
this
.
api
.
get
({
...
...
Please
register
or
login
to post a comment