Showing
1 changed file
with
22 additions
and
0 deletions
@@ -81,3 +81,25 @@ $collectShopIcon.on('click', () => { | @@ -81,3 +81,25 @@ $collectShopIcon.on('click', () => { | ||
81 | collectOrNotShop('ok'); | 81 | collectOrNotShop('ok'); |
82 | } | 82 | } |
83 | }); | 83 | }); |
84 | + | ||
85 | +// 获取是否收藏 | ||
86 | +(function() { | ||
87 | + $.ajax({ | ||
88 | + type: 'GET', | ||
89 | + url: location.protocol + '//m.yohobuy.com/product/index/shopFav', | ||
90 | + xhrFields: { | ||
91 | + withCredentials: true | ||
92 | + }, | ||
93 | + data: { | ||
94 | + shopId: shopId, | ||
95 | + }, | ||
96 | + success: function(data) { | ||
97 | + if (data.collect) { | ||
98 | + $collectShopIcon.addClass('coled'); | ||
99 | + } | ||
100 | + }, | ||
101 | + error: function() { | ||
102 | + tip.show('网络断开连接了~'); | ||
103 | + } | ||
104 | + }); | ||
105 | +}()); |
-
Please register or login to post a comment