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 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Tue May 10 18:09:44 2016 5 +Created by FontForge 20120731 at Mon May 16 09:39:59 2016
6 By admin 6 By admin
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Tue May 10 18:09:44 2016 @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Tue May 10 18:09:44 2016
19 bbox="-0.75 -128 3943 896.75" 19 bbox="-0.75 -128 3943 896.75"
20 underline-thickness="50" 20 underline-thickness="50"
21 underline-position="-100" 21 underline-position="-100"
22 - unicode-range="U+0078-E64A" 22 + unicode-range="U+0078-E64C"
23 /> 23 />
24 <missing-glyph horiz-adv-x="374" 24 <missing-glyph horiz-adv-x="374"
25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> 25 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 @@ -274,5 +274,14 @@ t-22 15.5zM751 552v83h-473v-83h206v-298h-72v237h-87v-237h-66v-84h506v84h-193v119
274 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 274 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
275 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 275 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
276 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" /> 276 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" />
  277 + <glyph glyph-name="uniE64B" unicode="&#xe64b;"
  278 +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
  279 +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
  280 +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
  281 +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" />
  282 + <glyph glyph-name="uniE64C" unicode="&#xe64c;"
  283 +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
  284 +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
  285 +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" />
277 </font> 286 </font>
278 </defs></svg> 287 </defs></svg>
No preview for this file type
No preview for this file type
@@ -30,9 +30,6 @@ var brandsData, @@ -30,9 +30,6 @@ var brandsData,
30 $keyword, 30 $keyword,
31 clearTextHammer; 31 clearTextHammer;
32 32
33 -var security = require('../plugin/security'),  
34 - Hammer = require('yoho.hammer');  
35 -  
36 var $history = $('.history'); 33 var $history = $('.history');
37 var $historySearch = $('.history-search'); 34 var $historySearch = $('.history-search');
38 var $hotSearch = $('.hot-search'); 35 var $hotSearch = $('.hot-search');
@@ -157,7 +154,7 @@ function searchResult() { @@ -157,7 +154,7 @@ function searchResult() {
157 brandHtml.push('</h2></div>'); 154 brandHtml.push('</h2></div>');
158 $.each(v, function(i, brand) { 155 $.each(v, function(i, brand) {
159 156
160 - brandHtml.push('<p><a href="' + brand.url + '" brandname = "'+brand.name+'">' + brand.name); 157 + brandHtml.push('<p><a href="' + brand.url + '" brandName = "'+brand.name+'" brandId = "' + brand.brandId + '">' + brand.name);
161 if (brand.isNew) { 158 if (brand.isNew) {
162 brandHtml.push('<i class="icon-new">NEW</i>'); 159 brandHtml.push('<i class="icon-new">NEW</i>');
163 } 160 }
@@ -172,7 +169,7 @@ function searchResult() { @@ -172,7 +169,7 @@ function searchResult() {
172 }); 169 });
173 } 170 }
174 171
175 - // 172 + //没填入关键词时显示最热搜索
176 if(keyword.length >0){ 173 if(keyword.length >0){
177 $('.search-brand-page').addClass('hide'); 174 $('.search-brand-page').addClass('hide');
178 }else{ 175 }else{
@@ -186,7 +183,7 @@ function searchResult() { @@ -186,7 +183,7 @@ function searchResult() {
186 writeSearch.bindWirteLocal($brandList); 183 writeSearch.bindWirteLocal($brandList);
187 } 184 }
188 185
189 -if ($('.brand-search-page').length) { 186 +if ($('.brand-search-page').length > 0) {
190 brandsData = $.parseJSON($('#brands-data').html()); 187 brandsData = $.parseJSON($('#brands-data').html());
191 $keyword = $('#keyword'); 188 $keyword = $('#keyword');
192 189
@@ -265,12 +262,8 @@ if ($brandItem.length > 0 ) { @@ -265,12 +262,8 @@ if ($brandItem.length > 0 ) {
265 }); 262 });
266 } 263 }
267 264
268 -  
269 -  
270 -  
271 -  
272 //初始化历史搜索的内容 265 //初始化历史搜索的内容
273 -if ($('.brand-search-page').length) { 266 +if ($('.brand-search-page').length >0) {
274 267
275 chHammer = new Hammer($clearHistory[0]); 268 chHammer = new Hammer($clearHistory[0]);
276 chHammer.on('tap', function() { 269 chHammer.on('tap', function() {
@@ -280,10 +273,15 @@ if ($('.brand-search-page').length) { @@ -280,10 +273,15 @@ if ($('.brand-search-page').length) {
280 $historySearch.hide(); 273 $historySearch.hide();
281 $clearHistory.hide(); 274 $clearHistory.hide();
282 275
  276 + if ($('.net-search').length > 0){
  277 + removeHistory();
  278 + }
  279 +
283 window.rePosFooter(); 280 window.rePosFooter();
284 }); 281 });
285 282
286 //搜索页面 283 //搜索页面
  284 +
287 (function () { 285 (function () {
288 var html = '', 286 var html = '',
289 history, 287 history,
@@ -317,6 +315,23 @@ if ($('.brand-search-page').length) { @@ -317,6 +315,23 @@ if ($('.brand-search-page').length) {
317 } 315 }
318 } 316 }
319 }()); 317 }());
  318 +
320 } 319 }
321 320
322 -//writeSearch.bindWirteLocal($form);  
  321 +/**
  322 + * 清除记录
  323 + */
  324 +function removeHistory()
  325 +{
  326 + $.ajax({
  327 + type: 'GET',
  328 + url: '/category/brand/delBrandHistory',
  329 + data: '',
  330 + success: function (data) {
  331 +
  332 + },
  333 + error: function () {
  334 + //showTip('网络断开连接啦~');
  335 + }
  336 + });
  337 +}
@@ -16,13 +16,17 @@ function getRanToken() { @@ -16,13 +16,17 @@ function getRanToken() {
16 function bindWirteLocal($brandList) { 16 function bindWirteLocal($brandList) {
17 $brandList.on('click','p', function(e) { 17 $brandList.on('click','p', function(e) {
18 18
  19 + var a,brandName,brandId,url;
  20 +
19 e.preventDefault(); 21 e.preventDefault();
20 22
21 - var a = $(this).find('a'); 23 + a = $(this).find('a');
  24 +
  25 + brandName = a.attr("brandName");
22 26
23 - var brandName = a.attr("brandname"); 27 + brandId = a.attr("brandId");
24 28
25 - var url = a.attr("href"); 29 + url = a.attr("href");
26 30
27 var query = brandName+url, 31 var query = brandName+url,
28 historys; 32 historys;
@@ -46,41 +50,32 @@ function bindWirteLocal($brandList) { @@ -46,41 +50,32 @@ function bindWirteLocal($brandList) {
46 localStorage.setItem('historys-brand', historys); 50 localStorage.setItem('historys-brand', historys);
47 } 51 }
48 52
  53 + if ($('.net-search').length > 0){
  54 + addHistory(brandId);
  55 + }
  56 +
49 location.href = url; 57 location.href = url;
50 }); 58 });
51 } 59 }
52 60
53 -//本地存储点击前的标签  
54 -function storeLocal($brandName,$brandUrl) {  
55 -  
56 - var query = $brandName,  
57 - historys;  
58 - //var brandName = $brandName;  
59 - //var brandUrl = $brandUrl;  
60 - //var query;  
61 -  
62 - if (localStorage) {  
63 - historys = localStorage.getItem('historys-brand');  
64 -  
65 - historys = historys ? historys : '';  
66 -  
67 - if (historys.indexOf(ranToken + query + ranToken) > -1) {  
68 - return;  
69 - }  
70 -  
71 - if (historys === '') {  
72 - query = ranToken + query; 61 +/**
  62 + * 增加单条记录
  63 + */
  64 +function addHistory(brandId)
  65 +{
  66 + $.ajax({
  67 + type: 'GET',
  68 + url: '/category/brand/addBrandSearch',
  69 + data: 'brandId=' + brandId,
  70 + success: function (data) {
  71 +
  72 + },
  73 + error: function () {
  74 + //showTip('网络断开连接啦~');
73 } 75 }
74 -  
75 -  
76 - historys += query + ranToken;  
77 -  
78 - localStorage.setItem('historys-brand', historys);  
79 - } 76 + });
80 } 77 }
81 78
82 exports.getRanToken = getRanToken; 79 exports.getRanToken = getRanToken;
83 80
84 -exports.bindWirteLocal = bindWirteLocal;  
85 -  
86 -exports.storeLocal = storeLocal;  
  81 +exports.bindWirteLocal = bindWirteLocal;
@@ -314,10 +314,12 @@ @@ -314,10 +314,12 @@
314 } 314 }
315 315
316 .brand-name{ 316 .brand-name{
  317 + margin-top: 10px;
317 text-align: center; 318 text-align: center;
318 vertical-align: middle; 319 vertical-align: middle;
319 - font-size: 26px; 320 + font-size: 24px;
320 line-height: 44px; 321 line-height: 44px;
  322 + height: 44px;
321 color: #b8b8b8; 323 color: #b8b8b8;
322 } 324 }
323 325
@@ -351,6 +353,6 @@ @@ -351,6 +353,6 @@
351 } 353 }
352 354
353 .search-result { 355 .search-result {
354 - padding-top: 176px; 356 + padding-top: 165px;
355 } 357 }
356 } 358 }
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <i class="search-icon iconfont">&#xe60f;</i> 6 <i class="search-icon iconfont">&#xe60f;</i>
7 <div class="search-action"> 7 <div class="search-action">
8 <span class="iconfont clear-text">&#xe623;</span> 8 <span class="iconfont clear-text">&#xe623;</span>
9 - <a class="cancel-btn" href="javascript: history.go(-1);">取消</span> 9 + <a class="cancel-btn" href="javascript: history.go(-1);">取消</a>
10 </div> 10 </div>
11 </form> 11 </form>
12 </div> 12 </div>
@@ -17,9 +17,9 @@ @@ -17,9 +17,9 @@
17 <div class="search-brand-page"> 17 <div class="search-brand-page">
18 <div class="search-items"> 18 <div class="search-items">
19 {{#if historySearch}} 19 {{#if historySearch}}
20 - <div class="history-search hide"> 20 + <div class="history-search net-search hide">
21 <h3><span class="iconfont">&#xe64a;</span>最近搜索 21 <h3><span class="iconfont">&#xe64a;</span>最近搜索
22 - <button id="clear-history" class="clear-icon iconfont hide">&#xe621;</button> 22 + <button id="clear-history" class="clear-icon iconfont hide">&#xe64c;;</button>
23 </h3> 23 </h3>
24 <ul class="history clearfix"> 24 <ul class="history clearfix">
25 {{# history}} 25 {{# history}}
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 </ul> 30 </ul>
31 </div> 31 </div>
32 {{else}} 32 {{else}}
33 - <div class="history-search hide"> 33 + <div class="history-search local-search hide">
34 <h3><span class="iconfont">&#xe64a;</span>最近搜索 34 <h3><span class="iconfont">&#xe64a;</span>最近搜索
35 <button id="clear-history" class="clear-icon iconfont hide">&#xe621;</button> 35 <button id="clear-history" class="clear-icon iconfont hide">&#xe621;</button>
36 </h3> 36 </h3>
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 </div> 39 </div>
40 {{/if}} 40 {{/if}}
41 <div class="hot-search"> 41 <div class="hot-search">
42 - <h3><span class="iconfont">&#xe60f;</span>热门搜索</h3> 42 + <h3><span class="iconfont">&#xe64b;</span>热门搜索</h3>
43 <ul class="hot clearfix"> 43 <ul class="hot clearfix">
44 {{# hot}} 44 {{# hot}}
45 <li> 45 <li>