This commit is contained in:
caishi 2021-05-28 17:02:54 +08:00
parent 7bbda5f65d
commit d41dce26b1
1 changed files with 20 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import './Index.scss';
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/title';
@ -12,13 +12,24 @@ import Line from '../Echart/Line';
import Calendar from '../Echart/Calendar';
import ConcentrateProject from './ConcentrateProject';
import Activity from './Activity';
import moment from 'moment';
const aLimit = 5;
function Index(props) {
const [ page , setPage ] = useState(1);
const [ total , setTotal ] = useState(0);
const [ createYear , setCreateYear ] = useState(undefined);
const username = props.match.params.username;
const current_user = props.current_user;
const user = props.user;
useEffect(()=>{
if(user){
let c = user.created_time && user.created_time.split("-")[0];
setCreateYear(parseInt(c,0));
}
},[user])
//
function chooseTime(data) {
@ -27,6 +38,12 @@ function Index(props) {
}
}
function renderYear(){
let y = moment().get('year');
for(var i = y ; i > createYear;i--){
}
}
return(
<div>
<div>
@ -39,7 +56,8 @@ function Index(props) {
<FlexAJ>
<span className="font-18">贡献度</span>
<Select style={{width:"200px"}} placeholder="选择年份">
<Select.Option key="2021">2021</Select.Option>
<Select.Option key="">选择年份</Select.Option>
{ createYear && renderYear()}
</Select>
</FlexAJ>
<Calendar time={''} userLogin={username} chooseTime={chooseTime}/>