Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
4 changed files
with
25 additions
and
9 deletions
@@ -70,6 +70,8 @@ function searchResult() { | @@ -70,6 +70,8 @@ function searchResult() { | ||
70 | i = 0, | 70 | i = 0, |
71 | html = ''; | 71 | html = ''; |
72 | 72 | ||
73 | + if (keyword !== '') { | ||
74 | + | ||
73 | // 遍历首字母搜索 | 75 | // 遍历首字母搜索 |
74 | $.each(brandsData, function(k, v) { | 76 | $.each(brandsData, function(k, v) { |
75 | if ($.isArray(v)) { | 77 | if ($.isArray(v)) { |
@@ -107,6 +109,7 @@ function searchResult() { | @@ -107,6 +109,7 @@ function searchResult() { | ||
107 | html += brandHtml.join(''); | 109 | html += brandHtml.join(''); |
108 | 110 | ||
109 | }); | 111 | }); |
112 | + } | ||
110 | 113 | ||
111 | // 插入 dom,绑定事件 | 114 | // 插入 dom,绑定事件 |
112 | $('.search-result').html(html); | 115 | $('.search-result').html(html); |
@@ -118,7 +121,6 @@ if ($('.brand-search-page').length) { | @@ -118,7 +121,6 @@ if ($('.brand-search-page').length) { | ||
118 | 121 | ||
119 | $keyword.on('input', function() { | 122 | $keyword.on('input', function() { |
120 | if ($keyword.val().length) { | 123 | if ($keyword.val().length) { |
121 | - searchResult(); | ||
122 | $icon.css('color', '#000'); | 124 | $icon.css('color', '#000'); |
123 | $(this).closest('.search-box').css('width', '11.25rem'); | 125 | $(this).closest('.search-box').css('width', '11.25rem'); |
124 | $('.search-action').show(); | 126 | $('.search-action').show(); |
@@ -127,6 +129,7 @@ if ($('.brand-search-page').length) { | @@ -127,6 +129,7 @@ if ($('.brand-search-page').length) { | ||
127 | $(this).closest('.search-box').css('width', '12.5rem'); | 129 | $(this).closest('.search-box').css('width', '12.5rem'); |
128 | $('.search-action').hide(); | 130 | $('.search-action').hide(); |
129 | } | 131 | } |
132 | + searchResult(); | ||
130 | }).focus(); | 133 | }).focus(); |
131 | 134 | ||
132 | clearTextHammer = new Hammer($('.clear-text')[0]); | 135 | clearTextHammer = new Hammer($('.clear-text')[0]); |
@@ -19,6 +19,8 @@ var tip = require('../../plugin/tip'); | @@ -19,6 +19,8 @@ var tip = require('../../plugin/tip'); | ||
19 | 19 | ||
20 | var brandId = $('#brand-info').data('id'); | 20 | var brandId = $('#brand-info').data('id'); |
21 | 21 | ||
22 | +var jumpToApp = $('#jump-to-app').val(); | ||
23 | + | ||
22 | var mIntro, aIntro; | 24 | var mIntro, aIntro; |
23 | 25 | ||
24 | var moreHammer, likeHammer; | 26 | var moreHammer, likeHammer; |
@@ -71,6 +73,12 @@ likeHammer.on('tap', function(e) { | @@ -71,6 +73,12 @@ likeHammer.on('tap', function(e) { | ||
71 | var opt = 'ok', | 73 | var opt = 'ok', |
72 | $this = $(e.target); | 74 | $this = $(e.target); |
73 | 75 | ||
76 | + | ||
77 | + //jumpToApp = 1表示APP未登录的情况,此时不发送ajax请求而由a链接直接跳转APP | ||
78 | + if (jumpToApp === '1') { | ||
79 | + return; | ||
80 | + } | ||
81 | + | ||
74 | e.preventDefault(); | 82 | e.preventDefault(); |
75 | 83 | ||
76 | if ($this.hasClass('like')) { | 84 | if ($this.hasClass('like')) { |
1 | .good-list-page { | 1 | .good-list-page { |
2 | .search-input { | 2 | .search-input { |
3 | position: relative; | 3 | position: relative; |
4 | - padding: 7px 46px 7px 15px; | 4 | + padding: 7px 15px; |
5 | background: #f8f8f8; | 5 | background: #f8f8f8; |
6 | 6 | ||
7 | + > form { | ||
8 | + position: relative; | ||
9 | + } | ||
10 | + | ||
7 | .search-icon { | 11 | .search-icon { |
8 | position: absolute; | 12 | position: absolute; |
9 | font-size: 12px; | 13 | font-size: 12px; |
10 | - top: 16px; | ||
11 | - left: 24px; | 14 | + top: 9px; |
15 | + left: 10px; | ||
12 | } | 16 | } |
13 | 17 | ||
14 | input { | 18 | input { |
15 | height: 30px; | 19 | height: 30px; |
16 | - width: 95%; | 20 | + width: 85%; |
17 | border-radius: 15px; | 21 | border-radius: 15px; |
18 | text-indent: 26px; | 22 | text-indent: 26px; |
19 | background: #fff; | 23 | background: #fff; |
@@ -22,14 +26,13 @@ | @@ -22,14 +26,13 @@ | ||
22 | 26 | ||
23 | .clear-input { | 27 | .clear-input { |
24 | position: absolute; | 28 | position: absolute; |
25 | - top: 12px; | 29 | + top: 5px; |
26 | right: 50px; | 30 | right: 50px; |
27 | } | 31 | } |
28 | 32 | ||
29 | .search { | 33 | .search { |
30 | - position: absolute; | ||
31 | - top: 12px; | ||
32 | - right: .4rem; | 34 | + float: right; |
35 | + margin-top: 6px; | ||
33 | border: none; | 36 | border: none; |
34 | background: transparent; | 37 | background: transparent; |
35 | font-size: 16px; | 38 | font-size: 16px; |
@@ -52,6 +52,8 @@ | @@ -52,6 +52,8 @@ | ||
52 | </div> | 52 | </div> |
53 | {{/if}} | 53 | {{/if}} |
54 | 54 | ||
55 | + <input id="jump-to-app" type="hidden" value={{jumpToApp}}> | ||
56 | + | ||
55 | {{!-- wx-share --}} | 57 | {{!-- wx-share --}} |
56 | <input id="shareLink" type="hidden" value={{shareLink}}> | 58 | <input id="shareLink" type="hidden" value={{shareLink}}> |
57 | <input id="shareImg" type="hidden" value={{shareImg}}> | 59 | <input id="shareImg" type="hidden" value={{shareImg}}> |
-
Please register or login to post a comment