Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
biao
9 years ago
Commit
f0b352562507d141e05f58e94388caaf6644a812
1 parent
5264468b
update for add ad banner floor
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
apps/channel/models/index.js
apps/channel/views/partial/ad-banner.hbs
apps/channel/models/index.js
View file @
f0b3525
...
...
@@ -118,6 +118,12 @@ const _getStyleIcon = d => {
};
};
const
_getAdBanner
=
d
=>
{
return
{
adBanner
:
d
}
}
/**
* 获取咨询楼层数据
* @param {Object} d 接口返回的楼层数据
...
...
@@ -161,7 +167,8 @@ const floorMap = {
NEW
:
_getNewArrivals
,
CLASSIC
:
_getClassicBrands
,
STYLE
:
_getStyleIcon
,
EDITORIAL
:
_getEditorial
EDITORIAL
:
_getEditorial
,
adBanner
:
_getAdBanner
};
/**
...
...
@@ -205,6 +212,10 @@ const _processFloorData = d => {
let
floorTitle
;
let
floorData
;
if
(
!
data
.
data
)
{
return
false
;
}
// 处理banner
if
(
_isBannerFloor
(
data
))
{
floorData
=
floorMap
.
slider
(
data
.
data
);
...
...
@@ -222,6 +233,8 @@ const _processFloorData = d => {
if
(
floorMap
[
floorTitle
])
{
floorData
=
floorMap
[
floorTitle
](
data
.
data
.
list
);
}
}
else
if
(
data
.
templateName
===
'single_image'
)
{
floorData
=
floorMap
.
adBanner
(
data
.
data
);
}
floorList
.
push
(
floorData
);
...
...
apps/channel/views/partial/ad-banner.hbs
View file @
f0b3525
<div
class=
"ad-banner"
>
{{#
adBanner
}}
<a
href=
"
{{
url
}}
"
>
<img
class=
"lazy-img"
data-original=
"
{{
image
img
1150
160
}}
"
alt=
"
"
>
<img
class=
"lazy-img"
data-original=
"
{{
image
src
1150
160
}}
"
title=
"
{{
title
}}
"
alt=
"
{{
alt
}}
"
>
</a>
{{/
adBanner
}}
</div>
...
...
Please
register
or
login
to post a comment