From 5609cde5a0e515e2ee78ea8f29a92058eba7544f Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Oct 2017 18:54:21 +0800 Subject: [PATCH] Add new avatar pictures --- mock/api.js | 28 ++++++++++++++++------------ src/routes/List/BasicList.js | 4 ++-- src/routes/List/CardList.less | 1 + src/routes/List/SearchList.js | 12 +++++++++--- src/routes/List/SearchList.less | 24 +++++++----------------- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/mock/api.js b/mock/api.js index b444b47c..714a5cda 100644 --- a/mock/api.js +++ b/mock/api.js @@ -2,20 +2,24 @@ import { imgMap, getUrlParams } from './utils'; export function fakeList(count) { const titles = [ - 'Vue', - 'Ant Design Pro', - 'Bootstrap', + 'Alipay', 'Angular', + 'Ant Design Pro', 'Ant Design', + 'Bootstrap', 'React', - 'Alipay', - 'Ant Design Mobile', + 'Vue', + 'Webpack', ]; const avatars = [ - 'https://gw.alipayobjects.com/zos/rmsportal/hYjIZrUoBfNxOAYBVDfc.png', // 凤蝶 - 'https://gw.alipayobjects.com/zos/rmsportal/HHWPIzPLCLYmVuPivyiA.png', // 云雀 - 'https://gw.alipayobjects.com/zos/rmsportal/irqByKtOdKfDojxIWTXF.png', // Basement - 'https://gw.alipayobjects.com/zos/rmsportal/VcmdbCBcwPTGYgbYeMzX.png', // DesignLab + 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', // Alipay + 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', // Angular + 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', // Ant Design Pro + 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', // Ant Design + 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png', // Bootstrap + 'https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png', // React + 'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png', // Vue + 'https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png', // Webpack ]; const covers = [ 'https://gw.alipayobjects.com/zos/rmsportal/HrxcVbrKnCJOZvtzSqjN.png', @@ -50,11 +54,11 @@ export function fakeList(count) { id: `fake-list-${i}`, owner: user[i % 10], title: titles[i % 8], - avatar: avatars[i % 4], - cover: (i / 4) % 2 === 0 ? covers[i % 4] : covers[3 - (i % 4)], + avatar: avatars[i % 8], + cover: parseInt(i / 4, 10) % 2 === 0 ? covers[i % 4] : covers[3 - (i % 4)], status: ['active', 'exception', 'normal'][i % 3], percent: Math.ceil(Math.random() * 50) + 50, - logo: ['https://gw.alipayobjects.com/zos/rmsportal/KoJjkdbuTFxzJmmjuDVR.png', 'https://gw.alipayobjects.com/zos/rmsportal/UxGORCvEXJEsxOfEKZiA.png'][i % 2], + logo: avatars[i % 8], href: 'https://ant.design', updatedAt: new Date(new Date().getTime() - (1000 * 60 * 60 * 2 * i)), createdAt: new Date(new Date().getTime() - (1000 * 60 * 60 * 2 * i)), diff --git a/src/routes/List/BasicList.js b/src/routes/List/BasicList.js index ff0e6f1c..93fcc4e6 100644 --- a/src/routes/List/BasicList.js +++ b/src/routes/List/BasicList.js @@ -117,8 +117,8 @@ export default class BasicList extends PureComponent { bodyStyle={{ padding: '0 32px 40px 32px' }} extra={extraContent} > - (
-

{content}

-
+

{content}

+
{owner} 发布在 {href} {moment(updatedAt).format('YYYY-MM-DD hh:mm')}
@@ -305,7 +305,13 @@ export default class SearchList extends Component { title={( {item.title} )} - description={Ant Design设计语言蚂蚁金服} + description={ + + Ant Design + 设计语言 + 蚂蚁金服 + + } /> diff --git a/src/routes/List/SearchList.less b/src/routes/List/SearchList.less index 6fb88e60..8ecf7b9b 100644 --- a/src/routes/List/SearchList.less +++ b/src/routes/List/SearchList.less @@ -2,41 +2,31 @@ @import "../../utils/utils.less"; .listContent { - p { - line-height: 24px; + .description { + line-height: 22px; max-width: 720px; } - & > div { + .extra { color: @text-color-secondary; margin-top: 16px; height: 22px; line-height: 22px; - & > img { - margin-right: 16px; - } - & > span { + & > :global(.ant-avatar) { vertical-align: top; margin-right: 8px; width: 20px; height: 20px; - & > img { - vertical-align: top; - } + position: relative; + top: 1px; } & > em { color: @disabled-color; font-style: normal; margin-left: 16px; } - a { - color: @text-color-secondary; - &:hover { - color: @primary-color; - } - } } } -.listItemMetaTitle { +a.listItemMetaTitle { color: @heading-color; } .listItemExtra { -- GitLab