Authored by 周少峰

Merge branch 'feature/branchOptmztn' of http://git.dev.yoho.cn/web/yohobuywap in…

…to feature/branchOptmztn
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Tue May 10 18:09:44 2016
Created by FontForge 20120731 at Mon May 16 09:39:59 2016
By admin
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Tue May 10 18:09:44 2016
bbox="-0.75 -128 3943 896.75"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E64A"
unicode-range="U+0078-E64C"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -274,5 +274,14 @@ t-22 15.5zM751 552v83h-473v-83h206v-298h-72v237h-87v-237h-66v-84h506v84h-193v119
d="M510.5 -61q-90.5 0 -173.5 35.5t-142.5 95t-95 142.5t-35.5 173.5t35.5 173.5t95 142.5t142.5 95t173.5 35.5t173.5 -35.5t142.5 -95t95 -142.5t35.5 -173.5t-35.5 -173.5t-95 -142.5t-142.5 -95t-173.5 -35.5zM510.5 793q-110.5 0 -204.5 -54.5t-148.5 -148.5
t-54.5 -204.5t54.5 -204.5t148.5 -148.5t204.5 -54.5t204.5 54.5t148.5 148.5t54.5 204.5t-54.5 204.5t-148.5 148.5t-204.5 54.5zM491 347q-8 0 -13.5 5.5t-5.5 13.5v330q0 8 5.5 14t13.5 6t14 -6t6 -14v-330q0 -8 -6 -13.5t-14 -5.5zM763 347h-272q-8 0 -13.5 5.5
t-5.5 13.5t5.5 13.5t13.5 5.5h272q8 0 13.5 -5.5t5.5 -13.5t-5.5 -13.5t-13.5 -5.5z" />
<glyph glyph-name="uniE64B" unicode="&#xe64b;"
d="M379 -128q-57 0 -122 51.5t-97 132.5q-26 71 -27 149.5t24 151.5q11 33 32.5 70.5t37 58.5t46.5 62q17 20 51 68l11 14l23 34q9 14 21 35t18.5 38.5t11.5 38t4 42.5t-7 44q-6 11 7 24q7 7 20 7q149 -50 216 -284q27 50 58 69q12 6 23 0t11 -21q-3 -59 11.5 -126.5
t42.5 -126.5q4 -5 9 -17t8 -17q51 -89 55 -157q4 -63 -14.5 -126.5t-65.5 -120t-115 -80.5q-30 -11 -61 -11q-18 0 -30.5 5t-18 12.5t-7.5 13t-2 10.5q0 7 2 13t4 10t7.5 9.5t7.5 7t9 6.5t8 6l3 3q36 26 54 75.5t7 95.5q-4 28 -27 75q-2 6 -7.5 20t-8.5 22t-6.5 20t-4.5 23
q0 -2 -2 -5t-2 -5q-15 -42 -20 -75q0 -45 7 -58q7 -5 7.5 -14.5t-4.5 -16.5q-5 -8 -14 -10t-17 3v0q-67 44 -85 120q7 34 7 78v21v24q0 68 -10 92q-14 -53 -28 -72q-22 -39 -37 -58q-6 -6 -15.5 -20t-12.5 -18q-13 -22 -24 -46.5t-21.5 -61.5t-5.5 -78t28 -76
q3 -7 7.5 -12.5t8 -10t8.5 -10t7.5 -8t8 -7t7.5 -6.5t7.5 -6.5t6.5 -4.5q11 -9 16.5 -14.5t10 -14.5t0.5 -19q-5 -18 -21.5 -29.5t-39.5 -11.5z" />
<glyph glyph-name="uniE64C" unicode="&#xe64c;"
d="M911 725h-242v123q0 21 -13.5 34.5t-34.5 13.5h-246q-20 0 -33.5 -13.5t-13.5 -34.5v-123h-246q-21 0 -34.5 -13.5t-13.5 -34t13.5 -34t34.5 -13.5h293h243h293q21 0 34.5 13.5t13.5 34t-13.5 34t-34.5 13.5zM423 725v72h147v-72h-147zM765 579q-21 0 -34.5 -14
t-13.5 -34v-560h-441v560q0 20 -13.5 34t-34 14t-34 -14t-13.5 -34v-611q0 -21 13.5 -34.5t34.5 -13.5h536q20 0 33.5 13.5t13.5 34.5v611q3 20 -11.5 34t-35.5 14zM447 67v389q0 20 -13.5 33.5t-34 13.5t-34 -13.5t-13.5 -33.5v-389q0 -21 13.5 -34.5t34 -13.5t34 13.5
t13.5 34.5zM645 67v389q0 20 -13.5 33.5t-34.5 13.5q-20 0 -35.5 -13.5t-15.5 -33.5v-389q0 -21 13.5 -34.5t34.5 -13.5t36 13.5t15 34.5z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -30,9 +30,6 @@ var brandsData,
$keyword,
clearTextHammer;
var security = require('../plugin/security'),
Hammer = require('yoho.hammer');
var $history = $('.history');
var $historySearch = $('.history-search');
var $hotSearch = $('.hot-search');
... ... @@ -157,7 +154,7 @@ function searchResult() {
brandHtml.push('</h2></div>');
$.each(v, function(i, brand) {
brandHtml.push('<p><a href="' + brand.url + '" brandname = "'+brand.name+'">' + brand.name);
brandHtml.push('<p><a href="' + brand.url + '" brandName = "'+brand.name+'" brandId = "' + brand.brandId + '">' + brand.name);
if (brand.isNew) {
brandHtml.push('<i class="icon-new">NEW</i>');
}
... ... @@ -172,7 +169,7 @@ function searchResult() {
});
}
//
//没填入关键词时显示最热搜索
if(keyword.length >0){
$('.search-brand-page').addClass('hide');
}else{
... ... @@ -186,7 +183,7 @@ function searchResult() {
writeSearch.bindWirteLocal($brandList);
}
if ($('.brand-search-page').length) {
if ($('.brand-search-page').length > 0) {
brandsData = $.parseJSON($('#brands-data').html());
$keyword = $('#keyword');
... ... @@ -265,12 +262,8 @@ if ($brandItem.length > 0 ) {
});
}
//初始化历史搜索的内容
if ($('.brand-search-page').length) {
if ($('.brand-search-page').length >0) {
chHammer = new Hammer($clearHistory[0]);
chHammer.on('tap', function() {
... ... @@ -280,10 +273,15 @@ if ($('.brand-search-page').length) {
$historySearch.hide();
$clearHistory.hide();
if ($('.net-search').length > 0){
removeHistory();
}
window.rePosFooter();
});
//搜索页面
(function () {
var html = '',
history,
... ... @@ -317,6 +315,23 @@ if ($('.brand-search-page').length) {
}
}
}());
}
//writeSearch.bindWirteLocal($form);
\ No newline at end of file
/**
* 清除记录
*/
function removeHistory()
{
$.ajax({
type: 'GET',
url: '/category/brand/delBrandHistory',
data: '',
success: function (data) {
},
error: function () {
//showTip('网络断开连接啦~');
}
});
}
\ No newline at end of file
... ...
... ... @@ -16,13 +16,17 @@ function getRanToken() {
function bindWirteLocal($brandList) {
$brandList.on('click','p', function(e) {
var a,brandName,brandId,url;
e.preventDefault();
var a = $(this).find('a');
a = $(this).find('a');
brandName = a.attr("brandName");
var brandName = a.attr("brandname");
brandId = a.attr("brandId");
var url = a.attr("href");
url = a.attr("href");
var query = brandName+url,
historys;
... ... @@ -46,41 +50,32 @@ function bindWirteLocal($brandList) {
localStorage.setItem('historys-brand', historys);
}
if ($('.net-search').length > 0){
addHistory(brandId);
}
location.href = url;
});
}
//本地存储点击前的标签
function storeLocal($brandName,$brandUrl) {
var query = $brandName,
historys;
//var brandName = $brandName;
//var brandUrl = $brandUrl;
//var query;
if (localStorage) {
historys = localStorage.getItem('historys-brand');
historys = historys ? historys : '';
if (historys.indexOf(ranToken + query + ranToken) > -1) {
return;
}
if (historys === '') {
query = ranToken + query;
/**
* 增加单条记录
*/
function addHistory(brandId)
{
$.ajax({
type: 'GET',
url: '/category/brand/addBrandSearch',
data: 'brandId=' + brandId,
success: function (data) {
},
error: function () {
//showTip('网络断开连接啦~');
}
historys += query + ranToken;
localStorage.setItem('historys-brand', historys);
}
});
}
exports.getRanToken = getRanToken;
exports.bindWirteLocal = bindWirteLocal;
exports.storeLocal = storeLocal;
\ No newline at end of file
exports.bindWirteLocal = bindWirteLocal;
\ No newline at end of file
... ...
... ... @@ -314,10 +314,12 @@
}
.brand-name{
margin-top: 10px;
text-align: center;
vertical-align: middle;
font-size: 26px;
font-size: 24px;
line-height: 44px;
height: 44px;
color: #b8b8b8;
}
... ... @@ -351,6 +353,6 @@
}
.search-result {
padding-top: 176px;
padding-top: 165px;
}
}
\ No newline at end of file
... ...
... ... @@ -6,7 +6,7 @@
<i class="search-icon iconfont">&#xe60f;</i>
<div class="search-action">
<span class="iconfont clear-text">&#xe623;</span>
<a class="cancel-btn" href="javascript: history.go(-1);">取消</span>
<a class="cancel-btn" href="javascript: history.go(-1);">取消</a>
</div>
</form>
</div>
... ... @@ -17,9 +17,9 @@
<div class="search-brand-page">
<div class="search-items">
{{#if historySearch}}
<div class="history-search hide">
<div class="history-search net-search hide">
<h3><span class="iconfont">&#xe64a;</span>最近搜索
<button id="clear-history" class="clear-icon iconfont hide">&#xe621;</button>
<button id="clear-history" class="clear-icon iconfont hide">&#xe64c;;</button>
</h3>
<ul class="history clearfix">
{{# history}}
... ... @@ -30,7 +30,7 @@
</ul>
</div>
{{else}}
<div class="history-search hide">
<div class="history-search local-search hide">
<h3><span class="iconfont">&#xe64a;</span>最近搜索
<button id="clear-history" class="clear-icon iconfont hide">&#xe621;</button>
</h3>
... ... @@ -39,7 +39,7 @@
</div>
{{/if}}
<div class="hot-search">
<h3><span class="iconfont">&#xe60f;</span>热门搜索</h3>
<h3><span class="iconfont">&#xe64b;</span>热门搜索</h3>
<ul class="hot clearfix">
{{# hot}}
<li>
... ...