Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
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
郝肖肖
7 years ago
Commit
cbf818953f67b0a0389637f72ed06e7937bbb6ea
1 parent
f568aff7
'news-image-http'
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
21 deletions
apps/news/views/partial/news-index/info.hbs
package-lock.json
public/js/news/news-index/view.js
public/scss/news/_info.css
apps/news/views/partial/news-index/info.hbs
View file @
cbf8189
<div
class=
"news-info"
data-id=
"
{{
id
}}
"
>
{{#
author
}}
<a
class=
"info-author clearfix"
{{#if
url
}}
href=
"
{{
url
}}
"
{{/if}}
>
<img
class=
"lazy avatar"
data-original=
"
{{
image2
avatar
mode
=
2
q
=
60
}}
"
>
<img
class=
"lazy avatar"
data-original=
"
http:
{{
image2
avatar
mode
=
2
q
=
60
}}
"
>
<span
class=
"name"
>
{{
name
}}
</span>
{{#if
minCategory
}}
<span
class=
"min-tag"
>
#
{{
minCategory
}}
</span>
...
...
@@ -48,9 +48,9 @@
{{/if}}
<a
class=
"img-box"
{{#
unless
isShow
}}
href=
"
{{
url
}}
"
{{/
unless
}}
>
{{#if
@first
}}
<img
src=
"
{{
image2
img
q
=
60
}}
"
alt=
"
{{
alt
}}
"
>
<img
src=
"
http:
{{
image2
img
q
=
60
}}
"
alt=
"
{{
alt
}}
"
>
{{^}}
<img
class=
"lazy"
data-original=
"
{{
image2
img
q
=
60
}}
"
alt=
"
{{
alt
}}
"
>
<img
class=
"lazy"
data-original=
"
http:
{{
image2
img
q
=
60
}}
"
alt=
"
{{
alt
}}
"
>
{{/if}}
{{#if
isVideo
}}
<div
class=
"play"
></div>
...
...
@@ -60,9 +60,9 @@
<div
class=
"info-deps"
>
<a
class=
"info-title-container"
{{#
unless
isShow
}}
href=
"
{{
url
}}
"
{{/
unless
}}
>
<div
class=
"info-title"
>
{{#if
top
}}
<span
class=
"top-tag"
>
置顶
</span>
{{/if}}{{
title
}}
</div>
<div
class=
"info-title
ellipsis-line
"
>
{{#if
top
}}
<span
class=
"top-tag"
>
置顶
</span>
{{/if}}{{
title
}}
</div>
</a>
<p
class=
"info-text"
>
{{
text
}}
</p>
<p
class=
"info-text
ellipsis-line
"
>
{{
text
}}
</p>
{{>
news-index
/
tvls
}}
</div>
...
...
package-lock.json
deleted
100644 → 0
View file @
f568aff
This diff could not be displayed because it is too large.
public/js/news/news-index/view.js
View file @
cbf8189
...
...
@@ -35,10 +35,8 @@ export class IndexView extends View {
}];
// srcoll to load more
$
(
document
).
scroll
(
function
()
{
window
.
requestAnimationFrame
(
function
()
{
that
.
scrollHandler
.
apply
(
that
,
[]);
});
$
(
document
).
scroll
(()
=>
{
window
.
requestAnimationFrame
(
this
.
scrollHandler
.
bind
(
this
));
});
this
.
setLazyLoadAndMellipsis
(
this
.
selector
.
$infoList
.
children
(
'.info-list'
).
not
(
'.hide'
).
find
(
'.news-info'
));
...
...
@@ -56,7 +54,7 @@ export class IndexView extends View {
let
that
=
this
;
if
(
that
.
selector
.
searching
||
that
.
navState
[
index
].
end
)
{
return
;
return
false
;
}
that
.
selector
.
searching
=
true
;
...
...
@@ -81,26 +79,18 @@ export class IndexView extends View {
let
$dataHtml
=
$
(
rdata
);
$container
.
append
(
$dataHtml
);
that
.
setLazyLoadAndMellipsis
(
$dataHtml
.
siblings
(
'.news-info'
));
that
.
setLazyLoadAndMellipsis
(
$container
.
find
(
'.news-info:not(.lazy-ms)'
));
that
.
navState
[
index
].
page
++
;
that
.
selector
.
searching
=
false
;
}).
catch
(()
=>
{
that
.
selector
.
searching
=
false
;
});
}
setLazyLoadAndMellipsis
(
$infos
)
{
$infos
.
addClass
(
'lazy-ms'
);
lazyLoad
(
$infos
.
find
(
'img.lazy'
));
$infos
.
each
(
function
()
{
let
$this
=
$
(
this
),
$title
=
$this
.
find
(
'.info-title'
),
$text
=
$this
.
find
(
'.info-text'
);
$title
[
0
].
mlellipsis
(
2
);
$text
[
0
].
mlellipsis
(
2
);
});
}
}
...
...
public/scss/news/_info.css
View file @
cbf8189
...
...
@@ -120,6 +120,14 @@
margin
:
32px
0
0
;
padding
:
0
40px
0
30px
;
.ellipsis-line
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
}
.info-title-container
{
text-decoration
:
none
;
color
:
#000
;
...
...
@@ -146,6 +154,7 @@
line-height
:
46px
;
font-size
:
14
PX
;
color
:
#444
;
-webkit-line-clamp
:
4
;
}
.time-view-like-share
{
...
...
Please
register
or
login
to post a comment