...
|
...
|
@@ -135,46 +135,6 @@ const _getShopCategory = (shopId, channel, gender) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 獲取店鋪優惠券
|
|
|
* @private
|
|
|
*/
|
|
|
const _shopCouponsList = (shopId, uid) => {
|
|
|
let params = {
|
|
|
method: 'shop.coupons.list',
|
|
|
shop_id: shopId
|
|
|
};
|
|
|
|
|
|
if (uid) {
|
|
|
_.assign(params, {uid: uid});
|
|
|
}
|
|
|
|
|
|
return api.get('', params, {code: 200}).then(result => {
|
|
|
if (result.data) {
|
|
|
let shopCoupons = [];
|
|
|
|
|
|
_.forEach(result.data, value => {
|
|
|
let couPonstatus = parseInt(value.status, 10);
|
|
|
|
|
|
if (couPonstatus === 1 || couPonstatus === 3) {
|
|
|
shopCoupons.push({
|
|
|
validity: value.couponValidity,
|
|
|
id: crypto.encryption('', value.coupon_id + ''),
|
|
|
name: value.coupon_name,
|
|
|
pic: value.coupon_pic,
|
|
|
money: parseInt(value.money, 10),
|
|
|
status: couPonstatus === 1
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return shopCoupons;
|
|
|
} else {
|
|
|
return [];
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* TODO TAR 店铺和品牌收藏状态调用新的接口
|
|
|
* 调用接口获取品牌或者店铺的收藏状态
|
|
|
* @private
|
...
|
...
|
@@ -558,8 +518,7 @@ const getShopData = (req, shopId, uid, isApp) => { |
|
|
brand: brandData.join(','),
|
|
|
order: '0',
|
|
|
channel: channel
|
|
|
}),
|
|
|
_shopCouponsList(shopId, uid)
|
|
|
})
|
|
|
]).then((result) => {
|
|
|
shopData = {
|
|
|
decorator: shopDeco, // 店铺装修资源数据
|
...
|
...
|
@@ -577,9 +536,6 @@ const getShopData = (req, shopId, uid, isApp) => { |
|
|
shopFilterSearchData.goods = productProcess.processProductList(result[0].product_list || [], {isApp: isApp});
|
|
|
}
|
|
|
|
|
|
/* 店铺优惠券 */
|
|
|
let shopCoupons = result[1] || [];
|
|
|
|
|
|
// 店铺分类
|
|
|
return _getShopCategory(shopId, channel).then(shopCategory => {
|
|
|
|
...
|
...
|
@@ -594,9 +550,7 @@ const getShopData = (req, shopId, uid, isApp) => { |
|
|
{
|
|
|
shopId: shopId,
|
|
|
uid: uid ? crypto.encryption('', uid + '') : '',
|
|
|
coverChannel: channel,
|
|
|
shopCoupons: shopCoupons,
|
|
|
shopCouponsOne: shopCoupons.length === 1
|
|
|
coverChannel: channel
|
|
|
}
|
|
|
);
|
|
|
});
|
...
|
...
|
|