...
|
...
|
@@ -160,7 +160,7 @@ const _processHeadData = (list) => { |
|
|
isLike: data.isPraise,
|
|
|
isCollected: data.isFavor,
|
|
|
likeNum: data.praiseNum,
|
|
|
weixinUrl: `http://guang.m.yohobuy.com/info/index?id=${data.id}`
|
|
|
weixinUrl: `http://m.yohoblk.com/${data.id}.html`
|
|
|
};
|
|
|
|
|
|
}
|
...
|
...
|
@@ -214,7 +214,7 @@ const _getRelatedData = (idList) => { |
|
|
productSkn: idList,
|
|
|
method: 'h5.product.batch'
|
|
|
}).then((result) => {
|
|
|
// console.log(result)
|
|
|
|
|
|
let productList = [];
|
|
|
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -229,6 +229,7 @@ const _getRelatedData = (idList) => { |
|
|
productSkn: data.product_skn
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return productList;
|
|
|
} else {
|
|
|
logger.error('推荐商品 cood 不是 200');
|
...
|
...
|
@@ -358,7 +359,6 @@ const _processContentData = (list) => { |
|
|
delete related.relatedGroup[key];
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -495,11 +495,18 @@ const _getRelateBrand = (id, appType) => { |
|
|
* @param id
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getArticlePre = (id, appType) => {
|
|
|
return serviceAPI.get('guang/api/*/article/getArticlePre', {
|
|
|
const _getArticlePre = (id, appType, gender, tag) => {
|
|
|
let per = {
|
|
|
id: id,
|
|
|
app_type: appType
|
|
|
}).then((result) => {
|
|
|
app_type: appType,
|
|
|
gender: gender
|
|
|
};
|
|
|
|
|
|
if (tag) {
|
|
|
per.tag = tag;
|
|
|
}
|
|
|
|
|
|
return serviceAPI.get('guang/api/*/article/getArticlePre', per).then((result) => {
|
|
|
|
|
|
if (result && result.code === 200) {
|
|
|
let perArticle = {};
|
...
|
...
|
@@ -524,11 +531,18 @@ const _getArticlePre = (id, appType) => { |
|
|
* @param id
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getArticleNext = (id, appType) => {
|
|
|
return serviceAPI.get('guang/api/*/article/getArticleNext', {
|
|
|
const _getArticleNext = (id, appType, gender, tag) => {
|
|
|
let per = {
|
|
|
id: id,
|
|
|
app_type: appType
|
|
|
}).then((result) => {
|
|
|
app_type: appType,
|
|
|
gender: gender
|
|
|
};
|
|
|
|
|
|
if (tag) {
|
|
|
per.tag = tag;
|
|
|
}
|
|
|
|
|
|
return serviceAPI.get('guang/api/*/article/getArticleNext', per).then((result) => {
|
|
|
|
|
|
if (result && result.code === 200) {
|
|
|
|
...
|
...
|
@@ -656,14 +670,14 @@ const shareData = () => { |
|
|
* @param id
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const getDetailData = (id, appType, uid, udid) => {
|
|
|
const getDetailData = (id, appType, gender, tag, uid, udid) => {
|
|
|
return co(function *() {
|
|
|
let result = yield Promise.all([_getHeadData(id, appType, uid, udid),
|
|
|
_getArticleData(id, appType),
|
|
|
_getContentData(id, appType),
|
|
|
_getCommentsData(id, appType),
|
|
|
_getArticlePre(id, appType),
|
|
|
_getArticleNext(id, appType),
|
|
|
_getArticlePre(id, appType, gender, tag),
|
|
|
_getArticleNext(id, appType, gender, tag),
|
|
|
_getRelateBrand(id, appType)]);
|
|
|
let res = yield _processHeadData([result[0], result[1], result[3]]);
|
|
|
|
...
|
...
|
|