|
|
var $ = require('yoho-jquery');
|
|
|
|
|
|
module.exports.getFavNum = function(sid, bid) {
|
|
|
exports.getFavNum = function(sid, bid) {
|
|
|
return $.getJSON('/product/index/favnum', {sid: sid, bid: bid})
|
|
|
.then(function(result) {
|
|
|
if (result.code === 200) {
|
...
|
...
|
@@ -11,9 +11,9 @@ module.exports.getFavNum = function(sid, bid) { |
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports.addFav = function(sid, bid) {
|
|
|
exports.addFav = function(sid, bid) {
|
|
|
if (!getUid()) {
|
|
|
return window.jumpUrl(window.signinUrl());
|
|
|
return $.Deferred().reject(window.jumpUrl(window.signinUrl())).promise();
|
|
|
}
|
|
|
|
|
|
if (sid) {
|
...
|
...
|
@@ -47,9 +47,9 @@ module.exports.addFav = function(sid, bid) { |
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports.cancelFav = function(sid, bid) {
|
|
|
exports.cancelFav = function(sid, bid) {
|
|
|
if (!getUid()) {
|
|
|
return window.jumpUrl(window.signinUrl());
|
|
|
return $.Deferred().reject(window.jumpUrl(window.signinUrl())).promise();
|
|
|
}
|
|
|
|
|
|
if (sid) {
|
...
|
...
|
@@ -84,7 +84,7 @@ module.exports.cancelFav = function(sid, bid) { |
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports.statusFav = function(sid, bid) {
|
|
|
exports.statusFav = function(sid, bid) {
|
|
|
if (sid) {
|
|
|
return $.post('/product/index/isFavoriteShop', {
|
|
|
shopId: sid
|
...
|
...
|
|