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.
37 lines
1.5 KiB
37 lines
1.5 KiB
import React from "react";
|
|
import {Button, Image} from "react-bootstrap";
|
|
import {ActivityDetail} from "../entity";
|
|
import moment from "moment";
|
|
import {prefix} from "../interface";
|
|
|
|
/**
|
|
* 活动信息
|
|
*/
|
|
export class Activity extends React.Component<
|
|
{
|
|
activity:ActivityDetail;
|
|
/**
|
|
* 显示报名按钮
|
|
*/
|
|
showButton:boolean;
|
|
/**
|
|
* 报名方法
|
|
*/
|
|
applyFunction?:Function;
|
|
}, { undefined?:undefined }>{
|
|
|
|
render() {
|
|
return (
|
|
<div className="overflow-auto activity-detail-height">
|
|
<div className="text-center">
|
|
<Image className="mb-3 activityImage" src={prefix.image+this.props.activity.activityImg}/>
|
|
</div>
|
|
<h3 className="text-center">{this.props.activity.title}</h3>
|
|
<p className="p-2">{this.props.activity.content}</p>
|
|
<h5 className="text-center">{"活动开始时间:"+moment(this.props.activity.activityStartTime).format("YYYY-MM-DD HH:mm:ss")}</h5>
|
|
<h5 className="text-center mb-3">{"活动结束时间:"+moment(this.props.activity.activityStartTime).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.activity.activityId):null}>帮助</Button></div>:null}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|