Authored by wangqing

增加搜索关键字和new

... ... @@ -83,7 +83,11 @@
<ul class="sub-nav-list">
{{# subnav}}
<li class="sub-nav-item">
<a href="{{link}}">{{name}}</a>
<a href="{{link}}">{{name}}
{{#if is_new}}
<span class="newlogo"></span>
{{/if}}
</a>
{{#if thirdnav}}
<div class="third-nav-wrapper">
<div class="third-nav">
... ... @@ -96,7 +100,7 @@
{{#branditems}}
<li class="category-
item thirdnavbar">
<a href="{{link}}" hot={{hot}}>{{brandname}}</a>
<a href="{{link}}" hot={{hot}} >{{brandname}}</a>
</li>
{{/branditems}}
</ul>
... ...
... ... @@ -97,8 +97,35 @@ window.submitSearch = function() {
return false;
}
}
}
};
/**
* 增加关键字
* @return {[type]} [description]
*/
function actionAddKeyWords() {
var keywords = $('#nav_keyword').text();
var defaultsearch = 'vans';
var $query_key = $('#query_key');
if (keywords !== '') {
$query_key.css({
'color': '#000'
});
$query_key.val(keywords);
} else {
$query_key.css({
'color': '#e0e0e0'
});
$query_key.val(defaultsearch);
$query_key.on('focus', function(e) {
$query_key.css({
'color': '#000'
});
$query_key.val('');
})
}
}
/**
* 定义购物车扩展
*/
... ... @@ -1316,6 +1343,7 @@ function actionSearch() {
* @return {[type]} [description]
*/
function actionLoginState(_data) {
console.log(_data);
var timestamp = new Date().getTime();
var noLoginHtml = '<span>Hi~</span>[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out ">' +
'请登录</a>]&nbsp;' +
... ... @@ -1482,6 +1510,7 @@ function init() {
actionListenCartMore(); //
actionLoginInfo(); //获取登录信息
actionCover(); //初次登录弹框
actionAddKeyWords();//增加关键字
}
init();
\ No newline at end of file
... ...