Authored by zhangxiaoru

动态获取收藏状态

... ... @@ -2,7 +2,7 @@
const shopModel = require('../models/shopCollect'),
headerModel = require('../../../doraemon/models/header'),
_ = require('lodash');
const crypto = global.yoho.crypto;
const shopIndex = (req, res) => {
... ... @@ -54,7 +54,7 @@ const shopList = (req, res, next) => {
}).catch(next);
};
//获取文章收藏状态
// 获取文章收藏状态
const shopFav = (req, res, next) => {
let uid = req.query.uid || req.user.uid || '';
let shopIds = req.query.shopIds;
... ...
... ... @@ -54,7 +54,7 @@ function shopFav(shopIds) {
error: function() {
tip.show('网络断开连接了~');
}
})
});
}
// 店铺列表数据
... ... @@ -82,14 +82,14 @@ function shopListData(tabName, stoping) {
stoping = false;
//获取收藏状态
// 获取收藏状态
$('.shop-list').find('.shop-info').each(function() {
var id = $(this).data('id');
if(id) {
if (id) {
ids.push(id);
}
})
});
shopFav(ids.join(','));
... ...