index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import React, { Component } from 'react';
  2. import './index.less';
  3. import Assets from '@src/components/Assets';
  4. import { formatDate } from '@src/services/Tools';
  5. export class FAQItem extends Component {
  6. render() {
  7. const { className = '', data = {} } = this.props;
  8. return (
  9. <div className={`g-faq-item ${className}`}>
  10. <div className="g-faq-item-title">{data.content}</div>
  11. <div className="g-faq-item-desc">答:{data.answer}</div>
  12. </div>
  13. );
  14. }
  15. }
  16. export class CommentItem extends Component {
  17. render() {
  18. const { className = '', data = {} } = this.props;
  19. return (
  20. <div className={`g-comment-item ${className}`}>
  21. <div className="g-comment-item-left">
  22. <Assets name="d_b" src={data.avatar} />
  23. </div>
  24. <div className="g-comment-item-right">
  25. <div className="g-comment-item-right-info">
  26. <div className="g-comment-item-right-info-name">{data.nickname}</div>
  27. <div className="g-comment-item-right-info-date">{data.createTime && formatDate(data.createTime, 'YYYY-MM-DD')}</div>
  28. </div>
  29. <div className="g-comment-item-right-desc">{data.content}</div>
  30. </div>
  31. </div>
  32. );
  33. }
  34. }