index.js 1.26 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.imageWidth,
    imageHeight: listData.imageHeight,
    blockList: [
      {
        articleId: +listData.articleId,
        contentData: listData.assembleCoverImage,
        height: listData.imageHeight,
        templateKey: 'image',
        width: listData.imageWidth
      }, {
        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
};