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
d0d7f58c641d5576d64eaa137d93af0289b32f49
1 parent
05dc6527
好店推荐数据上报index调整 review by 孙凯
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
js/home/components/floor/ShopRecommend.js
js/home/components/floor/ShopRecommend.js
View file @
d0d7f58
...
...
@@ -40,6 +40,7 @@ export default class ShopRecommend extends Component{
onClick
(
event
:
Event
)
{
let
type
=
event
.
nativeEvent
.
type
;
let
index
=
event
.
nativeEvent
.
index
;
let
realIndex
=
0
;
if
(
type
==
'favorite'
)
{
let
shopId
=
event
.
nativeEvent
.
shopId
;
this
.
props
.
onPressShopFavorite
&&
this
.
props
.
onPressShopFavorite
(
shopId
,
index
);
...
...
@@ -49,24 +50,28 @@ export default class ShopRecommend extends Component{
let
shopId
=
event
.
nativeEvent
.
shopId
;
let
type
=
event
.
nativeEvent
.
type
;
let
imageUrl
=
''
;
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
let
shopItem
=
list
[
i
];
if
(
shopId
==
shopItem
.
shopId
)
{
if
(
type
==
'top'
)
{
realIndex
=
i
*
4
+
1
;
imageUrl
=
shopItem
.
src
&&
SlicedImage
.
getSlicedUrl
(
shopItem
.
src
,
240
*
DEVICE_WIDTH_RATIO
,
116
*
DEVICE_WIDTH_RATIO
,
2
);
}
else
if
(
type
==
'left'
)
{
realIndex
=
i
*
4
+
2
;
imageUrl
=
shopItem
.
goods0
&&
shopItem
.
goods0
.
src
&&
SlicedImage
.
getSlicedUrl
(
shopItem
.
goods0
.
src
,
80
*
DEVICE_WIDTH_RATIO
,
106
*
DEVICE_WIDTH_RATIO
,
2
);
}
else
if
(
type
==
'right'
)
{
realIndex
=
i
*
4
+
4
;
imageUrl
=
shopItem
.
goods2
&&
shopItem
.
goods2
.
src
&&
SlicedImage
.
getSlicedUrl
(
shopItem
.
goods2
.
src
,
80
*
DEVICE_WIDTH_RATIO
,
106
*
DEVICE_WIDTH_RATIO
,
2
);
}
else
if
(
type
==
'center'
)
{
realIndex
=
i
*
4
+
3
;
imageUrl
=
shopItem
.
goods1
&&
shopItem
.
goods1
.
src
&&
SlicedImage
.
getSlicedUrl
(
shopItem
.
goods1
.
src
,
80
*
DEVICE_WIDTH_RATIO
,
106
*
DEVICE_WIDTH_RATIO
,
2
);
}
break
;
}
}
this
.
props
.
onPressShopRecommendItem
&&
this
.
props
.
onPressShopRecommendItem
(
url
,
imageUrl
,
i
ndex
);
this
.
props
.
onPressShopRecommendItem
&&
this
.
props
.
onPressShopRecommendItem
(
url
,
imageUrl
,
realI
ndex
);
}
}
...
...
Please
register
or
login
to post a comment