You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
help_user/src/ui/Active.tsx

34 lines
1.3 KiB

import React from "react";
import {Button, Image} from "react-bootstrap";
import {ActiveDetail} from "../entity";
import moment from "moment";
/**
* 活动信息
*/
export class Active extends React.Component<
{
active:ActiveDetail;
/**
* 显示报名按钮
*/
showButton:boolean;
/**
* 报名方法
*/
applyFunction?:Function;
}, { undefined?:undefined }>{
render() {
return (
<div className="overflow-auto active-detail-height">
<Image className="mb-3" src={this.props.active.activeImg}/>
<h3 className="text-center">{this.props.active.title}</h3>
<p className="p-2">{this.props.active.content}</p>
<h5 className="text-center">{"活动开始时间:"+moment(this.props.active.activeStartTime).format("YYYY-MM-DD HH:mm:ss")}</h5>
<h5 className="text-center mb-3">{"活动结束时间:"+moment(this.props.active.activeStartTime).format("YYYY-MM-DD HH:mm:ss")}</h5>
{this.props.showButton?<div className="text-center"><Button onClick={()=>this.props.applyFunction?this.props.applyFunction(this.props.active.activeId):null}></Button></div>:null}
</div>
);
}
}