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
zhangxiaoru
9 years ago
Commit
16d15c67fbdd6842c14ccfad18bdf778f5375a63
1 parent
9a3113ad
brand
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
101 additions
and
24 deletions
apps/brand/views/partial/list.hbs
apps/editorial/models/editorial.js
apps/editorial/views/action/detail.hbs
public/js/brand/index.page.js
public/js/editorial/detail.page.js
public/scss/editorial/_article-related.css
public/scss/editorial/_detail.css
apps/brand/views/partial/list.hbs
View file @
16d15c6
{{#
each
category
}}
<dl
class=
"clearfix"
name=
"
{{
key
}}
"
>
<dt>
{{
key
}}
</dt>
<dt
class=
"brand-key"
>
{{
key
}}
</dt>
<dd
class=
"brand-tabs"
>
<ul
class=
"clearfix"
>
{{#
each
brands
}}
...
...
apps/editorial/models/editorial.js
View file @
16d15c6
...
...
@@ -245,6 +245,7 @@ const _getRelatedData = (idList) => {
const
_processContentData
=
(
list
)
=>
{
list
=
list
||
[];
list
=
camelCase
(
list
);
//console.log(list)
let
contentData
=
{
contents
:
[]
...
...
@@ -268,7 +269,7 @@ const _processContentData = (list) => {
let
idList
=
''
;
//
let recoLength = '';
let
recoLength
=
''
;
let
related
=
{
relatedReco
:
[],
relatedGroup
:
[]
...
...
@@ -283,11 +284,11 @@ const _processContentData = (list) => {
idList
+=
data
.
id
+
','
;
related
.
relatedReco
.
push
(
data
);
recoLength
=
recoLength
+
1
;
});
}
// recoLength = idList.length / 9;
if
(
value
.
goodsGroup
)
{
_
.
forEach
(
value
.
goodsGroup
.
data
,
function
(
data
)
{
...
...
@@ -308,8 +309,8 @@ const _processContentData = (list) => {
_
.
forEach
(
related
.
relatedReco
,
function
(
data
,
index
)
{
data
=
_
.
assign
(
data
,
result
[
index
]);
});
result
.
splice
(
0
,
recoLength
.
length
);
}
if
(
related
.
relatedGroup
)
{
...
...
@@ -329,7 +330,7 @@ const _processContentData = (list) => {
return
contentData
;
});
//console.log(contentData)
return
contentData
;
};
...
...
@@ -414,7 +415,7 @@ const _getRelateBrand = (id) => {
return
serviceAPI
.
get
(
'guang/service/v2/article/getBrand'
,
{
article_id
:
id
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
if
(
result
&&
result
.
code
===
200
)
{
_
.
forEach
(
result
.
data
,
function
(
data
)
{
let
domain
=
data
.
url
;
...
...
@@ -435,7 +436,7 @@ const _getArticlePre = (id) => {
id
:
id
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
console
.
log
(
result
);
//
console.log(result);
return
result
;
}
else
{
logger
.
error
(
'上一篇不是200'
);
...
...
@@ -566,7 +567,7 @@ const getDetailData = (id) => {
tags
:
res
.
tags
,
content
:
result
[
2
],
comment
:
result
[
3
],
brands
:
result
[
4
]
brands
:
result
[
5
]
};
})();
};
...
...
apps/editorial/views/action/detail.hbs
View file @
16d15c6
...
...
@@ -60,9 +60,6 @@
</div>
</div>
{{!-- {{#if relatedGroup}} --}}
<div
class=
"related-reco related-group"
>
<div
class=
"article-title"
>
<div
class=
"title-line"
></div>
...
...
@@ -77,6 +74,8 @@
{{#
relatedGroup
}}
{{>
related-goods
}}
{{/
relatedGroup
}}
<span
class=
"left iconfont"
>

</span>
<span
class=
"right iconfont"
>

</span>
</div>
</div>
{{/
related
}}
...
...
@@ -101,7 +100,7 @@
</a>
<p
class=
"brand-name"
>
{{
name
}}
</p>
</div>
{{/
brands
}}
{{/
brands
}}
</div>
</div>
{{/if}}
...
...
public/js/brand/index.page.js
View file @
16d15c6
...
...
@@ -20,13 +20,27 @@ lazyLoad($('.brand-page img.lazy'));
// 品牌类别滚动事件
$
(
window
).
scroll
(
function
()
{
var
navLength
=
$
(
'.category-nav'
).
find
(
'a'
).
length
+
1
;
if
(
$
(
this
).
scrollTop
()
>=
categoryTop
)
{
$gory
.
addClass
(
'category-fix'
);
}
else
{
$gory
.
removeClass
(
'category-fix'
);
}
});
$
(
'.brand-key'
).
each
(
function
(
i
,
ele
)
{
if
(
$
(
ele
).
parent
().
attr
(
'style'
))
{
return
;
}
if
(
$
(
ele
).
offset
().
top
-
$
(
window
).
scrollTop
()
<
100
)
{
var
key
=
$
(
ele
).
html
().
charAt
(
$
(
ele
).
html
().
length
-
1
);
$
(
'.category-nav'
).
find
(
'.'
+
key
).
css
(
'color'
,
'#379ed6'
).
siblings
().
css
(
'color'
,
'#222'
);
}
});
});
// 点击字母,页面滚动到相关区域
$category
.
click
(
function
()
{
...
...
public/js/editorial/detail.page.js
View file @
16d15c6
...
...
@@ -193,3 +193,9 @@ if ($('.collocation').find('.good-info').length === 0) {
if
(
$
(
'.goods'
).
find
(
'.good-info'
).
length
===
0
)
{
$
(
'.related-group'
).
hide
();
}
// $('.left').click(function {
// $('.goods').animate({ left: '+50px' }, "slow");
// })
// console.log($('.goods').offsetWidth()
\ No newline at end of file
...
...
public/scss/editorial/_article-related.css
View file @
16d15c6
.article-title
{
position
:
relative
;
text-align
:
center
;
margin-left
:
30px
;
width
:
933px
;
.title-line
{
border-bottom
:
1px
solid
#bbb
;
...
...
public/scss/editorial/_detail.css
View file @
16d15c6
.editorial-detail-page
{
width
:
9
4
0px
;
width
:
9
9
0px
;
.detail-body
{
width
:
9
36
px
;
width
:
9
90
px
;
margin
:
0
auto
;
overflow
:
hidden
;
/*overflow: hidden;*/
}
.detail-title
{
...
...
@@ -94,18 +94,57 @@
}
.related-reco
{
width
:
100
0px
;
width
:
99
0px
;
padding-top
:
30px
;
overflow
:
hidden
;
position
:
relative
;
.btn
{
position
:
relative
;
}
.left
{
position
:
absolute
;
display
:
block
;
width
:
30px
;
height
:
50px
;
left
:
0
;
top
:
200px
;
color
:
#fff
;
background
:
#ccc
;
text-align
:
center
;
line-height
:
50px
;
}
.left
:hover
{
background
:
#7f7f7f
;
}
.right
:hover
{
background
:
#7f7f7f
;
}
.right
{
position
:
absolute
;
display
:
block
;
width
:
30px
;
height
:
50px
;
right
:
0
;
top
:
200px
;
color
:
#fff
;
background
:
#ccc
;
text-align
:
center
;
line-height
:
50px
;
}
}
.related-goods
{
padding
-top
:
6
0px
;
padding
:
60px
0
0
3
0px
;
.good-info
{
width
:
219px
;
float
:
left
;
margin
:
0
20
px
15px
0
;
margin
:
0
18
px
15px
0
;
img
{
width
:
219px
;
...
...
@@ -120,6 +159,7 @@
display
:
block
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
text-align
:
center
;
}
.price
{
...
...
@@ -131,6 +171,11 @@
}
}
.goods
{
height
:
420px
;
overflow
:
hidden
;
}
.related-brand
{
margin-top
:
30px
;
...
...
@@ -138,8 +183,9 @@
.brands
{
width
:
950px
;
padding
:
30px
0
;
padding
:
30px
0
30px
30px
;
overflow
:
hidden
;
}
.brand
{
...
...
@@ -252,11 +298,12 @@
.article-tag
{
float
:
left
;
width
:
100%
;
width
:
940px
;
border-top
:
1px
solid
#eee
;
border-bottom
:
1px
solid
#eee
;
padding
:
20px
0
;
padding
:
20px
0
20px
10px
;
overflow
:
hidden
;
margin-left
:
30px
;
.tag-icon
{
float
:
left
;
...
...
@@ -302,7 +349,8 @@
line-height
:
25px
;
border
:
1px
solid
#fff
;
overflow
:
hidden
;
width
:
100%
;
width
:
940px
;
margin-left
:
30px
;
a
{
color
:
#afafaf
;
...
...
@@ -319,6 +367,8 @@
.comment-area
{
margin-top
:
58px
;
width
:
935px
;
margin-left
:
30px
;
.comment-publish
{
height
:
48px
;
...
...
@@ -467,4 +517,9 @@
display
:
block
;
}
}
.share
{
padding-left
:
30px
;
width
:
330px
;
}
}
...
...
Please
register
or
login
to post a comment