Authored by ccbikai

赠品接口修改

... ... @@ -35,7 +35,7 @@ const _getUserProfile = (uid) => {
* @param {array}
* @return {array}
*/
const _getShopsInfo = (data) => {
const _processShopsInfo = (data) => {
let enterStore = [];
_.forEach(data, function(value) {
... ... @@ -529,6 +529,36 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => {
return dest;
};
let _getShopsInfo = (brandId) => {
return api.get('', {
method: 'app.shop.queryShopsByBrandId',
brand_id: _.toString(brandId)
}, {
cache: true
}).then(shops => {
if (shops.code === 200) {
return _processShopsInfo(shops.data);
}
return [];
});
};
let _getPromotionInfo = (skn) => {
return api.get('', {
method: 'app.product.promotion',
product_skn: _.toString(skn)
}, {
cache: true
}).then((result) => {
if (result.code === 200) {
return result.data;
}
return {};
});
};
let getProductData = (data) => {
let finalResult;
let params = {
... ... @@ -546,20 +576,15 @@ let getProductData = (data) => {
return api.get('', params, {
cache: true
}).then(result => {
finalResult = _detailDataPkg(result, data.uid, data.vipLevel, data.ua);
return api.get('', {
method: 'app.shop.queryShopsByBrandId',
brand_id: _.toString(result.brandId)
}, {
cache: true
}).then(shops => {
if (shops.code === 200) {
finalResult.enterStore = _getShopsInfo(shops.data);
}
return Promise.all([_getShopsInfo(result.brandId), _getPromotionInfo(result.erpProductId)]).then((info) => {
result.promotionBoList = info[1];
finalResult = _detailDataPkg(result, data.uid, data.vipLevel, data.ua);
finalResult.enterStore = info[0];
return finalResult;
});
});
});
};
... ...
... ... @@ -8,8 +8,8 @@ var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer'),
lazyLoad = require('yoho-jquery-lazyload');
var $discountFolder = $('.goodsDiscount .discount-folder'),
$discountArrow = $('.goodsDiscount .first-item span');
var $discountFolder = $('.goods-discount .discount-folder'),
$discountArrow = $('.goods-discount .first-item span');
var goodsDiscountEl = document.getElementById('goodsDiscount'),
goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl),
... ...
... ... @@ -694,10 +694,12 @@ $basicBtnC: #eb0313;
position: relative;
position: fixed;
bottom: 0;
left: 50%;
margin-left: -320px;
z-index: 2;
box-sizing: border-box;
padding: 20px 28px;
width: 100%;
width: 640px;
height: 120px;
border-top: 1px solid $borderC;
background-color: #fff;
... ...