Authored by 郭成尧

'收藏店铺优化'

... ... @@ -52,7 +52,7 @@ module.exports = {
}).catch(next);
},
/* 收藏店铺 */
/* 收藏品牌或者店铺 */
collectShop: (req, res, next) => {
if (!req.user.uid) {
return res.json({
... ... @@ -62,10 +62,10 @@ module.exports = {
}
shopModel.collectShopData({
shopId: req.body.shopId,
favId: req.body.favId,
id: req.body.isBlkShop ? req.body.shopId : req.body.brandId,
favId: req.body.isBlkShop ? req.body.shopId : req.body.brandId,
uid: req.user.uid,
type: 'brand',
type: req.body.isBlkShop ? 'shop' : 'brand',
isFav: req.body.isFav
}).then(result => {
res.json(result);
... ...
... ... @@ -103,8 +103,8 @@ module.exports = {
*/
collectShopOriginData(params) {
let finalParams = {
id: params.shopId,
fav_id: params.shopId,
id: params.id,
fav_id: params.favId,
uid: params.uid,
type: params.type
};
... ...
... ... @@ -28,7 +28,8 @@ const getShopData = params => {
/* 品牌名称 */
Object.assign(finalResult, {
brandName: result.data.brand_name
brandName: result.data.brand_name,
brandId: result.data.id
});
/* 品牌是否有店铺 */
... ...
... ... @@ -89,6 +89,7 @@
isBlkShop: result.isBlkShop,
domain: locationQuery.domain,
brandName: result.brandName,
brandId: result.brandId, // 不是分享的参数,收藏店铺使用
shopId: result.shopId, // 不是分享的参数,收藏店铺使用
isFav: result.isFav // 不是分享的参数,收藏店铺使用
};
... ...
... ... @@ -84,8 +84,10 @@
/* 收藏或者取消收藏店铺 */
collectShop() {
let data = {
brandId: this.shareData.brandId,
shopId: this.shareData.shopId,
isFav: this.shareData.isFav
isFav: this.shareData.isFav,
isBlkShop: this.shareData.isBlkShop
};
$.post({
... ...