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
yyq
9 years ago
Commit
616991c387b804c7773694162dbbd4da61f81f17
1 parent
3f19007c
品牌介绍弹窗
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
2 deletions
apps/product/models/item-handler.js
apps/product/views/action/item.hbs
public/js/product/item.page.js
public/scss/product/_item.css
apps/product/models/item-handler.js
View file @
616991c
...
...
@@ -498,13 +498,14 @@ const setBrandIntro = brand => {
if
(
brand
)
{
let
text
=
_
.
replace
(
brand
.
brandIntro
,
/<
\/?[^
>
]
*>|
\s
*|
(\n)
|
(\t)
|
(\r)
/g
,
''
),
more
=
`
...
<
a
href
=
"
/product/shop/${brand.brandDomain}?brandIntro=true"
class
=
"
blue"
>
了解更多
>><
/a>`
;
more
=
`
...
<
a
href
=
"
javascript:;"
class
=
"more-brand-intro
blue"
>
了解更多
>><
/a>`
;
barndIntro
=
{
brand
:
{
titleEn
:
'BRAND'
,
titleCn
:
'品牌介绍'
,
logo
:
brand
.
brandIco
,
fullIntro
:
brand
.
brandIntro
,
intro
:
_
.
truncate
(
text
,
{
length
:
300
,
omission
:
more
...
...
apps/product/views/action/item.hbs
View file @
616991c
...
...
@@ -175,6 +175,17 @@
<img
src=
"
{{
image
logo
250
84
}}
"
>
<div
class=
"intro-text"
>
{{{
intro
}}}
</div>
</div>
<div
id=
"intro-full-hide"
class=
"hide"
>
<div
class=
"full-intro-title"
>
<h2>
{{
titleEn
}}
</h2>
<h5>
{{
titleCn
}}
</h5>
</div>
<div
class=
"full-intro-text nano"
>
<div
class=
"nano-content"
>
{{{
fullIntro
}}}
</div>
</div>
</div>
</div>
{{/
brand
}}
...
...
public/js/product/item.page.js
View file @
616991c
...
...
@@ -36,8 +36,10 @@ var noticeFn = handlebars.compile($('#arrival-notice-tpl').html() || ''),
noticeSuccFn
=
handlebars
.
compile
(
$
(
'#arrival-notice-success-tpl'
).
html
()
||
''
);
var
thumbsLoaded
=
[],
id
=
$main
.
data
(
'id'
);
id
=
$main
.
data
(
'id'
),
introHtml
;
require
(
'yoho-jquery-nanoscroller'
);
require
(
'../plugins/share'
);
require
(
'../common/header'
);
require
(
'../common/return-top'
);
...
...
@@ -324,6 +326,15 @@ $('#collect-product').click(function() {
});
});
$
(
'.more-brand-intro'
).
click
(
function
()
{
new
Dialog
({
className
:
'item-more-intro-dialog'
,
content
:
introHtml
,
btns
:
[]
}).
show
();
$
(
'.full-intro-text'
).
nanoScroller
();
});
$sizeInfo
.
on
(
'click'
,
'.show-img'
,
function
()
{
var
img
=
$sizeInfo
.
data
(
'img'
);
...
...
@@ -334,4 +345,10 @@ $sizeInfo.on('click', '.show-img', function() {
}).
show
();
});
if
(
$
(
window
).
height
()
<
800
)
{
$
(
'.full-intro-text'
).
addClass
(
'min-height'
);
}
introHtml
=
$
(
'#intro-full-hide'
).
html
();
chooseDefaultSize
();
// 如果size只有一个则默认选中
...
...
public/scss/product/_item.css
View file @
616991c
...
...
@@ -523,3 +523,35 @@
width
:
600px
;
}
}
.item-more-intro-dialog
{
.content
{
width
:
850px
;
text-align
:
left
;
}
.full-intro-title
{
margin
:
0
0
50px
;
h2
{
font-size
:
18px
;
font-weight
:
700
;
padding
:
10px
0
;
}
}
.full-intro-text
{
height
:
500px
;
font-size
:
14px
!important
;
line-height
:
1.5
;
overflow-x
:
hidden
;
.nano-content
{
padding
:
0
4px
;
}
}
.min-height
{
height
:
250px
;
}
}
...
...
Please
register
or
login
to post a comment