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
姜枫
9 years ago
Commit
15503503a4e8b8d46df76b8de70e0a89784a69a4
1 parent
ba7cb364
fix bugs
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
20 deletions
apps/product/models/helpers.js
apps/product/models/shop-service.js
apps/product/views/action/shop-index.hbs
apps/product/views/partial/list/shop-sort.hbs
public/scss/product/_shop.css
apps/product/models/helpers.js
View file @
1550350
...
...
@@ -247,6 +247,16 @@ const helpers = {
}
sorts
=
sorts
[
0
].
sub
;
}
else
if
(
sorts
&&
sorts
.
length
>
1
){
_
.
forEach
(
sorts
,
s
=>
{
_
.
forEach
(
s
.
sub
,
ss
=>
{
if
(
q
.
misort
&&
q
.
misort
===
ss
.
categoryId
)
{
ss
.
checked
=
true
;
s
.
checked
=
true
;
}
});
});
}
let
matchPrice
=
false
;
...
...
apps/product/models/shop-service.js
View file @
1550350
...
...
@@ -12,6 +12,7 @@ const co = Promise.coroutine;
const
camelCase
=
global
.
yoho
.
camelCase
;
const
BrandService
=
require
(
'./brand-service'
);
const
ShopApi
=
require
(
'./shop-api'
);
const
Search
=
require
(
'../models/search'
);
const
_
=
require
(
'lodash'
);
/**
...
...
@@ -90,19 +91,27 @@ const ShopService = {
* 获取店铺二级分类
* @param shopId
*/
getShopSecondSorts
(
shopId
)
{
getShopSecondSorts
(
brandId
,
shopId
)
{
return
co
(
function
*
()
{
let
data
=
yield
ShopApi
.
getShopSorts
(
shopId
);
if
(
data
&&
data
.
code
===
200
)
{
let
sorts
=
camelCase
(
data
.
data
);
let
data
=
yield
Search
.
queryAllSort
({
brand
:
brandId
,
shop
:
shopId
,
small_sort
:
0
});
let
sortArray
=
[];
if
(
data
&&
data
.
data
)
{
let
sorts
=
camelCase
(
data
.
data
.
sort
);
sorts
.
forEach
(
s
=>
{
sortArray
=
sortArray
.
concat
(
s
.
sub
);
});
return
sorts
.
sort
((
a
,
b
)
=>
{
return
a
.
sub
.
length
>=
b
.
sub
.
length
;
sortArray
=
sortArray
.
sort
((
s1
,
s2
)
=>
{
return
s2
.
count
-
s1
.
count
;
});
}
else
{
return
[];
}
return
sortArray
;
})();
},
...
...
@@ -130,7 +139,7 @@ const ShopService = {
info
.
isFavorite
=
shopIntro
.
isFavorite
===
'Y'
;
let
shopData
=
yield
Promise
.
all
([
ShopService
.
getShopDecorator
(
shopId
),
ShopService
.
getShopSecondSorts
(
shopId
)]);
ShopService
.
getShopSecondSorts
(
domainInfo
.
id
,
shopId
)]);
let
shopList
=
shopData
[
0
];
let
sorts
=
shopData
[
1
];
let
resources
=
resourceDataHandle
(
shopList
.
list
);
...
...
apps/product/views/action/shop-index.hbs
View file @
1550350
...
...
@@ -36,7 +36,7 @@
<div
class=
"floor-header clearfix"
>
<h2
class=
"floor-title en-size"
>
NEW ARRIVALS
</h2>
<p
class=
"floor-title zh-size"
>
最新上架
</p>
<a
class=
"floor-more"
href=
"
{{
@root
.
mores
.
new
.
href
}}
"
>
MORE
</a>
<a
class=
"floor-more"
href=
"
{{
@root
.
mores
.
new
.
url
}}
"
>
MORE
</a>
</div>
<div
class=
"goods-wrap"
>
...
...
@@ -60,7 +60,7 @@
<div
class=
"floor-header clearfix"
>
<h2
class=
"floor-title en-size"
>
HOT
</h2>
<p
class=
"floor-title zh-size"
>
人气单品
</p>
<a
class=
"floor-more"
href=
"
{{
@root
.
mores
.
hot
.
href
}}
"
>
MORE
</a>
<a
class=
"floor-more"
href=
"
{{
@root
.
mores
.
hot
.
url
}}
"
>
MORE
</a>
</div>
<div
class=
"goods-wrap"
>
...
...
@@ -69,6 +69,7 @@
<a
href=
"/product/pro_
{{
productId
}}
_
{{
goodsId
}}
/
{{
cnAlphabet
}}
.html"
target=
"_blank"
>
<img
class=
"lazy thumb"
data-original=
"
{{
src
}}
"
style=
"display: block;"
>
</a>
<div
class=
"desc-cover"
></div>
<div
class=
"desc"
>
<a
class=
"name"
href=
""
target=
"_blank"
>
{{
productName
}}
</a>
<p
class=
"price"
>
¥
{{
round
salesPrice
2
}}
</p>
...
...
apps/product/views/partial/list/shop-sort.hbs
View file @
1550350
<div
class=
"shop-sort"
>
<div
class=
"all"
>
所有商品
</div>
<div
class=
"sort-list"
>
<div><a
href=
"
{{
@root
.
mores
.
all
.
href
}}
?gender=2,3"
>
女装
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
href
}}
?gender=1,3"
>
男装
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=2,3"
>
女装
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=1,3"
>
男装
</a></div>
{{#
each
banner
.
sorts
}}
<div><a
href=
"
{{
@root
.
mores
.
all
.
href
}}
?sort=
{{
relationParameter
.
sort
}}
"
>
{{
category
Name
}}
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?misort=
{{
sortId
}}
"
>
{{
sort
Name
}}
</a></div>
{{/
each
}}
</div>
<div
class=
"more"
><a
href=
"
{{
@root
.
mores
.
all
.
href
}}
"
>
MORE
</a></div>
<div
class=
"more"
><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
"
>
MORE
</a></div>
</div>
...
...
public/scss/product/_shop.css
View file @
1550350
...
...
@@ -131,17 +131,30 @@
display
:
inline-block
;
width
:
369px
;
height
:
495px
;
margin
:
0
9px
;
margin
:
10px
9px
;
border-width
:
1px
;
.desc
{
img
{
height
:
495px
;
}
.desc-cover
{
position
:
absolute
;
bottom
:
0
;
width
:
100%
;
background-color
:
#000
;
opacity
:
0.6
;
padding
:
20px
0
;
opacity
:
0.2
;
height
:
100px
;
z-index
:
1
;
}
.desc
{
position
:
absolute
;
bottom
:
0
;
width
:
100%
;
padding
:
17px
0
;
color
:
#fff
;
z-index
:
2
;
}
}
...
...
Please
register
or
login
to post a comment