...
|
...
|
@@ -24,6 +24,7 @@ const fav = { |
|
|
},
|
|
|
favpaging: (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
uid = 20000134; // 测试uid
|
|
|
|
|
|
const tab = req.query.tab;
|
...
|
...
|
@@ -33,6 +34,7 @@ const fav = { |
|
|
|
|
|
if (tab === 'brand') {
|
|
|
const gender = '1,2,3'; // todo 获取频道的性别
|
|
|
|
|
|
favModel.getFavBrandData(uid, gender, page, 10).then(data => {
|
|
|
if (data && page <= data.page_total) {
|
|
|
data.brand_list.forEach(function(d) {
|
...
|
...
|
@@ -41,7 +43,7 @@ const fav = { |
|
|
link: '', // todo
|
|
|
imgUrl: d.brand_ico ? helpers.image(d.brand_ico, 160, 125) : '',
|
|
|
brandName: d.brand_name,
|
|
|
down: d.status == 0
|
|
|
down: d.status === 0
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -63,6 +65,7 @@ const fav = { |
|
|
}
|
|
|
|
|
|
let link = '';
|
|
|
|
|
|
if (d.goodsId && d.cnAlphabet) {
|
|
|
link = helpers.urlFormat(`/product/pro_${d.product_id}_${d.goodsId}/${d.cnAlphabet}.html`);
|
|
|
}
|
...
|
...
|
@@ -75,7 +78,7 @@ const fav = { |
|
|
price: '¥' + Number(Math.max(d.market_price, 0)).toFixed(2),
|
|
|
discountPrice: (Number(d.market_price) - Number(d.sales_price) > 0) ? '¥' + Number(Math.max(d.sales_price, 0)).toFixed(2) : false,
|
|
|
sellOut: d.storage < 0,
|
|
|
invalidGoods: d.status == 0
|
|
|
invalidGoods: d.status === 0
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -92,14 +95,16 @@ const fav = { |
|
|
},
|
|
|
deletefav: (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
uid = 20000134; // 测试uid
|
|
|
|
|
|
const favId = req.body.favId;
|
|
|
const type = req.body.type;
|
|
|
|
|
|
favModel.favoriteDelete(uid, favId, type).then(data => {
|
|
|
return res.json(data);
|
|
|
}).catch(next);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports = fav; |
...
|
...
|
|