...
|
...
|
@@ -13,6 +13,7 @@ const favoriteService = require('../models/favorite-service'); |
|
|
const index = (req, res, next)=> {
|
|
|
let uid = '8041246';
|
|
|
let udid = '8041246';
|
|
|
|
|
|
co(function*() {
|
|
|
let page = req.query.page || 1;
|
|
|
let type = req.query.type || 'article';
|
...
|
...
|
@@ -20,26 +21,30 @@ const index = (req, res, next)=> { |
|
|
let reduction = req.query.is_reduction || 'N';
|
|
|
let promotion = req.query.is_promotion || 'N';
|
|
|
let limit = 10, data = {};
|
|
|
|
|
|
data.tabs = favoriteService.getFavoriteTabs(type);
|
|
|
|
|
|
switch (type) {
|
|
|
case 'brand':
|
|
|
data.favBrands = yield favoriteService.favoriteBrandList(uid, page, limit, type);
|
|
|
|
|
|
break;
|
|
|
case 'article':
|
|
|
data.favArticles = yield favoriteService.favoriteArticleList(uid, udid, page, limit, type);
|
|
|
|
|
|
break;
|
|
|
default:
|
|
|
data.favProducts = yield favoriteService.favoriteProductList(uid, page, limit, type, sort, 'N', reduction, promotion);
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
console.log(data);
|
|
|
res.render("favorite", {
|
|
|
res.render('favorite', {
|
|
|
meFavoritePage: true,
|
|
|
meFavorite: data
|
|
|
});
|
|
|
})();
|
|
|
}
|
|
|
})().then(next);
|
|
|
};
|
|
|
|
|
|
const reductionAction = ()=> {
|
|
|
|
...
|
...
|
|