Merge remote-tracking branch 'origin/gray' into gray
Showing
5 changed files
with
22 additions
and
7 deletions
@@ -326,14 +326,18 @@ const checkFav = (req, res) => { | @@ -326,14 +326,18 @@ const checkFav = (req, res) => { | ||
326 | co(function * () { | 326 | co(function * () { |
327 | 327 | ||
328 | let uid = req.user.uid; | 328 | let uid = req.user.uid; |
329 | - let pids = req.body.pidList.split(','); | ||
330 | let ret = { | 329 | let ret = { |
331 | - code: 200, | 330 | + code: 400, |
332 | message: '是否收藏', | 331 | message: '是否收藏', |
333 | data: {} | 332 | data: {} |
334 | }; | 333 | }; |
335 | 334 | ||
336 | - ret.data = yield service.checkUserIsFav(uid, pids); | 335 | + if (uid && req.body.pidList) { |
336 | + let pids = req.body.pidList.split(','); | ||
337 | + | ||
338 | + Object.assign(ret, {code: 200, | ||
339 | + data: yield service.checkUserIsFav(uid, pids)}); | ||
340 | + } | ||
337 | 341 | ||
338 | return res.send(ret); | 342 | return res.send(ret); |
339 | })(); | 343 | })(); |
@@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
72 | {{#unless changedQuery}} | 72 | {{#unless changedQuery}} |
73 | 73 | ||
74 | <div class="search-suggest-less"> | 74 | <div class="search-suggest-less"> |
75 | - "<em>{{name}}</em>" 搜索结果太少了,试试{{#suggest}} "<a href="/?query={{.}}&is_rec=Y">{{.}}</a>" {{/suggest}}关键词搜索 | 75 | + <em>"{{name}}"</em> 搜索结果太少了,试试{{#suggest}} "<a href="/?query={{.}}&is_rec=Y">{{.}}</a>" {{/suggest}}关键词搜索 |
76 | </div> | 76 | </div> |
77 | {{/unless}} | 77 | {{/unless}} |
78 | {{/if}} | 78 | {{/if}} |
@@ -80,7 +80,7 @@ | @@ -80,7 +80,7 @@ | ||
80 | 80 | ||
81 | {{#if changedQuery}} | 81 | {{#if changedQuery}} |
82 | <div class="search-suggest-less"> | 82 | <div class="search-suggest-less"> |
83 | - 没有找到 "<em>{{name}}</em>" 相关的商品, | 83 | + 没有找到 <em>"{{name}}"</em> 相关的商品, |
84 | 为您推荐 "<a href="/?query={{suggestFirst}}&is_rec=Y">{{suggestFirst}}</a>" 的搜索结果。{{#if suggestSecond}}或者试试{{#suggestSecond}} "<a href="/?query={{.}}&is_rec=Y">{{.}}</a>" {{/suggestSecond}}{{/if}} | 84 | 为您推荐 "<a href="/?query={{suggestFirst}}&is_rec=Y">{{suggestFirst}}</a>" 的搜索结果。{{#if suggestSecond}}或者试试{{#suggestSecond}} "<a href="/?query={{.}}&is_rec=Y">{{.}}</a>" {{/suggestSecond}}{{/if}} |
85 | </div> | 85 | </div> |
86 | {{/if}} | 86 | {{/if}} |
@@ -85,6 +85,10 @@ function isCheckFav() { | @@ -85,6 +85,10 @@ function isCheckFav() { | ||
85 | pidArray.push($(this).data('pid')); | 85 | pidArray.push($(this).data('pid')); |
86 | }); | 86 | }); |
87 | 87 | ||
88 | + if (!pidArray.length) { | ||
89 | + return false; | ||
90 | + } | ||
91 | + | ||
88 | $.ajax({ | 92 | $.ajax({ |
89 | type: 'POST', | 93 | type: 'POST', |
90 | url: '/cart/cart/checkFav', | 94 | url: '/cart/cart/checkFav', |
1 | -.search-suggest-less{ | 1 | +.search-suggest-less { |
2 | box-sizing: border-box; | 2 | box-sizing: border-box; |
3 | width: 100%; | 3 | width: 100%; |
4 | line-height: 22px; | 4 | line-height: 22px; |
@@ -9,16 +9,23 @@ | @@ -9,16 +9,23 @@ | ||
9 | padding-bottom: 10px; | 9 | padding-bottom: 10px; |
10 | padding-left: 9px; | 10 | padding-left: 9px; |
11 | margin-bottom: 10px; | 11 | margin-bottom: 10px; |
12 | + | ||
12 | em { | 13 | em { |
14 | + display: inline-block; | ||
15 | + max-width: 950px; | ||
16 | + word-break: break-all; | ||
17 | + word-wrap: break-word; | ||
13 | font-weight: normal; | 18 | font-weight: normal; |
14 | font-style: normal; | 19 | font-style: normal; |
15 | } | 20 | } |
21 | + | ||
16 | a { | 22 | a { |
17 | color: #d0021b; | 23 | color: #d0021b; |
18 | cursor: pointer; | 24 | cursor: pointer; |
19 | text-decoration: underline; | 25 | text-decoration: underline; |
20 | } | 26 | } |
21 | } | 27 | } |
28 | + | ||
22 | .filter-box { | 29 | .filter-box { |
23 | border: 1px solid #dfdfdf; | 30 | border: 1px solid #dfdfdf; |
24 | 31 |
-
Please register or login to post a comment