import React, { Component } from 'react'; import { Redirect } from 'react-router'; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { getImageUrl, toPath } from 'educoder'; import moment from 'moment'; class PostItem extends Component { _toTenThousand(num) { if (num > 10000) { return ( (num - 500)/ 10000 ).toFixed(1) + '万' } return num } render() { const { match, history, currentPage, memo, user, setTop, setDown } = this.props return (
{/* target="_blank" */} {memo.subject} { memo.sticky && 置顶 } { memo.reward && {memo.reward} }
{/* data-tip-down="回复数" {memo.replies_count} {memo.praise_count}*/} {memo.replies_count ? {memo.replies_count} 回复 :''} {memo.praise_count ? {memo.praise_count} 赞 :''} {memo.viewed_count ? {this._toTenThousand(memo.viewed_count)} 浏览 :''}