...
|
...
|
@@ -9,14 +9,6 @@ const helpers = global.yoho.helpers; |
|
|
const htmlProcess = require(`${global.utils}/html-process`);
|
|
|
const imageProcess = require(`${global.utils}/image`);
|
|
|
|
|
|
const privateKeyList = {
|
|
|
android: 'fd4ad5fcfa0de589ef238c0e7331b585',
|
|
|
iphone: 'a85bb0674e08986c6b115d5e3a4884fa',
|
|
|
ipad: 'ad9fcda2e679cf9229e37feae2cdcf80',
|
|
|
web: '0ed29744ed318fd28d2c07985d3ba633',
|
|
|
h5: 'fd4ad5fcfa0de589ef238c0e7331b585'
|
|
|
};
|
|
|
|
|
|
const formaData = (data, gender) => {
|
|
|
let build = [];
|
|
|
|
...
|
...
|
@@ -232,15 +224,13 @@ const getNewProduct = (brandId, gender, url, isApp) => { |
|
|
};
|
|
|
|
|
|
// 相关资讯--不能加cache,否则点赞有缓存.
|
|
|
const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => {
|
|
|
const getRelatedEditorial = (brandId, uid, udid, isApp) => {
|
|
|
|
|
|
return serviceAPI.get('guang/service/v1/article/getArticleByBrand', {
|
|
|
brand_id: brandId,
|
|
|
uid: uid,
|
|
|
udid: udid,
|
|
|
client_type: clientType,
|
|
|
limit: 3,
|
|
|
private_key: privateKeyList[clientType]
|
|
|
limit: 3
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
|
...
|
...
|
@@ -271,12 +261,10 @@ const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => { |
|
|
};
|
|
|
|
|
|
// 是否收藏
|
|
|
const isCollection = (brandId, clientType, uid) => {
|
|
|
const isCollection = (brandId, uid) => {
|
|
|
|
|
|
let param = {
|
|
|
brandId: brandId,
|
|
|
client_type: clientType,
|
|
|
private_key: privateKeyList[clientType]
|
|
|
brandId: brandId
|
|
|
};
|
|
|
|
|
|
if (uid) {
|
...
|
...
|
@@ -299,11 +287,10 @@ const isCollection = (brandId, clientType, uid) => { |
|
|
};
|
|
|
|
|
|
// 品牌详情
|
|
|
const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
|
|
|
const getDetailData = (id, uid, udid, gender, isApp) => {
|
|
|
|
|
|
return serviceAPI.get('guang/api/v1/plustar/getbrandinfo', {
|
|
|
id: id,
|
|
|
client_type: clientType
|
|
|
id: id
|
|
|
}, {cache: true}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
let list = result.data || [];
|
...
|
...
|
@@ -337,8 +324,7 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { |
|
|
shareLink: '//guang.m.yohobuy.com/plustar/brandinfo?id=' + id,
|
|
|
shareTitle: list.brand_name,
|
|
|
shareImg: list.brand_ico,
|
|
|
shareDesc: htmlProcess.removeHtml(list.brand_intro),
|
|
|
clientType: clientType
|
|
|
shareDesc: htmlProcess.removeHtml(list.brand_intro)
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -352,10 +338,10 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { |
|
|
/**
|
|
|
* [品牌详情异步数据]
|
|
|
*/
|
|
|
const getDetailDataAsync = (brandId, uid, udid, clientType, isApp) => {
|
|
|
const getDetailDataAsync = (brandId, uid, udid, isApp) => {
|
|
|
return Promise.all([
|
|
|
isCollection(brandId, clientType, uid),
|
|
|
getRelatedEditorial(brandId, uid, udid, clientType, isApp)
|
|
|
isCollection(brandId, uid),
|
|
|
getRelatedEditorial(brandId, uid, udid, isApp)
|
|
|
]).then((result) => {
|
|
|
return {
|
|
|
isLike: result[0],
|
...
|
...
|
|