Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
4153e649214b81567ee19aab30c8538d3b6f2921
2 parents
9d0494cc
fdb83261
Merge branch 'feature/promotion-list' into gray
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
5 deletions
apps/product/controllers/list.js
apps/product/models/detail-service.js
doraemon/views/partial/product/standard-content.hbs
public/scss/product/_detail.css
public/scss/product/_list.css
apps/product/controllers/list.js
View file @
4153e64
...
...
@@ -92,6 +92,12 @@ exports.index = (req, res, next) => {
if
(
_
.
isEmpty
(
_
.
get
(
resData
,
'list.goods'
,
[])))
{
res
.
set
(
'Cache-Control'
,
'no-cache'
);
}
// 商品详情页跳转过来带参数
if
(
req
.
query
.
phrase
)
{
resData
.
list
.
phrase
=
decodeURIComponent
(
req
.
query
.
phrase
);
}
res
.
render
(
'list/index'
,
resData
);
}).
catch
(
next
);
};
...
...
apps/product/models/detail-service.js
View file @
4153e64
...
...
@@ -214,11 +214,15 @@ const _getBundleAsync = (result) => {
};
const
_getActivityDataByProductBaseInfo
=
(
data
)
=>
{
return
_
.
get
(
data
,
'data'
,
[]).
map
(
value
=>
({
type
:
value
.
promotionType
.
replace
(
/¥/g
,
'¥'
),
des
:
value
.
promotionTitle
.
replace
(
/¥/g
,
'¥'
),
url
:
value
.
id
&&
helpers
.
urlFormat
(
''
,
{
psp_id
:
value
.
id
},
'list'
)
}));
return
_
.
get
(
data
,
'data'
,
[]).
map
(
value
=>
{
let
des
=
value
.
promotionTitle
.
replace
(
/¥/g
,
'¥'
);
return
{
type
:
value
.
promotionType
.
replace
(
/¥/g
,
'¥'
),
des
:
des
,
url
:
value
.
id
&&
helpers
.
urlFormat
(
''
,
{
psp_id
:
value
.
id
,
phrase
:
encodeURIComponent
(
des
)},
'list'
)
};
});
};
/**
...
...
doraemon/views/partial/product/standard-content.hbs
View file @
4153e64
...
...
@@ -3,6 +3,12 @@
{{>
product
/
filter-box
}}
{{/
filters
}}
{{#if
phrase
}}
<div
class=
"phrase"
>
以下商品参加
{{
phrase
}}
</div>
{{/if}}
{{#
opts
}}
<div
class=
"sort-pager"
>
{{#
sortType
}}
...
...
public/scss/product/_detail.css
View file @
4153e64
...
...
@@ -1371,6 +1371,7 @@
img
{
max-width
:
100%
;
margin-bottom
:
10px
;
}
.img-responsive
{
...
...
public/scss/product/_list.css
View file @
4153e64
...
...
@@ -15,6 +15,13 @@
width
:
970px
;
}
.phrase
{
text-align
:
center
;
font-size
:
18px
;
height
:
50px
;
line-height
:
50px
;
}
.brand-banner
{
position
:
relative
;
...
...
Please
register
or
login
to post a comment