|
|
@ -1,13 +1,22 @@ |
|
|
|
import React from "react"; |
|
|
|
import React from "react"; |
|
|
|
import {Button, Form, Image, ListGroup, Tab, Table, Tabs} from "react-bootstrap"; |
|
|
|
import {Button, Form, Image, ListGroup, Tab, Table, Tabs} from "react-bootstrap"; |
|
|
|
import {ManagerActivity} from "./entity"; |
|
|
|
import {ManagerActivity, PageProps} from "./entity"; |
|
|
|
import {JSONResponse, Method, request} from "./interface"; |
|
|
|
import {JSONResponse, Method, request} from "./interface"; |
|
|
|
import {API, prefix} from "./api"; |
|
|
|
import {API, prefix} from "./api"; |
|
|
|
import {EmptyBodyTransform, FindActivityRes, FindActivityTransform, PageDataMessage, SimpleMessage} from "./result"; |
|
|
|
import { |
|
|
|
|
|
|
|
EmptyBodyTransform, |
|
|
|
|
|
|
|
FindActivityRes, |
|
|
|
|
|
|
|
FindActivityTransform, |
|
|
|
|
|
|
|
FindTimeScoreRes, |
|
|
|
|
|
|
|
PageDataMessage, |
|
|
|
|
|
|
|
ScoreTransform, |
|
|
|
|
|
|
|
SimpleMessage |
|
|
|
|
|
|
|
} from "./result"; |
|
|
|
import {MyDialog} from "./ui/MyDialog"; |
|
|
|
import {MyDialog} from "./ui/MyDialog"; |
|
|
|
import moment from "moment"; |
|
|
|
import moment from "moment"; |
|
|
|
import {Input} from "./ui/InputGroup"; |
|
|
|
import {Input} from "./ui/InputGroup"; |
|
|
|
import {UploadImg} from "./ui/UploadImg"; |
|
|
|
import {UploadImg} from "./ui/UploadImg"; |
|
|
|
|
|
|
|
import {Page} from "./ui/Page"; |
|
|
|
|
|
|
|
|
|
|
|
const contentMaxLength=50 |
|
|
|
const contentMaxLength=50 |
|
|
|
/** |
|
|
|
/** |
|
|
@ -68,7 +77,8 @@ class EditActive extends React.Component< |
|
|
|
export class Active extends React.Component<any, { |
|
|
|
export class Active extends React.Component<any, { |
|
|
|
activeList?:Array<ManagerActivity>; |
|
|
|
activeList?:Array<ManagerActivity>; |
|
|
|
tipContent:JSX.Element|null |
|
|
|
tipContent:JSX.Element|null |
|
|
|
dialog:JSX.Element|null |
|
|
|
dialog:JSX.Element|null, |
|
|
|
|
|
|
|
page?:PageProps |
|
|
|
}>{ |
|
|
|
}>{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -77,7 +87,7 @@ export class Active extends React.Component<any, { |
|
|
|
|
|
|
|
|
|
|
|
this.state={ |
|
|
|
this.state={ |
|
|
|
tipContent:null, |
|
|
|
tipContent:null, |
|
|
|
dialog:null |
|
|
|
dialog:null, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -90,9 +100,9 @@ export class Active extends React.Component<any, { |
|
|
|
switch (res.customResult) { |
|
|
|
switch (res.customResult) { |
|
|
|
case PageDataMessage.ok: |
|
|
|
case PageDataMessage.ok: |
|
|
|
that.setState({ |
|
|
|
that.setState({ |
|
|
|
activeList:res.dataList |
|
|
|
activeList:res.dataList, |
|
|
|
|
|
|
|
page:res.page |
|
|
|
}) |
|
|
|
}) |
|
|
|
// that.loadActive(1)
|
|
|
|
|
|
|
|
break |
|
|
|
break |
|
|
|
case PageDataMessage.fail: |
|
|
|
case PageDataMessage.fail: |
|
|
|
that.setState({ |
|
|
|
that.setState({ |
|
|
@ -141,7 +151,7 @@ export class Active extends React.Component<any, { |
|
|
|
{active.helpUser != null ? |
|
|
|
{active.helpUser != null ? |
|
|
|
<ListGroup> |
|
|
|
<ListGroup> |
|
|
|
{active.helpUser.map((userId,index) => |
|
|
|
{active.helpUser.map((userId,index) => |
|
|
|
<ListGroup.Item key={'item'+index}>{userId}</ListGroup.Item>)} |
|
|
|
<ListGroup.Item key={'item'+index}>{userId}<Image onClick={()=>this.loadScore(userId,active.activityId)} className="timeScore" src={"money.svg"}/></ListGroup.Item>)} |
|
|
|
</ListGroup>:'无' |
|
|
|
</ListGroup>:'无' |
|
|
|
} |
|
|
|
} |
|
|
|
</td> |
|
|
|
</td> |
|
|
@ -155,6 +165,10 @@ export class Active extends React.Component<any, { |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</Table> |
|
|
|
</Table> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.state.page?<Page onClick={(page:number)=>this.loadActive(page)} currentPage={this.state.page.currentPage} |
|
|
|
|
|
|
|
totalPage={this.state.page.totalPage} pageSize={this.state.page.pageSize}/> |
|
|
|
|
|
|
|
:<span className="text-danger text-center">丢失分页数据</span>} |
|
|
|
|
|
|
|
|
|
|
|
{this.state.dialog} |
|
|
|
{this.state.dialog} |
|
|
|
|
|
|
|
|
|
|
|
<MyDialog content={this.state.tipContent} open={this.state.tipContent!=null} titleId={"user-dialog"} menuName={"操作提示"} |
|
|
|
<MyDialog content={this.state.tipContent} open={this.state.tipContent!=null} titleId={"user-dialog"} menuName={"操作提示"} |
|
|
@ -194,4 +208,47 @@ export class Active extends React.Component<any, { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
加载时间币 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private loadScore(userId: string, activityId: number) { |
|
|
|
|
|
|
|
let that=this |
|
|
|
|
|
|
|
request(API.account.timeScore,Method.GET,{ |
|
|
|
|
|
|
|
userId:userId, |
|
|
|
|
|
|
|
activityId:String(activityId) |
|
|
|
|
|
|
|
},new ScoreTransform(),function (res:FindTimeScoreRes) { |
|
|
|
|
|
|
|
switch (res.customResult) { |
|
|
|
|
|
|
|
case SimpleMessage.ok: |
|
|
|
|
|
|
|
if(res.timeScore==null){ |
|
|
|
|
|
|
|
that.setState({ |
|
|
|
|
|
|
|
tipContent:<h3 className="text-center text-danger">该用户没有结算时间币记录</h3> |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
that.setState({ |
|
|
|
|
|
|
|
tipContent: <Table> |
|
|
|
|
|
|
|
<thead> |
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<th>结算时间</th> |
|
|
|
|
|
|
|
<th>时间币</th> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
</thead> |
|
|
|
|
|
|
|
<tbody> |
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<td>{moment(res.timeScore?.createTime).format("YYYY-MM-DD HH:mm:ss")}</td> |
|
|
|
|
|
|
|
<td>{res.timeScore?.timeScore}</td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
</tbody> |
|
|
|
|
|
|
|
</Table> |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
case SimpleMessage.fail: |
|
|
|
|
|
|
|
that.setState({ |
|
|
|
|
|
|
|
tipContent:<h3 className="text-center text-danger">时间币查询失败,请联系管理员</h3> |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|