Showing
2 changed files
with
26 additions
and
51 deletions
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-03-23 11:31:51 | 3 | * @Date: 2017-03-23 11:31:51 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-03-31 11:49:21 | 5 | + * @Last Modified time: 2017-03-31 17:50:46 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /** ***************** | 8 | /** ***************** |
@@ -16,6 +16,28 @@ let $collect = $('#collect'); | @@ -16,6 +16,28 @@ let $collect = $('#collect'); | ||
16 | const shopId = $('#shopId').val(); | 16 | const shopId = $('#shopId').val(); |
17 | 17 | ||
18 | /** | 18 | /** |
19 | + * 异步检测是否已经收藏 | ||
20 | + */ | ||
21 | +$.ajax({ | ||
22 | + type: 'GET', | ||
23 | + url: location.protocol + '//m.yohobuy.com/product/index/shopFav', | ||
24 | + xhrFields: { | ||
25 | + withCredentials: true | ||
26 | + }, | ||
27 | + data: { | ||
28 | + shopId: shopId | ||
29 | + }, | ||
30 | + success: function(data) { | ||
31 | + if (data.collect) { | ||
32 | + $collect.attr('class', 'already-collect'); | ||
33 | + } | ||
34 | + }, | ||
35 | + error: function() { | ||
36 | + tip.show('网络断开连接了~'); | ||
37 | + } | ||
38 | +}); | ||
39 | + | ||
40 | +/** | ||
19 | * 异步加载人气单品 | 41 | * 异步加载人气单品 |
20 | */ | 42 | */ |
21 | $.each($goodsContainer, function(index, elem) { | 43 | $.each($goodsContainer, function(index, elem) { |
@@ -11,55 +11,6 @@ | @@ -11,55 +11,6 @@ | ||
11 | clear: both; | 11 | clear: both; |
12 | } | 12 | } |
13 | 13 | ||
14 | - .shop-info { | ||
15 | - position: relative; | ||
16 | - padding-right: 30px; | ||
17 | - padding-left: 30px; | ||
18 | - height: 234px; | ||
19 | - | ||
20 | - .logo { | ||
21 | - position: absolute; | ||
22 | - width: 120px; | ||
23 | - height: 120px; | ||
24 | - box-shadow: 0 0 2px 1px #dedede; | ||
25 | - } | ||
26 | - | ||
27 | - .shopname { | ||
28 | - font-size: 32px; | ||
29 | - color: #444; | ||
30 | - margin-left: 180px; | ||
31 | - } | ||
32 | - | ||
33 | - .favs-btn { | ||
34 | - margin-left: 30px; | ||
35 | - | ||
36 | - &.like { | ||
37 | - color: #e33333; | ||
38 | - } | ||
39 | - } | ||
40 | - } | ||
41 | - | ||
42 | - .shop-intro { | ||
43 | - font-size: 28px; | ||
44 | - color: #444; | ||
45 | - | ||
46 | - .hide { | ||
47 | - display: none; | ||
48 | - } | ||
49 | - | ||
50 | - .active { | ||
51 | - display: block; | ||
52 | - } | ||
53 | - } | ||
54 | - | ||
55 | - .shop-intro-folder { | ||
56 | - margin-top: 26px; | ||
57 | - margin-bottom: 24px; | ||
58 | - text-align: center; | ||
59 | - font-size: 18px; | ||
60 | - line-height: 1; | ||
61 | - } | ||
62 | - | ||
63 | .branner-top { | 14 | .branner-top { |
64 | width: 100%; | 15 | width: 100%; |
65 | height: 234px; | 16 | height: 234px; |
@@ -92,16 +43,18 @@ | @@ -92,16 +43,18 @@ | ||
92 | 43 | ||
93 | .fav-box { | 44 | .fav-box { |
94 | position: absolute; | 45 | position: absolute; |
95 | - bottom: 30px; | 46 | + bottom: 20px; |
96 | right: 30px; | 47 | right: 30px; |
97 | border-radius: 10px; | 48 | border-radius: 10px; |
98 | text-align: center; | 49 | text-align: center; |
99 | background-size: contain; | 50 | background-size: contain; |
100 | color: #fff; | 51 | color: #fff; |
52 | + font-size: 28px; | ||
101 | 53 | ||
102 | .favs { | 54 | .favs { |
103 | line-height: 48px; | 55 | line-height: 48px; |
104 | margin-right: 16px; | 56 | margin-right: 16px; |
57 | + padding-top: 4px; | ||
105 | } | 58 | } |
106 | } | 59 | } |
107 | 60 |
-
Please register or login to post a comment