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
zzzzzzz
2016-11-02 17:34:34 +0800
Commit
979b5d9f8354c656c529ce9f6d36aae0b5a9f7b0
1 parent
74e9690d
部分接口
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
81 deletions
apps/channel/controllers/index.js
apps/channel/router.js
apps/channel/views/partial/channel/content.hbs
doraemon/views/partial/resources/shop-recommand.hbs
doraemon/views/partial/resources/vip-only.hbs
public/js/channel/home.page.js
utils/resources-process.js
apps/channel/controllers/index.js
View file @
979b5d9
...
...
@@ -150,6 +150,18 @@ let bottomBanner = (req, res, next) => {
}).
catch
(
next
);
};
/**
* 店铺推荐收藏状态人数
*/
let
shopRecom
=
(
req
,
res
,
next
)
=>
{
channelModel
.
shopRecom
({
shopIds
:
req
.
body
.
shopIds
||
''
,
uid
:
req
.
user
.
uid
||
0
,
}).
then
(
result
=>
{
res
.
send
(
result
);
}).
catch
(
next
);
}
module
.
exports
=
{
switchChannel
,
index
,
...
...
@@ -157,5 +169,6 @@ module.exports = {
girls
,
kids
,
lifestyle
,
bottomBanner
bottomBanner
,
shopRecom
,
};
...
...
apps/channel/router.js
View file @
979b5d9
...
...
@@ -29,4 +29,6 @@ router.post('/brands/searchAsync', brandController.searchAsync); // 品牌搜索
router
.
post
(
'/brands/addBrandSearch'
,
brandController
.
addBrandSearch
);
// 添加品牌搜索记录
router
.
get
(
'/brands/delBrandHistory'
,
brandController
.
delBrandHistory
);
// 删除品牌搜索记录
// 5.2新楼层功能
router
.
post
(
'/shopRecom'
,
channel
.
shopRecom
);
// 店铺推荐收藏状态
module
.
exports
=
router
;
...
...
apps/channel/views/partial/channel/content.hbs
View file @
979b5d9
...
...
@@ -72,16 +72,22 @@
{{#if
sixLinesFloor
}}
{{>
resources
/
six-lines-floor
}}
{{/if}}
{{! vip专属}}
{{#if
vipUse
}}
{{>
resources
/
vip-only
}}
{{/if}}
{{! 店铺推荐}}
{{#if
shopRecommend
}}
{{>
resources
/
shop-recommand
}}
{{/if}}
{{/
content
}}
{{! 新新人专享}}
{{>
resources
/
new-user-floor
}}
{{! 人气单品}}
{{>
resources
/
hot-single
}}
{{! vip专属}}
{{>
resources
/
vip-only
}}
{{! 新品首发楼层}}
{{>
resources
/
new-first
}}
{{! 店铺推荐}}
{{>
resources
/
shop-recommand
}}
{{! SALE}}
{{>
resources
/
sale-floor
}}
...
...
doraemon/views/partial/resources/shop-recommand.hbs
View file @
979b5d9
{{#
data
}}
<div
class=
"shop-recom"
>
{{
! title不传不显示
}}
{{
#if
title
}}
{{>
common
/
floor-header-more
}}
{{/if}}
<div
class=
"shop-recom-container shop-recom-swiper-container"
>
<ul
class=
"swiper-wrapper"
>
<li
class=
"swiper-slide recom-shop"
>
<div
class=
"fav-container"
>
<div
class=
"shop-fav"
></div><span>
已收藏
</span>
</div>
<span
class=
"faved-num"
>
1234人以收藏
</span>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90"
alt=
"banner"
class=
"top"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"left"
class=
"bottom"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"right"
class=
"bottom"
>
</li>
<li
class=
"swiper-slide recom-shop"
>
<div
class=
"fav-container"
>
{{#
list
}}
<li
class=
"swiper-slide recom-shop"
shopId=
{{
shopId
}}
>
<div
class=
"fav-container fav-no"
>
<div
class=
"shop-notfav"
></div><span>
收藏
</span>
</div>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90"
alt=
"banner"
class=
"top"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"left"
class=
"bottom"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"right"
class=
"bottom"
>
</li>
<li
class=
"swiper-slide recom-shop"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90"
alt=
"banner"
class=
"top"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"left"
class=
"bottom"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"right"
class=
"bottom"
>
</li>
<li
class=
"swiper-slide recom-shop"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90"
alt=
"banner"
class=
"top"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"left"
class=
"bottom"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"right"
class=
"bottom"
>
</li>
<li
class=
"swiper-slide recom-shop"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90"
alt=
"banner"
class=
"top"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"left"
class=
"bottom"
>
<img
src=
"//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90"
alt=
"right"
class=
"bottom"
>
<div
class=
"fav-container fav-yes"
style=
"display:none"
>
<div
class=
"shop-fav"
></div><span>
已收藏
</span>
</div>
<span
class=
"faved-num"
></span>
<a
href=
"
{{
url
}}
"
>
<img
src=
"
{{
image
src
640
208
}}
"
alt=
"banner"
class=
"top"
>
</a>
{{#
goods0
}}
<a
href=
"
{{
url
}}
"
>
<img
src=
"
{{
image
src
320
146
}}
"
alt=
"left"
class=
"bottom"
>
</a>
{{/
goods0
}}
{{#
goods1
}}
<a
href=
"
{{
url
}}
"
>
<img
src=
"
{{
image
src
320
146
}}
"
alt=
"right"
class=
"bottom"
>
</a>
{{/
goods1
}}
</li>
{{/
list
}}
</ul>
</div>
</div>
{{/
data
}}
\ No newline at end of file
...
...
doraemon/views/partial/resources/vip-only.hbs
View file @
979b5d9
{{#
data
}}
<div
class=
"vip-only"
>
{{>
common
/
floor-header-more
}}
<a>
<img
src=
""
alt=
"vip-only-banner"
class=
"vip-only-banner"
/>
{{#
banner_image
}}
<a
href=
"
{{
url
}}
"
>
<img
src=
"
{{
image
src
640
200
}}
"
alt=
"vip-only-banner"
class=
"vip-only-banner"
/>
</a>
<div
class=
"vip-only-goods-list"
style=
"background: #000013"
>
{{/
banner_image
}}
<div
class=
"vip-only-goods-list"
{{#
background
}}
style=
"background: url(
{{
src
}}
)"
{{/
background
}}
>
<ul>
{{#
list
}}
<a
href=
"//m.yohobuy.com/product/show_
{{
product_skn
}}
"
>
<li
class=
"vip-only-goods"
>
<img
src=
""
alt=
"goods"
class=
"goods-pic"
>
<img
src=
"
{{
image
default_images
153
206
}}
"
alt=
"goods"
class=
"goods-pic"
>
<div
class=
"goods-info"
>
<h3
class=
"vip-price"
>
¥
3988.00
</h3>
<p
class=
"sale-price"
>
¥
9999.00
<span
class=
"vip-icon"
></span></p>
</div>
</li>
<li
class=
"vip-only-goods"
>
<img
src=
""
alt=
"goods"
class=
"goods-pic"
>
<div
class=
"goods-info"
>
<h3
class=
"vip-price"
>
¥
3988.00
</h3>
<p
class=
"sale-price"
>
¥
9999.00
<span
class=
"vip-icon"
></span></p>
</div>
</li>
<li
class=
"vip-only-goods"
>
<img
src=
""
alt=
"goods"
class=
"goods-pic"
>
<div
class=
"goods-info"
>
<h3
class=
"vip-price"
>
¥
3988.00
</h3>
<p
class=
"sale-price"
>
¥
9999.00
<span
class=
"vip-icon"
></span></p>
</div>
</li>
<li
class=
"vip-only-goods"
>
<img
src=
""
alt=
"goods"
class=
"goods-pic"
>
<div
class=
"goods-info"
>
<h3
class=
"vip-price"
>
¥
3988.00
</h3>
<p
class=
"sale-price"
>
¥
9999.00
<span
class=
"vip-icon"
></span></p>
</div>
</li>
<li
class=
"vip-only-goods"
>
<img
src=
""
alt=
"goods"
class=
"goods-pic"
>
<div
class=
"goods-info"
>
<h3
class=
"vip-price"
>
¥
3988.00
</h3>
<p
class=
"sale-price"
>
¥
9999.00
<span
class=
"vip-icon"
></span></p>
</div>
</li>
<li
class=
"vip-only-goods"
>
<img
src=
""
alt=
"goods"
class=
"goods-pic"
>
<div
class=
"goods-info"
>
<h3
class=
"vip-price"
>
¥
3988.00
</h3>
<p
class=
"sale-price"
>
¥
9999.00
<span
class=
"vip-icon"
></span></p>
<h3
class=
"vip-price"
>
¥
{{
vip1_price
}}
</h3>
<p
class=
"sale-price"
>
¥
{{
market_price
}}
<span
class=
"vip-icon"
></span></p>
</div>
</li>
</a>
{{/
list
}}
</ul>
</div>
</div>
{{/
data
}}
\ No newline at end of file
...
...
public/js/channel/home.page.js
View file @
979b5d9
...
...
@@ -235,4 +235,32 @@ var shopSwiper = new Swiper('.shop-recom-swiper-container', {
paginationClickable
:
true
,
slideActiveClass
:
'recom-active'
,
});
// 店铺推荐人数和收藏初始查询
var
checkShop
=
function
()
{
var
shopIds
=
[];
$
(
'.recom-shop'
).
each
(
function
()
{
shopIds
.
push
(
$
(
this
).
attr
(
'shopId'
));
});
$
.
ajax
({
type
:
'POST'
,
url
:
'/shopRecom'
,
data
:
{
shopIds
:
shopIds
.
join
(
','
),
},
}).
then
(
function
(
result
)
{
if
(
result
.
code
===
200
)
{
for
(
var
i
=
0
,
elem
;
(
elem
=
result
.
data
[
i
])
!=
null
;
i
++
)
{
var
a
=
$
(
'.recom-shop[shopId = '
+
elem
.
id
+
']'
);
a
.
find
(
'.faved-num'
).
text
(
elem
.
collectionNum
+
"人已收藏"
);
if
(
elem
.
favorite
)
{
a
.
find
(
'.fav-no'
).
hide
();
a
.
find
(
'.fav-yes'
).
show
();
}
}
}
});
}
checkShop
();
require
(
'./maybe-like'
)();
...
...
utils/resources-process.js
View file @
979b5d9
'use strict'
;
const
_
=
require
(
'lodash'
);
const
processTime
=
require
(
'./time-process'
);
...
...
@@ -73,6 +75,13 @@ module.exports = (list) => {
floor
.
data
.
length
===
1
&&
(
floor
.
singleOne
=
true
);
// vip专享
if
(
floor
.
vipUse
&&
floor
.
data
&&
floor
.
data
.
background
)
{
let
a
=
floor
.
data
.
background
.
src
;
a
=
a
.
substr
(
0
,
a
.
indexOf
(
'?'
));
floor
.
data
.
background
.
src
=
a
;
}
formatData
.
push
(
floor
);
});
...
...
Please
register
or
login
to post a comment