...
|
...
|
@@ -5,6 +5,7 @@ |
|
|
const _ = require('lodash');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const api = global.yoho.API;
|
|
|
const stringProcess = require(`${global.utils}/string-process`);
|
|
|
|
|
|
/**
|
|
|
* 店铺品牌列表
|
...
|
...
|
@@ -30,6 +31,34 @@ const getShopBrands = (shopId) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取店铺信息
|
|
|
* @param {int} shopId 店铺id
|
|
|
* @param {int} uid 用户id 判断用户是否收藏店铺
|
|
|
* @return array
|
|
|
*/
|
|
|
const getShopInfo = (shopId, uid) => {
|
|
|
let finalParams = {
|
|
|
method: 'app.shops.getIntro',
|
|
|
shop_id: shopId,
|
|
|
};
|
|
|
|
|
|
if (!shopId || !stringProcess.isNumeric(shopId)) {
|
|
|
return Promise.resolve({});
|
|
|
}
|
|
|
|
|
|
if (uid && uid !== 'undefined') {
|
|
|
Object.assign(finalParams, {
|
|
|
uid: uid
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return api.get('', finalParams, {code: 200}).then((result) => {
|
|
|
return result && result.data;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getShopBrands
|
|
|
getShopBrands,
|
|
|
getShopInfo
|
|
|
}; |
...
|
...
|
|