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
420d2fd618a239c0d2fbdbeccb7910f24730bd20
2 parents
918ed094
eab9efa7
Merge branch '5.4' of
http://git.yoho.cn/mobile/YH_RNComponent
into 5.4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
146 additions
and
17 deletions
js/classify/components/categoryB/HotCategoryList.js
js/newArrival/containers/RecForYouContainer.js
js/newArrival/reducers/newArrival/newArrivalActions.js
js/classify/components/categoryB/HotCategoryList.js
View file @
420d2fd
...
...
@@ -50,7 +50,7 @@ export default class HotCategoryList extends Component{
return
null
;
}
let
imageUrl
=
SlicedImage
.
getSlicedUrl
(
rowData
.
get
(
"default_images"
),
82
,
1
10
,
2
);
let
imageUrl
=
SlicedImage
.
getSlicedUrl
(
rowData
.
get
(
"default_images"
),
82
,
1
09
,
2
);
// let categoryName = rowData.get("category_name");
//数据类型,纯文字型和图片型,列表中会出现纯文本的情况,比如MORE
...
...
@@ -165,11 +165,12 @@ let styles = StyleSheet.create({
paddingRight
:
8.5
*
DEVICE_WIDTH_RATIO
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
backgroundColor
:
'#f5f7f6'
,
},
rowThumbnail
:{
width
:
41
*
DEVICE_WIDTH_RATIO
,
height
:
5
5
*
DEVICE_WIDTH_RATIO
,
height
:
5
6
*
DEVICE_WIDTH_RATIO
,
},
rowTextContainer
:{
...
...
js/newArrival/containers/RecForYouContainer.js
View file @
420d2fd
...
...
@@ -62,10 +62,27 @@ class NewArrivalContainer extends Component {
let
{
shop_name
,
shops_id
,
brand_id
,
F_ID
,
F_INDEX
,
F_NM
,
I_INDEX
,
}
=
data
;
if
(
!
shops_id
||!
shop_name
)
{
return
;
}
let
param
=
{
F_ID
,
F_NM
,
F_INDEX
,
I_INDEX
,
BRAND_ID
:
brand_id
,
SHOP_ID
:
shops_id
,
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"1","shop_name":"${shop_name}"}}`;
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
}
...
...
js/newArrival/reducers/newArrival/newArrivalActions.js
View file @
420d2fd
...
...
@@ -77,7 +77,7 @@ export function getTopInfo() {
I_INDEX
++
;
}
logData
.
push
({
F_ID
:
1
,
F_ID
:
1
001
,
F_NM
:
'BANNER'
,
F_INDEX
,
LIST
,
...
...
@@ -99,7 +99,7 @@ export function getTopInfo() {
I_INDEX
++
;
}
logData
.
push
({
F_ID
:
2
,
F_ID
:
100
2
,
F_NM
:
'为您推荐'
,
F_INDEX
,
LIST
,
...
...
@@ -121,7 +121,7 @@ export function getTopInfo() {
I_INDEX
++
;
}
logData
.
push
({
F_ID
:
3
,
F_ID
:
100
3
,
F_NM
:
'精选抢先看'
,
F_INDEX
,
LIST
,
...
...
@@ -193,11 +193,16 @@ export function getProductList(reload=false) {
return
new
NewArrivalService
(
app
.
host
).
fetchProductList
(
channel
,
order
,
page
,
pageSize
,
allFilterFactors
)
.
then
(
json
=>
{
let
payload
=
parseProductList
(
json
);
payload
.
endReached
=
payload
.
currentPage
==
payload
.
pageCount
;
let
LIST
=
[];
for
(
var
i
=
0
;
i
<
payload
.
list
.
length
;
i
++
)
{
let
item
=
payload
.
list
[
i
]
let
KEYWORD
=
''
;
let
ListItem
=
{
I_INDEX
:
productList
.
list
.
size
+
i
+
1
,
RECOMMEND_TYPE
:
item
.
recommend_type
,
};
let
KEYWORD_WORD
=
''
;
if
(
item
.
recommend_type
==
'hotSearchTerm'
&&
item
.
data
.
length
)
{
KEYWORD
=
item
.
data
.
join
(
','
);
}
...
...
@@ -219,16 +224,20 @@ export function getProductList(reload=false) {
}
CATE_ID
=
tempAry
.
join
(
','
);
}
LIST
.
push
({
I_INDEX
:
productList
.
list
.
size
+
i
+
1
,
RECOMMEND_TYPE
:
item
.
recommend_type
,
PRD_SKN
:
item
.
product_skn
,
BRAND_ID
:
item
.
brand_id
,
CATE_ID
,
ARTICLE_ID
,
SHOP_ID
,
KEYWORD
,
})
if
(
item
.
product_skn
)
{
ListItem
.
PRD_SKN
=
item
.
product_skn
;
}
else
if
(
item
.
brand_id
)
{
ListItem
.
BRAND_ID
=
item
.
brand_id
;
}
else
if
(
CATE_ID
&&
CATE_ID
!=
''
)
{
ListItem
.
CATE_ID
=
CATE_ID
;
}
else
if
(
ARTICLE_ID
&&
ARTICLE_ID
!=
0
)
{
ListItem
.
ARTICLE_ID
=
ARTICLE_ID
;
}
else
if
(
SHOP_ID
&&
SHOP_ID
!=
0
)
{
ListItem
.
SHOP_ID
=
SHOP_ID
;
}
else
if
(
KEYWORD_WORD
&&
KEYWORD_WORD
!=
''
)
{
ListItem
.
KEYWORD_WORD
=
KEYWORD_WORD
;
}
LIST
.
push
(
ListItem
);
}
let
F_INDEX
=
1
;
if
(
topPart
.
topList
.
size
)
{
...
...
@@ -400,9 +409,93 @@ export function getRecommendBrand() {
dispatch
(
recommendBrandRequest
());
return
new
NewArrivalService
(
app
.
host
).
fetchRecommendBrand
(
channel
)
.
then
(
json
=>
{
let
hotBrandList
=
json
.
hot_brand_list
;
let
browseBrandList
=
json
.
browse_brand_list
;
let
hotBrandList
=
json
.
hot_brand_list
;
let
newBrandList
=
json
.
new_brand_list
;
/**
数据曝光
*/
let
logData
=
[];
let
F_INDEX
=
1
;
if
(
browseBrandList
&&
browseBrandList
.
length
)
{
let
LIST
=
[];
let
I_INDEX
=
1
;
for
(
var
i
=
0
;
i
<
browseBrandList
.
length
;
i
++
)
{
browseBrandList
[
i
].
F_ID
=
1001
;
browseBrandList
[
i
].
F_INDEX
=
F_INDEX
;
browseBrandList
[
i
].
F_NM
=
'浏览过的品牌'
;
browseBrandList
[
i
].
I_INDEX
=
I_INDEX
;
let
item
=
browseBrandList
[
i
];
LIST
.
push
({
I_INDEX
,
BRAND_ID
:
item
.
brand_id
,
SHOP_ID
:
item
.
shops_id
,
});
I_INDEX
++
;
}
logData
.
push
({
F_ID
:
1001
,
F_NM
:
'浏览过的品牌'
,
F_INDEX
,
LIST
,
});
F_INDEX
++
;
}
if
(
hotBrandList
&&
hotBrandList
.
length
)
{
let
LIST
=
[];
let
I_INDEX
=
1
;
for
(
var
i
=
0
;
i
<
hotBrandList
.
length
;
i
++
)
{
let
item
=
hotBrandList
[
i
];
hotBrandList
[
i
].
F_ID
=
1002
;
hotBrandList
[
i
].
F_INDEX
=
F_INDEX
;
hotBrandList
[
i
].
F_NM
=
'热门品牌'
;
hotBrandList
[
i
].
I_INDEX
=
I_INDEX
;
LIST
.
push
({
I_INDEX
,
BRAND_ID
:
item
.
brand_id
,
SHOP_ID
:
item
.
shops_id
,
});
I_INDEX
++
;
}
logData
.
push
({
F_ID
:
1002
,
F_NM
:
'热门品牌'
,
F_INDEX
,
LIST
,
});
F_INDEX
++
;
}
if
(
newBrandList
&&
newBrandList
.
length
)
{
let
LIST
=
[];
let
I_INDEX
=
1
;
for
(
var
i
=
0
;
i
<
newBrandList
.
length
;
i
++
)
{
let
item
=
hotBrandList
[
i
];
hotBrandList
[
i
].
F_ID
=
1003
;
hotBrandList
[
i
].
F_INDEX
=
F_INDEX
;
hotBrandList
[
i
].
F_NM
=
'新入驻品牌'
;
hotBrandList
[
i
].
I_INDEX
=
I_INDEX
;
LIST
.
push
({
I_INDEX
,
BRAND_ID
:
item
.
brand_id
,
SHOP_ID
:
item
.
shops_id
,
});
I_INDEX
++
;
}
logData
.
push
({
F_ID
:
1003
,
F_NM
:
'新入驻品牌'
,
F_INDEX
,
LIST
,
});
F_INDEX
++
;
}
let
params
=
{
DATA
:
logData
,
};
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_SHOW_NEW_ARRIVAL_RECOMMEND'
,
params
);
dispatch
(
recommendBrandSuccess
({
hotBrandList
,
browseBrandList
,
newBrandList
}));
})
.
catch
(
error
=>
{
...
...
@@ -413,7 +506,25 @@ export function getRecommendBrand() {
export
function
goToRecommendForYou
()
{
return
(
dispatch
,
getState
)
=>
{
let
{
app
,
newArrival
}
=
getState
();
let
{
productList
,
filterFactors
,
topPart
}
=
newArrival
;
let
I_INDEX
=
"0"
;
let
F_INDEX
=
1
;
if
(
newArrival
.
topPart
.
topList
.
size
)
{
F_INDEX
=
2
;
}
F_INDEX
=
F_INDEX
.
toString
();
let
param
=
{
F_ID
:
"1002"
,
F_NM
:
'为您推荐'
,
F_INDEX
,
I_INDEX
,
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
ReactNative
.
NativeModules
.
YH_NewArrivalHelper
.
goToRecommendForYou
();
};
}
...
...
Please
register
or
login
to post a comment