import * as React from 'react'; import AvatarImg from '&/components/common/avatarImg/avatarImg' import ToolTip from '@beisen/tool-tip'; // import { getBSGlobal, encodeURIFn } from '&/helper' import {jumpPerson} from '&/helper/jumpToPersonHome'; interface Props{ data:any, index:number, maxVal:number } export default class Rank extends React.Component{ getWidth = (value:number) =>{ if(!value) return { width:'0px' }; const { maxVal } = this.props; const percent = value / maxVal; return { width: `calc((100% - 165px) * ${percent} )` } } handleClick = () =>{ const {data} = this.props; const toUserId = data.user.userId; jumpPerson(toUserId,1) // const apiServer = getBSGlobal('apiPath'); // const uid = getBSGlobal('loginUserInfo').Id; // const url = `${apiServer}/${uid}/UIBuilder#/HonourView?pageTitle=个人主页&layout=honour&to_user_id=${toUserId}`; // window.open(encodeURIFn(url)) } render(){ const {data} = this.props; return
{data.user.name} {data.value} 元
} }