Skip to content

Commit

Permalink
商户详情模块开发完毕
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeBooo committed Jan 31, 2018
1 parent 2672c30 commit fa4a861
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 10 deletions.
23 changes: 23 additions & 0 deletions src/components/CommentList/Item/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import Star from '../../Star';
import './style.scss';

// 无状态组件可以直接使用函数形式创建
const Item = props => {
// 获取数据
const item = props.data;

return (
<div className="comment-item">
<h3>
<i className="icon-user"></i>
&nbsp;
{item.username}
</h3>
<Star star={item.star} />
<p>{item.comment}</p>
</div>
);
};

export default Item;
14 changes: 14 additions & 0 deletions src/components/CommentList/Item/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.comment-item {
border-bottom: 1px solid #f1f1f1;
padding-bottom: 10px;
margin-bottom: 10px;
h3 {
font-size: 18px;
line-height: 1.5;
color: #666;
}
p {
color: #999;
line-height: 1.5;
}
}
13 changes: 10 additions & 3 deletions src/components/CommentList/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import React from 'react';
import CommentItem from './Item';

import './style.scss';

const CommentList = props => {
const data = props.data;
console.log(data)

return (
<div>
CommentList
<div className="comment-list">
{
data.map((item, index) => {
return (
<CommentItem key={index} data={item} />
);
})
}
</div>
)
};
Expand Down
3 changes: 3 additions & 0 deletions src/components/CommentList/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.comment-list {
padding: 10px;
}
16 changes: 9 additions & 7 deletions src/containers/Detail/subpage/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.detail-comment-subpage{

}
h2 {
margin: 10px;
font-size: 16px;
color: #666;
.detail-comment-subpage {
background-color: #fff;
margin-top: 20px;

h2 {
font-size: 18px;
padding: 5px 10px;
border-bottom: 1px solid #f1f1f1;
}
}

0 comments on commit fa4a861

Please sign in to comment.