Authored by yyq

分享相关

... ... @@ -241,7 +241,7 @@ const index = (req, res, next) => {
// }
// };
Item.getProductItemData(req.params, req.user.uid).then(result => {
Item.getProductItemData(req.params, req.url, req.user.uid).then(result => {
if (_.isEmpty(result)) {
return next();
}
... ...
... ... @@ -360,6 +360,14 @@ const setProductData = base => {
}
}
// 分享相关,产品的链接
resData.share = {
weixinUrl: helpers.urlFormat(base.mainPath),
shareTitle: resData.name,
shareImg: resData.img,
shareDesc: base.phrase
};
return resData;
};
... ...
... ... @@ -40,7 +40,7 @@ const _getMultiResourceByBaseInfo = (base) => {
});
};
let getProductItemData = (params, uid) => {
let getProductItemData = (params, url, uid) => {
let pid = params[0];
// let gid = params[1];
... ... @@ -55,6 +55,7 @@ let getProductItemData = (params, uid) => {
}
result.uid = uid;
result.mainPath = url;
// 商品基本信息
data.goodInfo = itemFUN.setProductData(result);
... ...
... ... @@ -30,6 +30,7 @@ var thumbsLoaded = [],
id = $main.data('id');
require('../common/header');
require('../plugins/share');
lazyload($('img.lazy'));
... ... @@ -103,8 +104,6 @@ $thumbWrap.each(function() {
}
});
// $thumbWrap.parent().animate({visibility: 'visible'});
$thumbWrap.parent().removeClass('hide');
// 展示图
... ... @@ -161,7 +160,7 @@ $('.size-list').on('click', 'li', function() {
$this.addClass('cur');
}
});
// 加入购物袋
$addToBag.click(function() {
var sku = getBuyProduct();
... ... @@ -181,7 +180,12 @@ $addToBag.click(function() {
});
}
});
// 继续购物
$('#keep-shopping').click(function() {
$balanceWrapper.slideUp(SLIDETIME);
$tradeWrapper.slideDown(SLIDETIME);
});
// 商品收藏
$('#collect-product').click(function() {
var $this = $(this),
param = {
... ... @@ -204,5 +208,4 @@ $('#collect-product').click(function() {
location.href = data.data.refer;
}
});
});
... ...