Authored by htoooth

add fix

@@ -102,7 +102,7 @@ router.get('/shop/couponsync', list.shopCouponSync); @@ -102,7 +102,7 @@ router.get('/shop/couponsync', list.shopCouponSync);
102 router.get('/brand/couponsync', list.brandCouponSync); 102 router.get('/brand/couponsync', list.brandCouponSync);
103 103
104 router.get('/shoplist', list.shopList); // 店铺列表页 104 router.get('/shoplist', list.shopList); // 店铺列表页
105 -router.post('/shop/togglecollect', auth, favorite.collectShop); // 店铺收藏 105 +router.post('/shop/togglecollect', favorite.collectShop); // 店铺收藏
106 router.post('/index/isFavoriteShop', favorite.isFavShop); // 判断用户是否收藏店铺 106 router.post('/index/isFavoriteShop', favorite.isFavShop); // 判断用户是否收藏店铺
107 107
108 // 品牌页水牌 108 // 品牌页水牌
@@ -880,7 +880,7 @@ $('#brand-favour').click(function() { @@ -880,7 +880,7 @@ $('#brand-favour').click(function() {
880 default: 880 default:
881 return $.Deferred.reject().promise(); 881 return $.Deferred.reject().promise();
882 } 882 }
883 - }).then(function() { 883 + }()).then(function() {
884 $this.toggleClass('coled'); 884 $this.toggleClass('coled');
885 }); 885 });
886 }); 886 });
1 var $ = require('yoho-jquery'); 1 var $ = require('yoho-jquery');
2 2
3 -module.exports.getFavNum = function(sid, bid) { 3 +exports.getFavNum = function(sid, bid) {
4 return $.getJSON('/product/index/favnum', {sid: sid, bid: bid}) 4 return $.getJSON('/product/index/favnum', {sid: sid, bid: bid})
5 .then(function(result) { 5 .then(function(result) {
6 if (result.code === 200) { 6 if (result.code === 200) {
@@ -11,9 +11,9 @@ module.exports.getFavNum = function(sid, bid) { @@ -11,9 +11,9 @@ module.exports.getFavNum = function(sid, bid) {
11 }); 11 });
12 }; 12 };
13 13
14 -module.exports.addFav = function(sid, bid) { 14 +exports.addFav = function(sid, bid) {
15 if (!getUid()) { 15 if (!getUid()) {
16 - return window.jumpUrl(window.signinUrl()); 16 + return $.Deferred().reject(window.jumpUrl(window.signinUrl())).promise();
17 } 17 }
18 18
19 if (sid) { 19 if (sid) {
@@ -47,9 +47,9 @@ module.exports.addFav = function(sid, bid) { @@ -47,9 +47,9 @@ module.exports.addFav = function(sid, bid) {
47 } 47 }
48 }; 48 };
49 49
50 -module.exports.cancelFav = function(sid, bid) { 50 +exports.cancelFav = function(sid, bid) {
51 if (!getUid()) { 51 if (!getUid()) {
52 - return window.jumpUrl(window.signinUrl()); 52 + return $.Deferred().reject(window.jumpUrl(window.signinUrl())).promise();
53 } 53 }
54 54
55 if (sid) { 55 if (sid) {
@@ -84,7 +84,7 @@ module.exports.cancelFav = function(sid, bid) { @@ -84,7 +84,7 @@ module.exports.cancelFav = function(sid, bid) {
84 } 84 }
85 }; 85 };
86 86
87 -module.exports.statusFav = function(sid, bid) { 87 +exports.statusFav = function(sid, bid) {
88 if (sid) { 88 if (sid) {
89 return $.post('/product/index/isFavoriteShop', { 89 return $.post('/product/index/isFavoriteShop', {
90 shopId: sid 90 shopId: sid
@@ -48,7 +48,7 @@ function addAsync(skn, sku) { @@ -48,7 +48,7 @@ function addAsync(skn, sku) {
48 } 48 }
49 } 49 }
50 50
51 -module.exports = { 51 +exports = {
52 statusAsync: statusAsync, 52 statusAsync: statusAsync,
53 addAsync: addAsync 53 addAsync: addAsync
54 }; 54 };
@@ -108,7 +108,7 @@ module.exports = function(opts) { @@ -108,7 +108,7 @@ module.exports = function(opts) {
108 108
109 if ($.isArray(arr) && arr.length) { 109 if ($.isArray(arr) && arr.length) {
110 110
111 - arr.forEach((val) => { 111 + arr.forEach(function(val) {
112 if (val === '.') { 112 if (val === '.') {
113 ret += '<a>...</a>'; 113 ret += '<a>...</a>';
114 } else { 114 } else {