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
徐祁xuqi
8 years ago
Commit
4512366496ee7fef34d21e96b6a003415ad34d35
2 parents
30daf34f
c55d9ff2
master
...
baidu_ocpcapi
develop
feature/canbuy
feature/channelDataMap
feature/company-profile
feature/contact
feature/detail-link
feature/home-optimize
feature/overseas-edition
feature/payment
feature/pcurl
feature/reduce
feature/refactor_alert
feature/shoppingPay
feature/virtualOrder
hotfix/11
hotfix/cart
hotfix/changeappversion
hotfix/gift
hotfix/im
hotfix/link
hotfix/ocpc
hotfix/shop
hotfix/upload
hotfix/yohobi
release/6.9.0
release/6.9.2
2019-12-5
all
Merge branch 'feature/zookeeper' of
http://git.yoho.cn/fe/yohobuy-node
into feature/zookeeper
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
269 additions
and
206 deletions
apps/brands/views/action/brands/brands.hbs
apps/guang/controllers/index.js
apps/guang/models/index.js
apps/guang/views/action/guang/detail.hbs
apps/guang/views/partial/right-side.hbs
apps/product/views/action/product/detail.hbs
doraemon/views/partial/header.hbs
doraemon/views/partial/product/latest-walk.hbs
public/js/brands/brands.page.js
public/js/header.js
apps/brands/views/action/brands/brands.hbs
View file @
4512366
...
...
@@ -48,7 +48,7 @@
{{/
each
}}
</div>
</div>
<div
class=
"brands-list"
>
<div
class=
"brands-list"
data-ishover=
"
{{
@root
.
pc
.
brands
.
disBrandNameHover
}}
"
>
{{>
brand-list
}}
</div>
{{/
brands
}}
...
...
apps/guang/controllers/index.js
View file @
4512366
...
...
@@ -26,13 +26,15 @@ exports.index = (req, res, next) => {
let
uid
=
req
.
user
.
uid
;
let
udid
=
ghelper
.
getUdid
(
req
,
res
);
let
gender
=
ghelper
.
getGenderByCookie
(
req
);
let
isHotDegrade
=
_
.
get
(
req
.
app
.
locals
.
pc
,
'guang.removeHotTag'
,
false
);
let
isAdDegrade
=
_
.
get
(
req
.
app
.
locals
.
pc
,
'guang.removeAd'
,
false
);
Promise
.
all
([
guangModel
.
getBanner
(
channel
),
guangModel
.
getCategory
(
type
,
channel
),
guangModel
.
getArticleList
(
gender
,
type
,
uid
,
udid
,
page
,
''
,
''
,
pageSize
,
channel
,
true
),
guangModel
.
getHotTags
(
page
,
pageSize
,
channel
),
guangModel
.
getAds
(
channel
),
guangModel
.
getHotTags
(
page
,
pageSize
,
channel
,
isHotDegrade
),
guangModel
.
getAds
(
channel
,
isAdDegrade
),
guangModel
.
getRecoArticles
(
gender
,
1
,
10
,
channel
),
headerModel
.
requestHeaderData
(
channel
)
]).
then
(
ret
=>
{
...
...
@@ -77,13 +79,15 @@ exports.tags = (req, res, next) => {
let
gender
=
ghelper
.
getGenderByCookie
(
req
);
let
channel
=
req
.
yoho
.
channel
;
let
pathNav
=
guangModel
.
getPathNav
(
channel
,
query
);
let
isHotDegrade
=
_
.
get
(
req
.
app
.
locals
.
pc
,
'guang.removeHotTag'
,
false
);
let
isAdDegrade
=
_
.
get
(
req
.
app
.
locals
.
pc
,
'guang.removeAd'
,
false
);
Promise
.
all
([
guangModel
.
getBanner
(
channel
),
guangModel
.
getArticleList
(
gender
,
0
,
uid
,
udid
,
page
,
query
,
''
,
pageSize
,
channel
,
true
),
guangModel
.
getHotTags
(
1
,
20
,
channel
),
guangModel
.
getAds
(
channel
),
guangModel
.
getHotTags
(
1
,
20
,
channel
,
isHotDegrade
),
guangModel
.
getAds
(
channel
,
isAdDegrade
),
guangModel
.
getRecoArticles
(
gender
,
1
,
10
,
channel
),
headerModel
.
requestHeaderData
(
channel
)
]).
then
(
ret
=>
{
...
...
@@ -121,6 +125,8 @@ exports.editor = (req, res, next) => {
let
authorId
=
req
.
query
.
author_id
;
let
channel
=
req
.
yoho
.
channel
;
let
gender
=
ghelper
.
getGenderByCookie
(
req
);
let
isHotDegrade
=
_
.
get
(
req
.
app
.
locals
.
pc
,
'guang.removeHotTag'
,
false
);
let
isAdDegrade
=
_
.
get
(
req
.
app
.
locals
.
pc
,
'guang.removeAd'
,
false
);
let
uid
=
req
.
user
.
uid
;
let
udid
=
ghelper
.
getUdid
(
req
,
res
);
...
...
@@ -133,8 +139,8 @@ exports.editor = (req, res, next) => {
Promise
.
all
([
guangModel
.
getAuthor
(
authorId
),
guangModel
.
getArticleList
(
gender
,
null
,
uid
,
udid
,
page
,
''
,
authorId
,
pageSize
,
channel
,
true
),
guangModel
.
getHotTags
(
1
,
20
,
channel
),
guangModel
.
getAds
(
channel
),
guangModel
.
getHotTags
(
1
,
20
,
channel
,
isHotDegrade
),
guangModel
.
getAds
(
channel
,
isAdDegrade
),
guangModel
.
getRecoArticles
(
gender
,
1
,
10
,
channel
),
headerModel
.
requestHeaderData
(
channel
)
]).
then
(
ret
=>
{
...
...
@@ -175,6 +181,8 @@ exports.detail = (req, res, next) => {
let
udid
=
ghelper
.
getUdid
(
req
,
res
);
let
gender
=
ghelper
.
getGenderByCookie
(
req
);
let
channel
=
req
.
yoho
.
channel
;
let
isHotDegrade
=
_
.
get
(
req
.
app
.
locals
.
pc
,
'guang.removeHotTag'
,
false
);
let
isAdDegrade
=
_
.
get
(
req
.
app
.
locals
.
pc
,
'guang.removeAd'
,
false
);
if
(
!
_
.
isNumber
(
id
))
{
id
=
parseInt
(
id
);
...
...
@@ -212,12 +220,12 @@ exports.detail = (req, res, next) => {
let
promises
=
[
headerModel
.
requestHeaderData
(
channel
),
guangModel
.
getArticleContent
(
id
),
guangModel
.
getHotTags
(
1
,
20
,
channel
),
guangModel
.
getHotTags
(
1
,
20
,
channel
,
isHotDegrade
),
guangModel
.
getArticleComments
(
id
,
page
,
pageSize
),
guangModel
.
getArticleBaseInfo
(
id
,
uid
,
udid
),
guangModel
.
getArticleRelateBrand
(
id
),
guangModel
.
getRecoArticles
(
gender
,
1
,
10
,
channel
),
guangModel
.
getAds
(
channel
)
guangModel
.
getAds
(
channel
,
isAdDegrade
)
];
if
(
info
.
authorId
)
{
...
...
apps/guang/models/index.js
View file @
4512366
...
...
@@ -305,7 +305,7 @@ const getArticleList = (gender, sortId, uid, udid, page, tag, authorId, limit, c
* @param {String} type 传入频道页类型,值可以是: boys, girls, kids, lifestyle
* @return {Object}
*/
const
getHotTags
=
(
page
,
limit
,
channel
)
=>
{
const
getHotTags
=
(
page
,
limit
,
channel
,
isDegrade
)
=>
{
let
data
=
{
client_type
:
'web'
,
...
...
@@ -313,6 +313,10 @@ const getHotTags = (page, limit, channel) => {
limit
:
limit
||
10
};
if
(
isDegrade
)
{
return
null
;
}
return
serviceApi
.
get
(
'guang/api/v2/article/getTagTop'
,
data
,
{
cache
:
true
}).
then
(
res
=>
{
...
...
@@ -338,10 +342,14 @@ const getHotTags = (page, limit, channel) => {
* @param {String} channelType 传入频道页类型,值可以是: boys, girls, kids, lifestyle
* @return {Object}
*/
const
getAds
=
channelType
=>
{
const
getAds
=
(
channelType
,
isDegrade
)
=>
{
let
contentCode
=
ADS_CODE
[
channelType
]
||
ADS_CODE
.
boys
;
if
(
isDegrade
)
{
return
null
;
}
return
serviceApi
.
get
(
URL_OPERATIONS_RESOURCE_GET
,
{
content_code
:
contentCode
},
{
cache
:
true
}).
then
(
res
=>
{
...
...
apps/guang/views/action/guang/detail.hbs
View file @
4512366
...
...
@@ -130,18 +130,20 @@
</div>
{{/if}}
<div
id=
"comment-area"
class=
"comment-area"
>
<div
class=
"comment-textarea"
>
<textarea
id=
"comment-info"
placeholder=
"我有话要说。。。"
>
{{
commentInfo
}}
</textarea>
</div>
<div
class=
"comment-publish clearfix"
>
<span
id=
"word-count-tip"
class=
"word-count-tip"
></span>
<a
id=
"comment-btn"
class=
"publish-btn disable"
>
评论
</a>
</div>
<div
id=
"pjax-container"
class=
"comments-wrap"
>
{{>
comment
}}
{{#
unless
@root
.
pc
.
guang
.
removeItemComment
}}
<div
id=
"comment-area"
class=
"comment-area"
>
<div
class=
"comment-textarea"
>
<textarea
id=
"comment-info"
placeholder=
"我有话要说。。。"
>
{{
commentInfo
}}
</textarea>
</div>
<div
class=
"comment-publish clearfix"
>
<span
id=
"word-count-tip"
class=
"word-count-tip"
></span>
<a
id=
"comment-btn"
class=
"publish-btn disable"
>
评论
</a>
</div>
<div
id=
"pjax-container"
class=
"comments-wrap"
>
{{>
comment
}}
</div>
</div>
</div>
{{/
unless
}}
</div>
<div
class=
"right-side detail-side"
>
{{>
right-side
}}
...
...
apps/guang/views/partial/right-side.hbs
View file @
4512366
...
...
@@ -14,16 +14,18 @@
</div>
</div>
<div
class=
"hot"
>
<h1
class=
"hot-title"
>
热门标签
</h1>
<div
class=
"hot-tag-list"
>
{{#
hotTags
}}
<a
class=
"hot-tag"
href=
"
{{
url
}}
"
target=
"_blank"
>
{{
tagName
}}
</a>
{{/
hotTags
}}
{{#
unless
@root
.
pc
.
guang
.
removeHotTag
}}
<div
class=
"hot"
>
<h1
class=
"hot-title"
>
热门标签
</h1>
<div
class=
"hot-tag-list"
>
{{#
hotTags
}}
<a
class=
"hot-tag"
href=
"
{{
url
}}
"
target=
"_blank"
>
{{
tagName
}}
</a>
{{/
hotTags
}}
</div>
</div>
</div>
{{/
unless
}}
<div
class=
"ads"
>
{{#
ads
}}
...
...
@@ -31,4 +33,4 @@
<img
class=
"lazy"
data-original=
"
{{
img
}}
"
>
</a>
{{/
ads
}}
</div>
\ No newline at end of file
</div>
...
...
apps/product/views/action/product/detail.hbs
View file @
4512366
...
...
@@ -658,16 +658,18 @@
<div
class=
"service"
></div>
{{#if
latestWalk
}}
<div
class=
"info-block latest-walk"
>
<input
id=
"latest-walk-count"
type=
"hidden"
value=
"
{{
latestWalk
}}
"
>
<p
class=
"block-title"
>
<span
class=
"title cur"
>
最近浏览 RECENT REVIEW
</span>
</p>
<div
id=
"latest-walk-goods"
class=
"goods clearfix"
></div>
{{>
product
/
latest-walk-tpl
}}
</div>
{{/if}}
{{#
unless
@root
.
pc
.
product
.
removeRecentView
}}
{{#if
latestWalk
}}
<div
class=
"info-block latest-walk"
>
<input
id=
"latest-walk-count"
type=
"hidden"
value=
"
{{
latestWalk
}}
"
>
<p
class=
"block-title"
>
<span
class=
"title cur"
>
最近浏览 RECENT REVIEW
</span>
</p>
<div
id=
"latest-walk-goods"
class=
"goods clearfix"
></div>
{{>
product
/
latest-walk-tpl
}}
</div>
{{/if}}
{{/
unless
}}
</div>
</div>
{{/
detail
}}
...
...
doraemon/views/partial/header.hbs
View file @
4512366
...
...
@@ -26,7 +26,9 @@
<span
class=
"tag-seprate"
></span>
<a
href=
"//www.yohobuy.com/home?t=1453340799.4986"
>
MY有货
</a>
<span
class=
"icon-bottomarrow"
></span>
<div
class=
"simple-user-center"
></div>
{{#
unless
@root
.
pc
.
common
.
disMyYohoHover
}}
<div
class=
"simple-user-center"
></div>
{{/
unless
}}
</li>
<li
class=
"myorder"
>
<span
class=
"tag-seprate"
></span>
...
...
@@ -66,7 +68,8 @@
<div
class=
"main-logo"
><a
href=
"//www.yohobuy.com/"
class=
"main-link"
></a></div>
<ul
class=
"main-nav-list"
>
{{#
navbars
}}
<li
class=
"
{{
type
}}
"
{{#if
ico
}}
style=
"background: url(
{{
image
ico
54
32
}}
) no-repeat center center"
{{/if}}
>
<li
class=
"
{{
type
}}
"
{{#if
ico
}}
style=
"background: url(
{{
image
ico
54
32
}}
) no-repeat center center"
{{/if}}
>
{{#if
ico
}}
<a
href=
"
{{
link
}}
"
{{#if
isNewPage
}}
target=
"_blank"
{{/if}}
class=
"menu-ico"
></a>
{{^}}
...
...
@@ -81,27 +84,37 @@
{{/
navbars
}}
</ul>
<div
class=
"func-area hide"
>
<ul
class=
"search-suggest"
></ul>
{{#
unless
@root
.
pc
.
common
.
disSearchAssociation
}}
<ul
class=
"search-suggest"
></ul>
{{/
unless
}}
<div
class=
"search-2016"
>
<form
action=
"//search.yohobuy.com"
method=
"get"
id=
"search-form"
>
<input
type=
"hidden"
id=
"defaultsearch"
>
<input
class=
"search-key"
type=
"text"
name=
"query"
id=
"query-key"
autocomplete=
"off"
x-webkit-speech=
""
lang=
"zh-CN"
x-webkit-grammar=
"builtin:translate"
value=
""
onfocus=
"if(this.value==this.defaultValue){this.value='';this.style.color='#333'}"
onblur=
"if(this.value==''){this.value=this.defaultValue;this.style.color='#999'}"
maxlength=
"30"
>
<input
class=
"search-key"
type=
"text"
name=
"query"
id=
"query-key"
autocomplete=
"off"
x-webkit-speech=
""
lang=
"zh-CN"
x-webkit-grammar=
"builtin:translate"
value=
""
onfocus=
"if(this.value==this.defaultValue){this.value='';this.style.color='#333'}"
onblur=
"if(this.value==''){this.value=this.defaultValue;this.style.color='#999'}"
maxlength=
"30"
>
<a
class=
"search-btn"
href=
"javascript:submitSearch();"
></a>
</form>
</div>
<div
class=
"go-cart"
>
<a
href=
"//www.yohobuy.com/shopping/cart"
>
<span
class=
"iconfont "
>

</span>
<span
class=
"goods-num-tip"
>
0
</span>
{{#
unless
@root
.
pc
.
common
.
removeCartCount
}}
<span
class=
"goods-num-tip"
>
0
</span>
{{/
unless
}}
</a>
<div
class=
"mini-cart-wrapper"
>
<div
class=
"loading-cart"
>
<h3>
加载中,请稍后
</h3>
</div>
<div
class=
"empty-cart"
>
<h3>
您的购物车暂无商品
</h3>
{{#
unless
@root
.
pc
.
common
.
disCartHover
}}
<div
class=
"mini-cart-wrapper"
>
<div
class=
"loading-cart"
>
<h3>
加载中,请稍后
</h3>
</div>
<div
class=
"empty-cart"
>
<h3>
您的购物车暂无商品
</h3>
</div>
</div>
</div>
{{/
unless
}}
</div>
</div>
</div>
...
...
@@ -109,39 +122,40 @@
<div
class=
"nav-wrapper clearfix"
>
<div
class=
"center-content"
>
{{#
subNavGroup
}}
<ul
class=
"sub-nav-list
{{
subType
}}
"
>
{{#
subNav
}}
<li
{{#if
thirdNav
}}
class=
"contain-third"
{{/if}}
>
<a
href=
"
{{
link
}}
"
>
{{
name
}}
{{#if
isNew
}}
<span
class=
"newlogo"
></span>
{{/if}}
</a>
{{#if
thirdNav
}}
<div
class=
"third-nav-wrapper"
>
<div
class=
"center-content"
>
<dl
class=
"hide-list hide"
>
{{#
thirdNav
}}
<dt>
<h1
class=
""
><a
href=
"
{{
link
}}
"
>
{{
title
}}
</a>
</h1>
</dt>
{{#
brandItems
}}
<dd>
<a
href=
"
{{
link
}}
"
{{#if
hot
}}
class=
"hot"
{{/if}}
>
{{
brandName
}}
</a>
</dd>
{{/
brandItems
}}
{{/
thirdNav
}}
</dl>
<div
class=
"show-detail"
data-code=
"
{{
imgCode
}}
"
>
<a><img
src=
"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="
></a>
<a
class=
"title"
>
热门小物优选
</a>
<ul
class=
"sub-nav-list
{{
subType
}}
"
>
{{#
subNav
}}
<li
{{#if
thirdNav
}}
class=
"contain-third"
{{/if}}
>
<a
href=
"
{{
link
}}
"
>
{{
name
}}
{{#if
isNew
}}
<span
class=
"newlogo"
></span>
{{/if}}
</a>
{{#if
thirdNav
}}
<div
class=
"third-nav-wrapper"
>
<div
class=
"center-content"
>
<dl
class=
"hide-list hide"
>
{{#
thirdNav
}}
<dt>
<h1
class=
""
><a
href=
"
{{
link
}}
"
>
{{
title
}}
</a></h1>
</dt>
{{#
brandItems
}}
<dd>
<a
href=
"
{{
link
}}
"
{{#if
hot
}}
class=
"hot"
{{/if}}
>
{{
brandName
}}
</a>
</dd>
{{/
brandItems
}}
{{/
thirdNav
}}
</dl>
<div
class=
"show-detail"
data-code=
"
{{
imgCode
}}
"
>
<a><img
src=
"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="
></a>
<a
class=
"title"
>
热门小物优选
</a>
</div>
</div>
</div>
</div>
{{/if}}
</li>
{{/
subNav
}}
</ul>
{{/if}}
</li>
{{/
subNav
}}
</ul>
{{/
subNavGroup
}}
</div>
</div>
...
...
@@ -153,7 +167,7 @@
</script>
<script
type=
"text/html"
id=
"simple-account-info-tpl"
>
<div class="account-info-header">
<div class="user-img"
>
<div class="user-img">
<img src="\{{headIco}}">
</div>
<div class="user-name">
...
...
@@ -163,15 +177,15 @@
VIP: <span>\{{curTitle}}</span>
</h3>
\{{#unless vip3}}
<div class="level-detail">
<div class="level-view-bar">
<div class="text-span">
\{{curYearCost}}/\{{nextVipNeedCost}}
</div>
<p class="\{{#if curYearCostPer}}integrate\{{/if}}" style="width: \{{curYearCostPer}}%;"></p>
<div class="level-detail">
<div class="level-view-bar">
<div class="text-span">
\{{curYearCost}}/\{{nextVipNeedCost}}
</div>
<
span>\{{nextVipTitle}}</span
>
<
p class="\{{#if curYearCostPer}}integrate\{{/if}}" style="width: \{{curYearCostPer}}%;"></p
>
</div>
<span>\{{nextVipTitle}}</span>
</div>
\{{/unless}}
</div>
<ul class="account-info-content">
...
...
@@ -197,79 +211,82 @@
</li>
</ul>
<div class="account-info-footer">
<a href="//www.yohobuy.com/home/user?t=\{{
timestamp
}}
"
>
完善资料
<
span
>
(
学生认证
)
<
/span></
a
>
<a href="//www.yohobuy.com/home/user?t=\{{
timestamp
}}
"
>
完善资料
<
span
>
(
学生认证
)
<
/span></
a
>
<
/div
>
</script>
<script
type=
"text/html"
id=
"mini-cart-tpl"
>
\{{#carData}}
<div class="rich-cart">
<div class="goods-list">
\{{# totalGoods}}
\{{#notzero buy_number}}
<div class="goods-item">
<div class="goods-img">
<a href="\{{product_url}}">
<img src="\{{default_img}}"/>
</a>
</div>
<div class="goods-info">
<p class="title">
<a href="\{{product_url}}">\{{product_name}}</a>
</p>
<p>
颜色:\{{color_name}}
尺码:\{{size_name}}
</p>
</div>
<div class="goods-price">
<p>\{{show_price}} x \{{buy_number}}</p>
<p>
<a href="javascript:void(0)" class="cart-goods-del" data-id="\{{goods_incart_id}}" data-cheapest="\{{is_cheapest_free}}" data-sku="\{{product_sku}}" data-proid="\{{promotion_id}}" data-num="\{{buy_number}}">删除</a>
</p>
</div>
</div>
\{{/notzero}}
\{{/ totalGoods}}
\{{#if has_promotion}}
<div class="activity-item">
<label class="activity-name">活动</label>
<h3 class="activity-content">
\{{#if fit_outlet_promotion }}
购outlet商品,满¥1999再享9折
\{{/if}}
\{{#if has_other_promotion}}
<span class="mycart_i_down" title="更多" ></span>
\{{/if}}
\{{#if has_first_promotion}}
\{{first_promotions.promotion_title}}
\{{/if}}
</h3>
</div>
\{{/if}}
\{{#if fit_free_shipping }}
<div class="activity-item">
<label class="activity-name">免运费</label>
<h3 class="activity-content">全场满 ¥\{{fit_free_shipping}}免运费</h3>
</div>
\{{/if}}
</div>
<div class="go-full-cart">
<div>
<a href="//www.yohobuy.com/shopping/cart">去购物车结算</a>
\{{#carData}}
<div class="rich-cart">
<div class="goods-list">
\{{# totalGoods}}
\{{#notzero buy_number}}
<div class="goods-item">
<div class="goods-img">
<a href="\{{product_url}}">
<img src="\{{default_img}}"/>
</a>
</div>
<div class="goods-info">
<p class="title">
<a href="\{{product_url}}">\{{product_name}}</a>
</p>
<p>
颜色:\{{color_name}}
尺码:\{{size_name}}
</p>
</div>
<div class="goods-price">
<p>\{{show_price}} x \{{buy_number}}</p>
<p>
<a href="javascript:void(0)" class="cart-goods-del" data-id="\{{goods_incart_id}}"
data-cheapest="\{{is_cheapest_free}}" data-sku="\{{product_sku}}"
data-proid="\{{promotion_id}}" data-num="\{{buy_number}}">删除</a>
</p>
</div>
</div>
\{{/notzero}}
\{{/ totalGoods}}
\{{#if has_promotion}}
<div class="activity-item">
<label class="activity-name">活动</label>
<h3 class="activity-content">
\{{#if fit_outlet_promotion }}
购outlet商品,满¥1999再享9折
\{{/if}}
\{{#if has_other_promotion}}
<span class="mycart_i_down" title="更多"></span>
\{{/if}}
\{{#if has_first_promotion}}
\{{first_promotions.promotion_title}}
\{{/if}}
</h3>
</div>
\{{/if}}
\{{#if fit_free_shipping }}
<div class="activity-item">
<label class="activity-name">免运费</label>
<h3 class="activity-content">全场满 ¥\{{fit_free_shipping}}免运费</h3>
</div>
\{{/if}}
</div>
<div class="go-full-cart">
<div>
<a href="//www.yohobuy.com/shopping/cart">去购物车结算</a>
</div>
</div>
\{{
/
carData
}}
</div>
\{{
/
carData
}}
</script>
<script
type=
"text/html"
id=
"search-suggest-tml"
>
\{{#data}}
<li>
<a style="display: block;" href="\{{href}}" class="clearfix clear search-item" title="\{{keyword}}" act="\{{href}}">
<span class="searchvalue" >\{{keyword}}</span>
<span class="valuenum">约\{{count}}个商品</span>
</a>
</li>
\{{
/
data
}}
\{{#data}}
<li>
<a style="display: block;" href="\{{href}}" class="clearfix clear search-item" title="\{{keyword}}"
act="\{{href}}">
<span class="searchvalue">\{{keyword}}</span>
<span class="valuenum">约\{{count}}个商品</span>
</a>
</li>
\{{
/
data
}}
</script>
</div>
...
...
doraemon/views/partial/product/latest-walk.hbs
View file @
4512366
{{#if
latestWalk
}}
<input
id=
"latest-walk-count"
type=
"hidden"
value=
"
{{
latestWalk
}}
"
>
<div
class=
"latest-walk"
>
<h2>
最近浏览的商品
</h2>
<div
id=
"latest-walk-goods"
class=
"goods clearfix"
></div>
</div>
{{#
unless
@root
.
pc
.
product
.
removeRecentView
}}
{{#if
latestWalk
}}
<input
id=
"latest-walk-count"
type=
"hidden"
value=
"
{{
latestWalk
}}
"
>
<div
class=
"latest-walk"
>
<h2>
最近浏览的商品
</h2>
<div
id=
"latest-walk-goods"
class=
"goods clearfix"
></div>
</div>
{{>
product
/
latest-walk-tpl
}}
{{/if}}
{{>
product
/
latest-walk-tpl
}}
{{/if}}
{{/
unless
}}
...
...
public/js/brands/brands.page.js
View file @
4512366
...
...
@@ -175,6 +175,9 @@ function bindTemplete($select, data, tmp) {
// 鼠标悬浮品牌,请求数据,并且展示
function
bindHoverEvent
()
{
if
(
String
(
$list
.
data
(
'ishover'
))
===
'true'
)
{
return
;
}
$brand
.
unbind
(
'mouseenter'
).
unbind
(
'mouseleave'
).
hover
(
function
()
{
var
$this
=
$
(
this
);
var
key
=
$this
.
attr
(
'data-key'
);
...
...
public/js/header.js
View file @
4512366
...
...
@@ -38,6 +38,8 @@ var logoAngle = 0,
var
dataLayer
=
[];
var
cartTimer
;
// banner和地址的映射
var
bannerMap
=
{
listboys
:
'4f78b0f418fc42314d8b6e791cfb7fa8'
,
...
...
@@ -75,11 +77,13 @@ var bannerMap = {
},
cookieMap
=
{};
var
$signinBtn
=
$
(
'#signin-url'
);
var
$regBtn
=
$
(
'#reg-url'
);
// 降级处理
var
__DEGRADATION_CONFIG
=
{
hungMyYoho
:
$myYohoBox
.
data
(
'hung'
)
};
$signinBtn
.
attr
(
'href'
,
'//www.yohobuy.com/signin.html?refer='
+
window
.
location
.
href
);
$regBtn
.
attr
(
'href'
,
'//www.yohobuy.com/reg.html?refer='
+
window
.
location
.
href
);
$
(
'#signin-url'
).
attr
(
'href'
,
'//www.yohobuy.com/signin.html?refer='
+
window
.
location
.
href
);
$
(
'#reg-url'
).
attr
(
'href'
,
'//www.yohobuy.com/reg.html?refer='
+
window
.
location
.
href
);
// handlebars模板
centerFn
=
handlebars
.
compile
(
$
(
'#simple-account-info-tpl'
).
html
()
||
''
);
...
...
@@ -305,6 +309,11 @@ function syncCratInfo(strG) {
domain
:
'.yohobuy.com'
});
}
if
(
!
$goodsNum
||
!
$goodsNum
.
length
)
{
return
cartTimer
?
clearInterval
(
cartTimer
)
:
false
;
}
if
(
window
.
cookie
(
'_g'
))
{
info
=
$
.
parseJSON
(
window
.
cookie
(
'_g'
));
total
=
parseInt
(
info
.
_nac
,
10
)
+
parseInt
(
info
.
_ac
,
10
);
...
...
@@ -522,7 +531,8 @@ if (isSupportCss3Animation()) {
syncPageChannel
();
getBannerAndNotice
();
// 获取头部banner
formatThirdMenu
();
// 格式化三级菜单
setInterval
(
syncCratInfo
,
2000
);
// 定时同步购物车数量
cartTimer
=
setInterval
(
syncCratInfo
,
2000
);
// 定时同步购物车数量
// 获取头部登陆信息
(
function
()
{
...
...
@@ -542,7 +552,12 @@ setInterval(syncCratInfo, 2000); // 定时同步购物车数量
$loginBox
.
show
();
}());
fetchUserInfoEvent
.
add
(
syncLoginInfo
);
fetchUserInfoEvent
.
add
(
function
()
{
if
(
$
(
'.simple-user-center'
).
length
===
0
)
{
return
;
}
syncLoginInfo
();
});
$myYohoBox
.
hover
(
function
()
{
var
uid
=
getUid
();
// eslint-disable-line
...
...
@@ -594,14 +609,16 @@ $searchForm.on('keyup', '.search-key', function(e) {
$focus
.
addClass
(
'action'
);
$
(
this
).
val
(
$focus
.
find
(
'.searchvalue'
).
text
());
}
else
if
(
e
.
which
===
13
)
{
val
=
val
.
replace
(
new
RegExp
(
'\''
,
'gm'
),
''
);
if
(
val
!==
''
)
{
$
(
this
).
val
(
val
);
$searchForm
.
submit
();
}
}
else
{
val
=
val
.
replace
(
new
RegExp
(
'\''
,
'gm'
),
''
);
// 去掉特殊字符
$
(
this
).
val
(
val
);
searchSuggest
(
val
);
if
(
$searchSug
&&
$searchSug
.
length
)
{
val
=
val
.
replace
(
new
RegExp
(
'\''
,
'gm'
),
''
);
// 去掉特殊字符
searchSuggest
(
val
);
}
}
}).
on
(
'blur'
,
'.search-key'
,
function
()
{
setTimeout
(
function
()
{
...
...
@@ -609,39 +626,41 @@ $searchForm.on('keyup', '.search-key', function(e) {
},
200
);
});
$goCart
.
hover
(
function
()
{
var
data
,
_html
=
''
;
if
(
$miniCart
&&
$miniCart
.
length
)
{
$goCart
.
hover
(
function
()
{
var
data
,
_html
=
''
;
if
(
$goCart
.
hasClass
(
'on-hover'
))
{
return
;
}
data
=
$goCart
.
data
();
if
(
data
&&
data
.
num
*
1
)
{
_html
=
'<div class="loading-cart"><h3>加载中,请稍后</h3></div>'
;
loadCartDetail
(
data
.
key
);
}
else
{
_html
=
'<div class="empty-cart"><h3>您的购物车暂无商品</h3></div>'
;
}
$miniCart
.
html
(
_html
);
$goCart
.
addClass
(
'on-hover'
);
},
function
()
{
$goCart
.
removeClass
(
'on-hover'
);
});
if
(
$goCart
.
hasClass
(
'on-hover'
))
{
return
;
}
$goCart
.
on
(
'click'
,
'.cart-goods-del'
,
function
()
{
var
$dom
=
$
(
this
),
data
=
$dom
.
data
(),
callback
;
data
=
$goCart
.
data
();
if
(
data
&&
data
.
num
*
1
)
{
_html
=
'<div class="loading-cart"><h3>加载中,请稍后</h3></div>'
;
loadCartDetail
(
data
.
key
);
}
else
{
_html
=
'<div class="empty-cart"><h3>您的购物车暂无商品</h3></div>'
;
}
$miniCart
.
html
(
_html
);
$goCart
.
addClass
(
'on-hover'
);
},
function
()
{
$goCart
.
removeClass
(
'on-hover'
);
});
if
(
data
)
{
callback
=
function
()
{
$dom
.
closest
(
'.goods-item'
).
remove
();
};
data
.
key
=
$goCart
.
data
().
key
;
delCartGoods
(
data
,
callback
);
}
});
$goCart
.
on
(
'click'
,
'.cart-goods-del'
,
function
()
{
var
$dom
=
$
(
this
),
data
=
$dom
.
data
(),
callback
;
if
(
data
)
{
callback
=
function
()
{
$dom
.
closest
(
'.goods-item'
).
remove
();
};
data
.
key
=
$goCart
.
data
().
key
;
delCartGoods
(
data
,
callback
);
}
});
}
$subNav
.
on
({
mouseenter
:
function
()
{
...
...
Please
register
or
login
to post a comment