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
yoho-js001
8 years ago
Commit
b9a02fd9ad03662e1c865a1e1ebc3810dc257b39
1 parent
4302bf06
master
...
6.7.0_0.49
6.7.1_0.49
6.7.4_0.49
6.7.5_0.49
6.8.7_message
6.9.5_msg
6.9.9_invite
V0125_Date
V1115_Date
V1130_Date
V1217_Date
V1230_Date
V6.10.1
V6.10.2
V6.7.9_dev
V6.8.6
V6.8.7
V6.8.7_upgrades
V6.8.9
V6.9.1
V6.9.2
V6.9.3
V6.9.5
V6.9.6
V6.9.6_Alliance
V6.9.7
V6.9.8
V6.9.8_shoudan
V6.9.9
V9.30_Date
exception
feature/rn_update61
gerry/v6.9.14_panicBuying
gerry/v6.9.16_bugfixed
v6.10.0
v6.9.10
v6.9.11
v6.9.12
v6.9.13
v6.9.14
v6.9.16
v6.9.17
v6.9.19
v6.9.20
v6.9.21
v6.9.22
v6.9.24
6.9.8
6.9.7
6.9.6
6.9.4
6.9.2
6.9.1
6.8.9
6.8.8
6.8.4
6.8.3
6.8.2
6.7.9
6.7.8
6.7.7
6.6.4
5.5.1
5.4.1
5.4
v6.7.5
v6.7.1
v6.2.0
v6.1.0
v5.6.2
v5.6.0
v5.5.2
v5.5.0
v5.4.1
v5.4.0
ios-5.4.0
V6.8.6
V6.8.5
V6.8.1
打点曝光.
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
185 additions
and
14 deletions
js/newArrival/NewArrival.js
js/newArrival/components/newArrival/ArticleCell.js
js/newArrival/components/newArrival/BrandCell.js
js/newArrival/components/newArrival/NewArrival.js
js/newArrival/components/newArrival/RecommendCell.js
js/newArrival/components/newArrival/TagsCell.js
js/newArrival/containers/NewArrivalContainer.js
js/newArrival/NewArrival.js
View file @
b9a02fd
...
...
@@ -24,6 +24,7 @@ import {
setPlatform
,
setHost
,
setServiceHost
,
setChannel
,
}
from
'./reducers/app/appActions'
;
...
...
@@ -44,6 +45,7 @@ export default function native(platform) {
const
store
=
configureStore
(
getInitialState
());
store
.
dispatch
(
setPlatform
(
platform
));
store
.
dispatch
(
setHost
(
this
.
props
.
host
));
store
.
dispatch
(
setChannel
(
this
.
props
.
channel
));
store
.
dispatch
(
setServiceHost
(
this
.
props
.
serviceHost
));
if
(
type
==
'recForYou'
)
{
return
(
...
...
js/newArrival/components/newArrival/ArticleCell.js
View file @
b9a02fd
...
...
@@ -22,13 +22,14 @@ export default class ProductListCell extends Component {
render
()
{
let
{
data
,
sourceType
,
rowID
,
style
}
=
this
.
props
;
let
{
data
,
sourceType
,
index
,
style
}
=
this
.
props
;
let
url
=
data
.
get
(
'url'
);
let
title
=
data
.
get
(
'title'
);
let
publish_time
=
data
.
get
(
'publish_time'
);
let
browse
=
data
.
get
(
'browse'
);
let
src
=
data
.
get
(
'src'
);
let
article_id
=
data
.
get
(
'id'
);
if
(
browse
>
10000
)
{
browse
=
browse
/
10000.0
;
...
...
@@ -41,7 +42,7 @@ export default class ProductListCell extends Component {
style
=
{[
styles
.
container
,
style
]}
activeOpacity
=
{
1
}
onPress
=
{()
=>
{
this
.
props
.
onPressArticle
&&
this
.
props
.
onPressArticle
(
url
);
this
.
props
.
onPressArticle
&&
this
.
props
.
onPressArticle
(
url
,
index
,
article_id
);
}}
>
<
View
style
=
{{
flex
:
1
}}
>
...
...
js/newArrival/components/newArrival/BrandCell.js
View file @
b9a02fd
...
...
@@ -23,13 +23,13 @@ export default class BrandCell extends Component {
}
render
()
{
let
{
data
}
=
this
.
props
;
let
{
data
,
index
}
=
this
.
props
;
let
shop_logo
=
data
.
get
(
'shop_logo'
);
let
shops_id
=
data
.
get
(
'shops_id'
);
let
new_product_num
=
data
.
get
(
'new_product_num'
);
shop_logo
=
shop_logo
.
replace
(
'{width}'
,
83
).
replace
(
'{height}'
,
34
).
replace
(
'{mode}'
,
2
);
return
(
<
TouchableOpacity
style
=
{
styles
.
container
}
onPress
=
{()
=>
{
this
.
props
.
onPressShop
&&
this
.
props
.
onPressShop
(
data
);}}
>
<
TouchableOpacity
style
=
{
styles
.
container
}
onPress
=
{()
=>
{
this
.
props
.
onPressShop
&&
this
.
props
.
onPressShop
(
data
,
index
);}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{{
uri
:
shop_logo
}}
/
>
<
View
style
=
{
styles
.
footerContainer
}
>
...
...
js/newArrival/components/newArrival/NewArrival.js
View file @
b9a02fd
...
...
@@ -146,6 +146,7 @@ export default class NewArrival extends Component {
style
=
{[
styles
.
listContainer
,
customStyle
]}
recommend_type
=
{
recommend_type
}
data
=
{
data
}
index
=
{
rowID
}
onPressCategory
=
{
this
.
props
.
onPressCategory
}
onPressHotSearch
=
{
this
.
props
.
onPressHotSearch
}
/
>
...
...
@@ -154,12 +155,12 @@ export default class NewArrival extends Component {
if
(
recommend_type
==
'hotShop'
)
{
return
(
<
ShopCell
style
=
{[
styles
.
listContainer
,
customStyle
]}
data
=
{
data
}
onPressShop
=
{
this
.
props
.
onPressShop
}
/
>
<
ShopCell
style
=
{[
styles
.
listContainer
,
customStyle
]}
data
=
{
data
}
onPressShop
=
{
this
.
props
.
onPress
ProductList
Shop
}
/
>
)
}
if
(
recommend_type
==
'fashionArticle'
)
{
return
(
<
ArticleCell
style
=
{[
styles
.
listContainer
,
customStyle
]}
data
=
{
data
}
onPressArticle
=
{
this
.
props
.
onPressArticle
}
/
>
<
ArticleCell
index
=
{
rowID
}
style
=
{[
styles
.
listContainer
,
customStyle
]}
data
=
{
data
}
onPressArticle
=
{
this
.
props
.
onPressArticle
}
/
>
)
}
if
(
!
recommend_type
)
{
...
...
js/newArrival/components/newArrival/RecommendCell.js
View file @
b9a02fd
...
...
@@ -27,7 +27,7 @@ export default class RecommendCell extends Component {
_renderRow
(
rowData
,
rowID
)
{
return
(
<
BrandCell
data
=
{
rowData
}
onPressShop
=
{
this
.
props
.
onPressShop
}
/
>
<
BrandCell
index
=
{
rowID
}
data
=
{
rowData
}
onPressShop
=
{
this
.
props
.
onPressShop
}
/
>
)
}
render
()
{
...
...
js/newArrival/components/newArrival/TagsCell.js
View file @
b9a02fd
...
...
@@ -38,7 +38,7 @@ export default class ProductListCell extends Component {
}
render
()
{
let
{
data
,
recommend_type
,
style
}
=
this
.
props
;
let
{
data
,
index
,
recommend_type
,
style
}
=
this
.
props
;
return
(
<
TouchableOpacity
style
=
{[
styles
.
container
,
style
]}
...
...
@@ -62,10 +62,10 @@ export default class ProductListCell extends Component {
<
View
style
=
{
styles
.
tag
}
key
=
{
i
}
>
<
TouchableOpacity
style
=
{
styles
.
button
}
onPress
=
{()
=>
{
if
(
recommend_type
==
'seasonSort'
)
{
this
.
props
.
onPressCategory
&&
this
.
props
.
onPressCategory
(
item
);
this
.
props
.
onPressCategory
&&
this
.
props
.
onPressCategory
(
item
,
i
,
index
);
}
if
(
recommend_type
==
'hotSearchTerm'
)
{
this
.
props
.
onPressHotSearch
&&
this
.
props
.
onPressHotSearch
(
item
);
this
.
props
.
onPressHotSearch
&&
this
.
props
.
onPressHotSearch
(
item
,
i
,
index
);
}
}}
>
<
Text
style
=
{
styles
.
tagName
}
>
{
str
}
<
/Text
>
...
...
js/newArrival/containers/NewArrivalContainer.js
View file @
b9a02fd
...
...
@@ -61,6 +61,7 @@ class NewArrivalContainer extends Component {
this
.
_onPressArticle
=
this
.
_onPressArticle
.
bind
(
this
);
this
.
_onPressBanner
=
this
.
_onPressBanner
.
bind
(
this
);
this
.
_onPressCarouselItem
=
this
.
_onPressCarouselItem
.
bind
(
this
);
this
.
_onPressProductListShop
=
this
.
_onPressProductListShop
.
bind
(
this
);
}
componentDidMount
()
{
...
...
@@ -115,6 +116,22 @@ class NewArrivalContainer extends Component {
return
;
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
let
I_INDEX
=
parseInt
(
index
)
+
1
;
let
F_INDEX
=
1
;
if
(
this
.
props
.
newArrival
.
topPart
.
topList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
brandList
.
size
)
{
F_INDEX
++
;
}
let
param
=
{
F_ID
:
1
,
F_NM
:
'精选抢先看'
,
F_INDEX
:
1
,
I_INDEX
,
F_URL
:
url
,
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
}
_onPressBanner
(
url
,
index
)
{
...
...
@@ -134,14 +151,37 @@ class NewArrivalContainer extends Component {
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
}
_onPressArticle
(
url
)
{
_onPressArticle
(
url
,
index
,
article_id
)
{
if
(
!
url
)
{
return
;
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
let
I_INDEX
=
parseInt
(
index
)
+
1
;
let
F_INDEX
=
1
;
if
(
this
.
props
.
newArrival
.
topPart
.
topList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
brandList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
featuredList
.
size
)
{
F_INDEX
++
;
}
let
param
=
{
F_ID
:
1
,
F_NM
:
'最新上架'
,
F_INDEX
,
I_INDEX
,
F_URL
:
url
,
SORT_NM
:
this
.
props
.
newArrival
.
productList
.
order
,
FILTER_VALUE
:
this
.
props
.
newArrival
.
filterFactors
.
toJS
(),
RECOMMEND_TYPE
:
'fashionArticle'
,
ARTICLE_ID
:
article_id
,
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
}
_onPressCategory
(
data
)
{
_onPressCategory
(
data
,
l_index
,
index
)
{
let
categoryId
=
data
.
get
(
'categoryId'
);
let
categoryName
=
data
.
get
(
'categoryName'
);
let
parentId
=
data
.
get
(
'parentId'
);
...
...
@@ -163,19 +203,68 @@ class NewArrivalContainer extends Component {
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpToCategory
(
value
,
0
,
this
.
props
.
app
.
channel
);
let
I_INDEX
=
parseInt
(
index
)
+
1
;
let
F_INDEX
=
1
;
if
(
this
.
props
.
newArrival
.
topPart
.
topList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
brandList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
featuredList
.
size
)
{
F_INDEX
++
;
}
let
param
=
{
F_ID
:
1
,
F_NM
:
'最新上架'
,
F_INDEX
,
I_INDEX
,
SORT_NM
:
this
.
props
.
newArrival
.
productList
.
order
,
FILTER_VALUE
:
this
.
props
.
newArrival
.
filterFactors
.
toJS
(),
RECOMMEND_TYPE
:
'seasonSort'
,
CATE_ID
:
categoryId
,
L_INDEX
:
l_index
,
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
}
_onPressHotSearch
(
data
)
{
_onPressHotSearch
(
data
,
l_index
,
index
)
{
if
(
!
data
)
{
return
;
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
hotSearchWithKeyword
(
data
);
let
I_INDEX
=
parseInt
(
index
)
+
1
;
let
F_INDEX
=
1
;
if
(
this
.
props
.
newArrival
.
topPart
.
topList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
brandList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
featuredList
.
size
)
{
F_INDEX
++
;
}
let
param
=
{
F_ID
:
1
,
F_NM
:
'最新上架'
,
F_INDEX
,
I_INDEX
,
SORT_NM
:
this
.
props
.
newArrival
.
productList
.
order
,
FILTER_VALUE
:
this
.
props
.
newArrival
.
filterFactors
.
toJS
(),
RECOMMEND_TYPE
:
'hotSearchTerm'
,
KEYWORD_WORD
:
data
,
L_INDEX
:
l_index
,
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
}
_onPress
Shop
(
data
)
{
_onPress
ProductListShop
(
data
,
index
)
{
let
{
shop_name
,
shops_id
,
brand_id
,
}
=
data
.
toJS
();
if
(
!
shops_id
||!
shop_name
)
{
...
...
@@ -183,6 +272,60 @@ class NewArrivalContainer extends Component {
}
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
);
let
I_INDEX
=
parseInt
(
index
)
+
1
;
let
F_INDEX
=
1
;
if
(
this
.
props
.
newArrival
.
topPart
.
topList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
brandList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
featuredList
.
size
)
{
F_INDEX
++
;
}
let
param
=
{
F_ID
:
1
,
F_NM
:
'最新上架'
,
F_INDEX
,
I_INDEX
,
F_URL
:
url
,
SORT_NM
:
this
.
props
.
newArrival
.
productList
.
order
,
FILTER_VALUE
:
this
.
props
.
newArrival
.
filterFactors
.
toJS
(),
RECOMMEND_TYPE
:
'hotShop'
,
BRAND_ID
:
brand_id
,
SHOP_ID
:
shops_id
,
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
}
_onPressShop
(
data
,
index
)
{
let
{
shop_name
,
shops_id
,
brand_id
,
}
=
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":"1","shop_name":"${shop_name}"}}`;
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
let
I_INDEX
=
parseInt
(
index
)
+
1
;
let
F_INDEX
=
1
;
if
(
this
.
props
.
newArrival
.
topPart
.
topList
.
size
)
{
F_INDEX
=
2
;
}
let
param
=
{
F_ID
:
2
,
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
);
}
_onPressProductListProduct
(
product
,
rowId
=
0
)
{
...
...
@@ -194,6 +337,29 @@ class NewArrivalContainer extends Component {
let
url
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}"}}`;
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
let
I_INDEX
=
parseInt
(
rowId
)
+
1
;
let
F_INDEX
=
1
;
if
(
this
.
props
.
newArrival
.
topPart
.
topList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
brandList
.
size
)
{
F_INDEX
++
;
}
if
(
this
.
props
.
newArrival
.
topPart
.
featuredList
.
size
)
{
F_INDEX
++
;
}
let
param
=
{
F_ID
:
1
,
F_NM
:
'最新上架'
,
F_INDEX
,
I_INDEX
,
F_URL
:
url
,
SORT_NM
:
this
.
props
.
newArrival
.
productList
.
order
,
FILTER_VALUE
:
this
.
props
.
newArrival
.
filterFactors
.
toJS
(),
PRD_SKN
:
productSkn
,
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_NEW_ARRIVAL_FLR_C'
,
param
);
}
_goToRecommendForYou
()
{
...
...
@@ -236,6 +402,7 @@ class NewArrivalContainer extends Component {
onPressArticle
=
{
this
.
_onPressArticle
}
onPressBanner
=
{
this
.
_onPressBanner
}
onPressCarouselItem
=
{
this
.
_onPressCarouselItem
}
onPressProductListShop
=
{
this
.
_onPressProductListShop
}
/
>
<
/View
>
);
...
...
Please
register
or
login
to post a comment