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
Plain Diff
Browse Files
Authored by
毕凯
8 years ago
Commit
db38e73613a52cf79eb574ad0794754cc0a94b2b
2 parents
38b1ca84
4df990c6
Merge branch 'feature/imgq' into 'master'
活动图片质量调整 See merge request
!610
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
12 deletions
apps/activity/views/action/feature/index.hbs
utils/helpers.js
apps/activity/views/action/feature/index.hbs
View file @
db38e73
...
...
@@ -22,9 +22,9 @@
style=
"
{{#if
param
.
bgcolor
}}
background-color:
{{
param
.
bgcolor
}}{{/if}}
"
>
{{#if
param
.
bgimg
}}
{{#
isLazyLoad
type
@index
}}
<img
class=
"lazy"
data-original=
"
{{
image
2
param
.
bgimg
q
=
75
}}
"
>
<img
class=
"lazy"
data-original=
"
{{
image
slim
param
.
bgimg
}}
"
>
{{else}}
<img
src=
"
{{
image
2
param
.
bgimg
q
=
75
}}
"
>
<img
src=
"
{{
image
slim
param
.
bgimg
}}
"
>
{{/
isLazyLoad
}}
{{/if}}
{{#
component
}}
...
...
@@ -34,7 +34,7 @@
{{#if
modalImg
}}
<div
class=
"modal"
>
<span
class=
"modal-close"
></span>
<img
class=
"modal-img lazy"
data-original=
"
{{
image
2
modalImg
q
=
75
}}
"
>
<img
class=
"modal-img lazy"
data-original=
"
{{
image
slim
modalImg
}}
"
>
</div>
{{/if}}
{{/
isEqualOr
}}
...
...
@@ -66,7 +66,7 @@
<div
class=
"swiper-wrapper"
>
{{#
list
}}
<div
class=
"swiper-slide"
style=
"
{{
styleFormat
this
percent
=
1
}}
"
>
<img
src=
"
{{
image
2
src
q
=
75
}}
"
>
<img
src=
"
{{
image
slim
src
}}
"
>
<a
class=
"anchor"
href=
"
{{#if
link
}}{{
link
}}{{else}}
javascript:void(0);
{{/if}}
"
fp=
"
{{
getAnalysis
..
/
..
/
this
@index
}}
"
></a>
</div>
{{/
list
}}
...
...
@@ -88,7 +88,7 @@
{{#
isEqualOr
type
'productGroup'
}}
{{! 商品池}}
<div
class=
"product-container item
{{
numOfOneRow
}}
"
{{#if
proBgImg
}}
style=
"background:url(
{{
image
2
proBgImg
q
=
75
}}
) repeat;background-size:100%;"
{{/if}}
>
<div
class=
"product-container item
{{
numOfOneRow
}}
"
{{#if
proBgImg
}}
style=
"background:url(
{{
image
slim
proBgImg
}}
) repeat;background-size:100%;"
{{/if}}
>
<div
class=
"product-source"
condition=
'
{{
stringify
searchCondition
}}
'
fp=
"
{{
getAnalysis
..
/
this
@index
}}
"
{{#
unless
defaultPros
.
length
}}
{{#if
searchCondition
.
item
}}
...
...
@@ -103,9 +103,9 @@
<div
class=
"feature-product-info
{{#if
..
/
searchCondition
}}
novisible
{{/if}}
"
>
<a
class=
"first-part product-detail"
href=
'
{{
producturl
}}
'
>
<div
class=
"product-detail-imgbox"
>
{{#if
..
/
lefTopImg
}}
<img
class=
"leftopimg lazy"
data-original=
"
{{
image2
..
/
lefTopImg
q
=
75
}}
"
>
{{/if}}
{{#if
..
/
rigTopImg
}}
<img
class=
"rigtopimg lazy"
data-original=
"
{{
image2
..
/
rigTopImg
q
=
75
}}
"
>
{{/if}}
<img
class=
"product-detail-img lazy"
data-original=
"
{{
image2
productimg
q
=
75
}}
"
>
{{#if
..
/
lefTopImg
}}
<img
class=
"leftopimg lazy"
data-original=
"
{{
imageslim
..
/
lefTopImg
}}
"
>
{{/if}}
{{#if
..
/
rigTopImg
}}
<img
class=
"rigtopimg lazy"
data-original=
"
{{
imageslim
..
/
rigTopImg
}}
"
>
{{/if}}
<img
class=
"product-detail-img lazy"
data-original=
"
{{
imageslim
productimg
}}
"
>
</div>
{{#
isEqualOr
..
/
showPrdName
'1'
}}
<p
class=
"product-name"
>
{{
productname
}}
</p>
{{/
isEqualOr
}}
<div
class=
"product-detail-text"
>
...
...
@@ -128,7 +128,7 @@
<div
class=
"brand-div"
>
<span
class=
"brand-name"
{{#if
..
/
fontColor
}}
style=
"color:
{{
..
/
fontColor
}}
;"
{{/if}}
>
{{
brandname
}}
</span>
</div>
<img
class=
"brand-img lazy"
data-original=
"
{{
image
2
..
/
brandImg
q
=
75
}}
"
>
<img
class=
"brand-img lazy"
data-original=
"
{{
image
slim
..
/
brandImg
}}
"
>
</a>
{{/if}}
</div>
...
...
@@ -137,8 +137,8 @@
<div
class=
"feature-product-info novisible"
>
<a
class=
"first-part product-detail"
href=
''
>
<div
class=
"product-detail-imgbox"
>
{{#if
lefTopImg
}}
<img
class=
"leftopimg"
src=
"
{{
image2
lefTopImg
q
=
75
}}
"
>
{{/if}}
{{#if
rigTopImg
}}
<img
class=
"rigtopimg"
src=
"
{{
image2
rigTopImg
q
=
75
}}
"
>
{{/if}}
{{#if
lefTopImg
}}
<img
class=
"leftopimg"
src=
"
{{
imageslim
lefTopImg
}}
"
>
{{/if}}
{{#if
rigTopImg
}}
<img
class=
"rigtopimg"
src=
"
{{
imageslim
rigTopImg
}}
"
>
{{/if}}
<img
class=
"product-detail-img"
src=
""
>
</div>
{{#
isEqualOr
showPrdName
'1'
}}
<p
class=
"product-name"
></p>
{{/
isEqualOr
}}
...
...
@@ -161,7 +161,7 @@
<div
class=
"brand-div"
>
<span
class=
"brand-name"
{{#if
fontColor
}}
style=
"color:
{{
fontColor
}}
;"
{{/if}}
></span>
</div>
<img
class=
"brand-img"
src=
"
{{
image
2
brandImg
q
=
75
}}
"
>
<img
class=
"brand-img"
src=
"
{{
image
slim
brandImg
}}
"
>
</a>
{{/if}}
</div>
...
...
utils/helpers.js
View file @
db38e73
...
...
@@ -143,6 +143,24 @@ module.exports = {
return
''
;
}
},
/**
* 图片质量调整
*/
imageslim
:
function
(
imageUrl
)
{
if
(
imageUrl
&&
_
.
isString
(
imageUrl
))
{
let
urls
=
imageUrl
.
split
(
'?'
);
let
uri
=
urls
[
0
];
if
(
uri
.
indexOf
(
'http:'
)
===
0
)
{
uri
=
uri
.
replace
(
'http:'
,
''
);
}
return
uri
+
'?imageslim'
;
}
else
{
return
''
;
}
},
isEqualOr
:
function
()
{
let
args
=
Array
.
prototype
.
slice
.
call
(
arguments
);
let
v1
=
args
[
0
];
...
...
Please
register
or
login
to post a comment