...
|
...
|
@@ -11,7 +11,7 @@ const _ = require('lodash'); |
|
|
|
|
|
exports.index = (req, res) => {
|
|
|
const shoppingKey = req.cookies._SPK || null;
|
|
|
const uid = req.user.uid || null;
|
|
|
const uid = '14555212'; // req.user.uid || null;
|
|
|
|
|
|
cartModel.getCartData(shoppingKey, uid).then((result) => {
|
|
|
if (result.code === 200) {
|
...
|
...
|
@@ -96,7 +96,7 @@ exports.changeProductNum = (req, res) => { |
|
|
// 删除商品
|
|
|
exports.removeProduct = (req, res) => {
|
|
|
const params = {};
|
|
|
const uid = req.user.uid;
|
|
|
const uid = '14555212';// req.user.uid;
|
|
|
const shoppingKey = req.cookies._SPK;
|
|
|
const productSkuList = req.body.skuList;
|
|
|
|
...
|
...
|
@@ -122,9 +122,23 @@ exports.removeProduct = (req, res) => { |
|
|
|
|
|
// 收藏商品
|
|
|
exports.sendToFavorite = (req, res) => {
|
|
|
// TODO
|
|
|
res.json({
|
|
|
code: '0'
|
|
|
const params = {};
|
|
|
const uid = '14555212';// req.user.uid;
|
|
|
const productSkuList = req.body.skuList;
|
|
|
|
|
|
if (uid) {
|
|
|
_.merge(params, {uid});
|
|
|
}
|
|
|
|
|
|
if (productSkuList) {
|
|
|
_.merge(params, {product_sku_list: productSkuList});
|
|
|
}
|
|
|
|
|
|
console.log('transferToFavorite---params:', params);
|
|
|
|
|
|
cartModel.transferToFavorite(params).then(result => {
|
|
|
console.log('transferToFavorite-result:', result);
|
|
|
res.json(_.merge(cartModel.filterCartData(result, uid), {code: result.code, message: result.message}));
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
|