Authored by zhangxiaoru

editorial

... ... @@ -211,8 +211,8 @@ const _processHeadData = (list) => {
*/
const _getRelatedData = (idList) => {
return api.get('', {
query: idList,
method: 'app.search.li'
productSkn: idList,
method: 'h5.product.batch'
}).then((result) => {
let productList = [];
... ... @@ -244,8 +244,6 @@ const _processContentData = (list) => {
list = list || [];
list = camelCase(list);
// console.log(list)
let contentData = {
contents: []
};
... ... @@ -386,9 +384,10 @@ const _getHeadData = (id, appType, uid, udid) => {
* @param id
* @returns {*}
*/
const _getContentData = (id) => {
const _getContentData = (id, appType) => {
return serviceAPI.get('guang/service/*/article/getArticleContent', {
article_id: id
article_id: id,
app_type: appType
}).then((result) => {
if (result && result.code === 200) {
return _processContentData(result.data);
... ... @@ -404,9 +403,10 @@ const _getContentData = (id) => {
* @param id
* @returns {*}
*/
const _getArticleData = (id) => {
const _getArticleData = (id, appType) => {
return serviceAPI.get('guang/service/v2/article/getArticle', {
article_id: id
article_id: id,
app_type: appType
}).then((result) => {
if (result && result.code === 200) {
return result.data;
... ... @@ -422,9 +422,10 @@ const _getArticleData = (id) => {
* @param id
* @returns {*}
*/
const _getCommentsData = (id) => {
const _getCommentsData = (id, appType) => {
return serviceAPI.get('guang/api/*/comments/getList', {
article_id: id
article_id: id,
app_type: appType
}).then((result) => {
if (result && result.code === 200) {
_.forEach(result.data.list, function(data) {
... ... @@ -444,9 +445,10 @@ const _getCommentsData = (id) => {
* @param id
* @returns {*}
*/
const _getRelateBrand = (id) => {
const _getRelateBrand = (id, appType) => {
return serviceAPI.get('guang/service/v2/article/getBrand', {
article_id: id
article_id: id,
app_type: appType
}).then((result) => {
if (result && result.code === 200) {
... ... @@ -474,12 +476,7 @@ const _getArticlePre = (id, appType) => {
id: id,
app_type: appType
}).then((result) => {
// console.log(result.message);
// result.code = 200;
// result.data = {
// articleIdPre: 34288,
// authorId: 589238
// }
if (result && result.code === 200) {
let perArticle = {};
... ... @@ -508,13 +505,7 @@ const _getArticleNext = (id, appType) => {
id: id,
app_type: appType
}).then((result) => {
// console.log(result);
// result.code = 200;
// result.data = {
// articleIdNext: 34288,
// authorId: 589238
// }
if (result && result.code === 200) {
let nextArticle = {};
... ... @@ -644,12 +635,12 @@ const shareData = () => {
const getDetailData = (id, appType, uid, udid) => {
return co(function *() {
let result = yield Promise.all([_getHeadData(id, appType, uid, udid),
_getArticleData(id),
_getContentData(id),
_getCommentsData(id),
_getArticleData(id, appType),
_getContentData(id, appType),
_getCommentsData(id, appType),
_getArticlePre(id, appType),
_getArticleNext(id, appType),
_getRelateBrand(id)]);
_getRelateBrand(id, appType)]);
let res = yield _processHeadData([result[0], result[1], result[3]]);
return {
... ...
... ... @@ -29,9 +29,9 @@
{{# content}}
{{# singleImage}}
{{# data}}
<div class="article-pic block">
<span class="article-pictwo">
<img src="{{image src 930 660 1}}">
</div>
</span>
{{/ data}}
{{/ singleImage}}
{{# smallPic}}
... ...
... ... @@ -42,7 +42,7 @@
}
.msg-title:hover {
color: #666;
color: #666666;
}
.lazy {
... ...