...
|
...
|
@@ -95,12 +95,12 @@ const _getShopDecorator = (shopId) => { |
|
|
method: 'app.shopsdecorator.getList',
|
|
|
shop_id: shopId
|
|
|
}, {
|
|
|
cache: true
|
|
|
cache: true,
|
|
|
code: 200
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
if (result.data) {
|
|
|
return camelCase(result.data);
|
|
|
} else {
|
|
|
logger.error('get shop all resources api return code is not 200');
|
|
|
return '';
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -117,11 +117,10 @@ const _getShopInfo = (shopId, uid) => { |
|
|
method: 'app.shops.getIntro',
|
|
|
shop_id: shopId,
|
|
|
uid: uid || 0
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
}, {code: 200}).then((result) => {
|
|
|
if (result.data) {
|
|
|
return camelCase(result.data);
|
|
|
} else {
|
|
|
logger.error('get shop info api return code is not 200');
|
|
|
return {};
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -139,11 +138,10 @@ const _getShopCategory = (shopId, channel, gender) => { |
|
|
yh_channel: yhChannel[channel],
|
|
|
gender: gender || '1,3',
|
|
|
shop_id: shopId
|
|
|
}).then(result => {
|
|
|
}, {code: 200}).then(result => {
|
|
|
if (result && result.code === 200) {
|
|
|
return camelCase(result.data);
|
|
|
} else {
|
|
|
logger.error('get shop all classify api return code is not 200');
|
|
|
return {};
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -163,7 +161,7 @@ const _shopCouponsList = (shopId, uid) => { |
|
|
_.assign(params, {uid: uid});
|
|
|
}
|
|
|
|
|
|
return api.get('', params).then(result => {
|
|
|
return api.get('', params, {code: 200}).then(result => {
|
|
|
if (result.data) {
|
|
|
let shopCoupons = [];
|
|
|
|
...
|
...
|
@@ -200,7 +198,7 @@ const receiveCoupon = (uid, couponId) => { |
|
|
method: 'app.promotion.getCoupon',
|
|
|
couponId: couponId,
|
|
|
uid: uid
|
|
|
}).then(result => {
|
|
|
}, {code: 200}).then(result => {
|
|
|
return result;
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -213,12 +211,11 @@ const getShopBrands = (shopId) => { |
|
|
return api.get('', {
|
|
|
method: 'app.shops.getShopsBrands',
|
|
|
shop_id: shopId
|
|
|
}).then((result) => {
|
|
|
}, {code: 200}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
result = camelCase(result.data);
|
|
|
return result[0].brandId;
|
|
|
} else {
|
|
|
logger.error('gGet all the brands under the shop return code is not 200');
|
|
|
return {};
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -234,7 +231,7 @@ const searchProductBySkn = (productSkn) => { |
|
|
return api.get('', {
|
|
|
method: 'h5.product.batch',
|
|
|
productSkn: productSkn,
|
|
|
}).then(result => {
|
|
|
}, {code: 200}).then(result => {
|
|
|
return _.get(result, 'data.product_list', []);
|
|
|
});
|
|
|
};
|
...
|
...
|
|