index.js 1.29 KB
function processArticleListData(listData) {
  return {
    local: true,
    articleId: +listData.articleId,
    articleType: listData.articleType,
    authorHeadIco: listData.assembleAuthorHeadIco,
    authorName: listData.authorName,
    authorType: listData.authorType,
    authorUid: listData.authorUid,
    coverImage: listData.assembleCoverImage,
    articleTitle: listData.content,
    imageWidth: listData.assembleImageWidth,
    imageHeight: listData.assembleImageHeight,
    blockList: [
      {
        articleId: +listData.articleId,
        contentData: listData.assembleCoverImage,
        height: listData.assembleImageHeight,
        templateKey: 'image',
        width: listData.assembleImageWidth
      }, {
        articleId: +listData.articleId,
        contentData: listData.content,
        templateKey: 'text',
      }
    ],
    commentCount: 0,
    comments: [],
    dataType: listData.dataType,
    favoriteCount: 0,
    hasAttention: 'N',
    hasFavor: listData.hasFavor ? 'Y' : 'N',
    hasPraise: listData.hasPraised ? 'Y' : 'N',
    isAuthor: 'N',
    labelList: [],
    praiseCount: listData.praiseCount,
    productList: [],
    publishTime: listData.publishTime,
    publishTimeStr: listData.publishTimeStr,
    sort: listData.sort
  };
}


export default {
  processArticleListData
};