首页模块对接服务端

master
pan 5 years ago
parent 548c59e715
commit fed0694a1f
  1. 1
      package.json
  2. 7
      src/Main.tsx
  3. 4
      src/account/Login.tsx
  4. 4
      src/account/Register.tsx
  5. 34
      src/entity.ts
  6. 38
      src/interface.ts
  7. 20
      src/my/MyLeaveWord.tsx
  8. 74
      src/result.ts
  9. 12
      src/setupProxy.js
  10. 110
      src/sub/IndexMenu.tsx
  11. 78
      src/sub/SendHelp.tsx
  12. 9
      src/ui/TestData.ts
  13. 32
      yarn.lock

@ -12,6 +12,7 @@
"@types/react": "^16.9.0", "@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0", "@types/react-dom": "^16.9.0",
"bootstrap": "^4.5.0", "bootstrap": "^4.5.0",
"http-proxy-middleware": "^1.0.4",
"moment": "^2.26.0", "moment": "^2.26.0",
"react": "^16.13.1", "react": "^16.13.1",
"react-bootstrap": "^1.0.1", "react-bootstrap": "^1.0.1",

@ -104,12 +104,17 @@ export class Main extends React.Component<
});break; });break;
case Menu.myHelp: case Menu.myHelp:
this.setState({ this.setState({
subMenu:<SendHelp/> subMenu:<SendHelp onSendActivityOK={()=>this.onSendActivityOK()}/>
});break; });break;
} }
} }
//活动发布成功
onSendActivityOK(){
this.changeMenu(Menu.index)
}
/** /**
* *
*/ */

@ -29,9 +29,7 @@ export class Login extends React.Component<LoginProps, LoginState>{
request(API.account.login,Method.POST,{ request(API.account.login,Method.POST,{
userId:this.state.userId, userId:this.state.userId,
password:this.state.password password:this.state.password
},function () { },new LoginTransform(),function (res:LoginRes) {
return new LoginTransform()
},function (res:LoginRes) {
let message let message
switch (res.customResult) { switch (res.customResult) {
case LoginResMessage.ok: case LoginResMessage.ok:

@ -57,9 +57,7 @@ export class Register extends React.Component<RegisterProps, RegisterState>{
email:this.state.email, email:this.state.email,
info:this.state.info info:this.state.info
},function () { },new RegisterTransform(),function(res:RegisterRes){
return new RegisterTransform()
},function(res:RegisterRes){
let message let message
switch (res.customResult) { switch (res.customResult) {
case RegisterMessage.ok:message="注册成功"; case RegisterMessage.ok:message="注册成功";

@ -48,19 +48,21 @@ export enum RecommendType {
* *
*/ */
export interface BaseHelp { export interface BaseHelp {
//活动ID
activityId:number;
//活动标题 //活动标题
title:string; title:string;
//活动内容 //活动内容
content:string; content:string;
//活动背景图 //活动背景图
activityImg:string; activityImg?:string;
} }
export interface ActivityId {
//活动ID
activityId:number;
}
//活动详情 //活动详情
export interface ActivityDetail extends BaseHelp{ export interface ActivityDetail extends BaseHelp,ActivityId{
//活动开始时间 //活动开始时间
activityStartTime:number; activityStartTime:number;
//活动结束时间 //活动结束时间
@ -68,13 +70,9 @@ export interface ActivityDetail extends BaseHelp{
} }
//我的帮助信息 //我的帮助信息
export interface MyHelpState extends BaseHelp{ export interface MyHelpState extends ActivityDetail{
//求助时间 //求助时间
seekHelpTime:number; seekHelpTime:number;
//活动开始时间
activityStartTime:number;
//活动结束时间
activityEndTime:number;
//报名时间 //报名时间
applyTime:number; applyTime:number;
//参与时间 //参与时间
@ -87,7 +85,7 @@ export interface MyHelpState extends BaseHelp{
//我的求助信息 //我的求助信息
export interface SeekHelpState extends BaseHelp{ export interface SeekHelpState extends BaseHelp,ActivityId{
//求助时间 //求助时间
time:number; time:number;
//活动报名志愿者 //活动报名志愿者
@ -98,16 +96,18 @@ export interface SeekHelpState extends BaseHelp{
completeVolunteerList:Array<User>; completeVolunteerList:Array<User>;
} }
/** /**
* *
*/ */
export interface SendHelpState extends BaseHelp{ export interface SendHelpState extends BaseHelp{
//开始时间 //活动开始时间
startTime:string; activityStartTime:string;
//结束时间 //活动结束时间
endTime:string; activityEndTime:string;
//服务地点 //服务地点
address:string; serviceAddress:string;
//推荐方式 //推荐方式
recommendType:RecommendType; recommendType:RecommendType;
//好友列表 //好友列表
@ -116,6 +116,8 @@ export interface SendHelpState extends BaseHelp{
chooseFriendList: { chooseFriendList: {
[propName:string]:User [propName:string]:User
}; };
activityImgFile?:any;
result:JSX.Element|null;
} }

@ -3,13 +3,24 @@
const server="http://localhost:8080" const server="http://localhost:8080"
const prefix={ const prefix={
user:"/api/user" user:"/api/user",
activity:"/api/activity"
} }
//服务器接口地址 //服务器接口地址
export const API={ export const API={
account:{ account:{
//注册
register:prefix.user+"/register", register:prefix.user+"/register",
//登录
login:prefix.user+"/login" login:prefix.user+"/login"
},
main:{
activity: {
//发布求助信息
help: prefix.activity + "/sendHelp",
//查找活动列表
find: prefix.activity + "/find"
}
} }
} }
@ -20,8 +31,8 @@ export enum Method {
} }
export enum Result { export enum Result {
OK, OK="OK",
FAIL FAIL="FAIL"
} }
@ -66,14 +77,22 @@ export abstract class TransformData<Q,T extends JSONResponse<Q>> {
} }
//发送请求 //发送请求
export function request<Q,E extends JSONResponse<Q>,T extends TransformData<Q,E>>(api:string,method:Method,formParams: {[propName:string]: string | Blob},transformFun:Function,callback:Function) { export function request<Q,E extends JSONResponse<Q>,T extends TransformData<Q,E>>(api:string,method:Method,formParams: {[propName:string]: string | Blob},transform:T,callback:Function) {
let formData=new FormData() let formData
for(let formParam in formParams){ if(method!==Method.GET) {
formData.append(formParam,formParams[formParam]) formData=new FormData()
for (let formParam in formParams) {
formData.append(formParam, formParams[formParam])
}
}else{
formData=''
for (let formParam in formParams) {
formData+='&'+formParam+'='+formParams[formParam]
}
} }
fetch(server+api,{ fetch(server+api+(method===Method.GET?"?"+formData.toString().substr(1):""),{
method:method, method:method,
body:formData body:method===Method.GET?null:formData
}) })
.then( .then(
response=>{if(response.status===200){ response=>{if(response.status===200){
@ -87,7 +106,6 @@ export function request<Q,E extends JSONResponse<Q>,T extends TransformData<Q,E>
error =>console.error('Error:', error) error =>console.error('Error:', error)
) )
.then((response:JSONResponse<Q>)=>{ .then((response:JSONResponse<Q>)=>{
let transform:T=transformFun()
callback(transform.transform(response)) callback(transform.transform(response))
}) })
} }

@ -5,7 +5,7 @@ import {Tooltip} from "@material-ui/core";
import {MyDialog} from "../ui/MyDialog"; import {MyDialog} from "../ui/MyDialog";
import {MyInfo} from "./MyInfo"; import {MyInfo} from "./MyInfo";
import {Activity} from "../ui/Activity"; import {Activity} from "../ui/Activity";
import {userObj} from "../ui/TestData"; import {activityObj, userObj} from "../ui/TestData";
enum LeaveWordType { enum LeaveWordType {
recommend, recommend,
@ -62,26 +62,12 @@ export class MyLeaveWord extends React.Component<{ user:string },
data:[ data:[
{ {
user:userObj, user:userObj,
activity:{ activity:activityObj,
activityId:1,
title:"活动标题1",
content:"活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动",
activityImg:"logo512.png",
activityStartTime:new Date().getTime(),
activityEndTime:new Date().getTime()
},
type:LeaveWordType.recommend type:LeaveWordType.recommend
}, },
{ {
user:userObj, user:userObj,
activity:{ activity:activityObj,
activityId:1,
title:"活动标题1",
content:"活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动",
activityImg:"logo512.png",
activityStartTime:new Date().getTime(),
activityEndTime:new Date().getTime()
},
type:LeaveWordType.apply type:LeaveWordType.apply
}, },
{ {

@ -2,7 +2,7 @@
* *
*/ */
import {JSONResponse, Result, TransformData} from "./interface"; import {JSONResponse, Result, TransformData} from "./interface";
import {UserType} from "./entity"; import {ActivityDetail, PageProps, UserType} from "./entity";
/** /**
* *
@ -19,7 +19,7 @@ export enum RegisterMessage {
} }
/** /**
* *
*/ */
export class RegisterRes implements JSONResponse<RegisterMessage> { export class RegisterRes implements JSONResponse<RegisterMessage> {
customResult?: RegisterMessage; customResult?: RegisterMessage;
@ -49,7 +49,7 @@ export enum LoginResMessage {
} }
/** /**
* *
*/ */
export class LoginRes implements JSONResponse<LoginResMessage>{ export class LoginRes implements JSONResponse<LoginResMessage>{
userId?:string userId?:string
@ -58,6 +58,9 @@ export class LoginRes implements JSONResponse<LoginResMessage>{
result?: Result; result?: Result;
} }
/**
*
*/
export class LoginTransform extends TransformData<LoginResMessage,LoginRes>{ export class LoginTransform extends TransformData<LoginResMessage,LoginRes>{
protected newObject(): LoginRes { protected newObject(): LoginRes {
return new LoginRes(); return new LoginRes();
@ -70,3 +73,68 @@ export class LoginTransform extends TransformData<LoginResMessage,LoginRes>{
} }
} }
} }
/**
*
*/
export enum ActivityMessage {
//发布成功
ok="ok",
//发布失败请联系管理员
fail="fail"
}
/**
*
*/
export class SendHelpRes extends JSONResponse<ActivityMessage>{
}
/**
*
*/
export class SendHelpTransform extends TransformData<ActivityMessage, SendHelpRes>{
protected newObject(): SendHelpRes {
return new SendHelpRes();
}
}
/**
*
*/
export enum FindActivityMessage {
ok="ok",
fail="fail"
}
/**
*
*/
export class FindActivityRes extends JSONResponse<FindActivityMessage>{
dataList?:Array<Array<ActivityDetail>>
page?:PageProps
}
/**
*
*/
export class FindActivityTransform extends TransformData<FindActivityMessage, FindActivityRes>{
protected newObject(): FindActivityRes {
return new FindActivityRes();
}
protected transformBody(data: any) {
if(data.body!==null){
this.target.dataList=data.body.body
this.target.page={
currentPage:data.body.currentPage,
totalPage:data.body.totalPage,
pageSize:data.body.pageSize
}
}
}
}

@ -0,0 +1,12 @@
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function (app) {
app.use(createProxyMiddleware('/image', {
target: 'http://localhost:8080',
secure: false,
changeOrigin: true,
pathRewrite: {
"^/image": "/image"
}
}))
}

@ -2,10 +2,13 @@ import React from "react";
import {Button, Card, Col, Container, ListGroup, Row} from "react-bootstrap"; import {Button, Card, Col, Container, ListGroup, Row} from "react-bootstrap";
import {Page} from "../ui/Page"; import {Page} from "../ui/Page";
import {ActivityDetail, BaseHelp, PageProps} from "../entity"; import {ActivityDetail, PageProps} from "../entity";
import {MyDialog} from "../ui/MyDialog"; import {MyDialog} from "../ui/MyDialog";
import {Activity} from "../ui/Activity"; import {Activity} from "../ui/Activity";
import {Input} from "../ui/InputGroup"; import {Input} from "../ui/InputGroup";
import {activityObj} from "../ui/TestData";
import {API, Method, request} from "../interface";
import {FindActivityMessage, FindActivityRes, FindActivityTransform} from "../result";
/** /**
* *
@ -13,15 +16,16 @@ import {Input} from "../ui/InputGroup";
export class IndexMenu extends React.Component<{ user:string }, export class IndexMenu extends React.Component<{ user:string },
{ {
//活动数据 //活动数据
activityList:Array<Array<BaseHelp>>; activityList?:Array<Array<ActivityDetail>>;
//分页信息 //分页信息
page:PageProps; page?:PageProps;
//活动 //活动
activity?:ActivityDetail; activity?:ActivityDetail;
//打开活动 //打开活动
openActivity:boolean; openActivity:boolean;
//检索活动标题 //检索活动标题
title:string; title:string;
result:JSX.Element|null;
}>{ }>{
@ -30,13 +34,7 @@ export class IndexMenu extends React.Component<{ user:string },
super(props); super(props);
this.state={ this.state={
activityList:[], result: null,openActivity:false,
page:{
currentPage:1,
totalPage:3,
pageSize:9
},
openActivity:false,
title:"" title:""
} }
} }
@ -58,14 +56,8 @@ export class IndexMenu extends React.Component<{ user:string },
* @param activityId * @param activityId
*/ */
loadActivityWithId(activityId:number):ActivityDetail{ loadActivityWithId(activityId:number):ActivityDetail{
return { console.debug("activityId="+activityId)
activityId:123, return activityObj
activityImg:"logo512.png",
content: "活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容",
title: "标题标题标题标题标题标题标题",
activityEndTime:new Date().getTime(),
activityStartTime:new Date().getTime()
}
} }
/** /**
@ -74,68 +66,35 @@ export class IndexMenu extends React.Component<{ user:string },
*/ */
loadActivity(page:number){ loadActivity(page:number){
console.debug("检索活动关键字:"+this.state.title) console.debug("检索活动关键字:"+this.state.title)
let that=this
this.setState({ request(API.main.activity.find,Method.GET,{
activityList:[[{ title:this.state.title,
activityId: 123, currentPage:page+""
//活动标题 },new FindActivityTransform(),function (res:FindActivityRes) {
title: "活动标题",
//活动内容
content: "活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容", switch(res.customResult){
//活动图片 case FindActivityMessage.fail:
activityImg: "/logo512.png" that.setState({
},{ result:<h3 className="text-danger text-center"></h3>
activityId: 123, });break;
//活动标题 case FindActivityMessage.ok:
title: "活动标题", that.setState({
//活动内容 activityList:res.dataList,
content: "活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容", page:res.page
//活动图片 });break
activityImg: "/logo512.png" }
},{
activityId: 123,
//活动标题
title: "活动标题",
//活动内容
content: "活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容",
//活动图片
activityImg: "/logo512.png"
}],[{
activityId: 123,
//活动标题
title: "活动标题",
//活动内容
content: "活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容",
//活动图片
activityImg: "/logo512.png"
},{
activityId: 123,
//活动标题
title: "活动标题",
//活动内容
content: "活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容",
//活动图片
activityImg: "/logo512.png"
},{
activityId: 123,
//活动标题
title: "活动标题",
//活动内容
content: "活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容活动内容",
//活动图片
activityImg: "/logo512.png"
}]]
}) })
} }
render() { render() {
const rowList=this.state.activityList.map((activities:Array<BaseHelp>, index:number)=> const rowList=this.state.activityList?this.state.activityList.map((activities:Array<ActivityDetail>, index:number)=>
<Row className="p-3" key={"row"+index}>{activities.map((activity:BaseHelp, subIndex:number)=> <Row className="p-3" key={"row"+index}>{activities.map((activity:ActivityDetail, subIndex:number)=>
<Col className="col-4" key={"col"+subIndex}> <Col className="col-4" key={"col"+subIndex}>
<Card> <Card>
<Card.Header> <Card.Header>
<img src={activity.activityImg} alt="活动图片" className="activityImage"/> <img src={"/image/"+activity.activityImg} alt="活动图片" className="activityImage"/>
</Card.Header> </Card.Header>
<Card.Body> <Card.Body>
<ListGroup> <ListGroup>
@ -157,7 +116,7 @@ export class IndexMenu extends React.Component<{ user:string },
</Card> </Card>
</Col>)} </Col>)}
</Row> </Row>
) ):null
return ( return (
@ -172,13 +131,14 @@ export class IndexMenu extends React.Component<{ user:string },
{rowList} {rowList}
{this.state.page?<Page onClick={(page:number)=>this.loadActivity(page)} currentPage={this.state.page.currentPage} totalPage={this.state.page.totalPage} pageSize={this.state.page.pageSize}/>:null}
<Page onClick={(page:number)=>this.loadActivity(page)} currentPage={this.state.page.currentPage} totalPage={this.state.page.totalPage} pageSize={this.state.page.pageSize}/>
{this.state.activity?<MyDialog content={<Activity activity={this.state.activity} showButton={true} applyFunction={(activeId:number)=>this.applyActivity(activeId)} />} {this.state.activity?<MyDialog content={<Activity activity={this.state.activity} showButton={true} applyFunction={(activeId:number)=>this.applyActivity(activeId)} />}
open={this.state.openActivity} titleId="view-active" menuName="活动详情" open={this.state.openActivity} titleId="view-active" menuName="活动详情"
onClose={()=>this.setState({activity:undefined,openActivity:false})}/>:null} onClose={()=>this.setState({activity:undefined,openActivity:false})}/>:null}
<MyDialog content={this.state.result} open={this.state.result!==null} titleId="find-activity-tip" menuName="发布求助信息反馈" onClose={()=>this.setState({result:null})}/>
</Container> </Container>
) )
} }

@ -8,6 +8,9 @@ import moment from 'moment';
import {Address} from "../ui/Address"; import {Address} from "../ui/Address";
import {UploadImg} from "../ui/UploadImg"; import {UploadImg} from "../ui/UploadImg";
import {userObj} from "../ui/TestData"; import {userObj} from "../ui/TestData";
import {API, Method, request} from "../interface"
import {ActivityMessage, SendHelpRes, SendHelpTransform} from "../result";
import {MyDialog} from "../ui/MyDialog";
/** /**
* *
@ -29,7 +32,7 @@ const recommendType=[RecommendType.no, RecommendType.choose,RecommendType.auto]
/** /**
* *
*/ */
export class SendHelp extends React.Component<{ undefined?:undefined }, SendHelpState>{ export class SendHelp extends React.Component<{ onSendActivityOK:Function }, SendHelpState>{
//当前选中的好友索引 //当前选中的好友索引
private friendIndex:RefObject<any>; private friendIndex:RefObject<any>;
@ -38,17 +41,16 @@ export class SendHelp extends React.Component<{ undefined?:undefined }, SendHelp
const time=moment() const time=moment()
this.state={ this.state={
//活动Id
activityId:123,
title:"", title:"",
content:"", content:"",
startTime:time.add({days:1}).format("YYYY-MM-DD HH:mm:ss"), activityStartTime:time.add({days:1}).format("YYYY-MM-DD HH:mm:ss"),
endTime:time.add({days:7}).format("YYYY-MM-DD HH:mm:ss"), activityEndTime:time.add({days:7}).format("YYYY-MM-DD HH:mm:ss"),
activityImg:"上传活动背景图", serviceAddress: "",
address: "",
recommendType: RecommendType.no, recommendType: RecommendType.no,
friendList:[], friendList:[],
chooseFriendList: {} chooseFriendList: {},
result:null
} }
this.friendIndex=React.createRef() this.friendIndex=React.createRef()
@ -79,24 +81,62 @@ export class SendHelp extends React.Component<{ undefined?:undefined }, SendHelp
return RecommendType.no return RecommendType.no
} }
//发布求助信息
sendHelp(){
let that=this
request(API.main.activity.help,Method.PUT, {
title:this.state.title,
content:this.state.content,
activityStartTime:this.state.activityStartTime,
activityEndTime:this.state.activityEndTime,
activityImgFile:this.state.activityImgFile,
serviceAddress:this.state.serviceAddress
},new SendHelpTransform(),function (res:SendHelpRes) {
switch (res.customResult) {
case ActivityMessage.ok:
that.setState({
result:<div className="text-center"><Button variant="info" onClick={()=>that.props.onSendActivityOK()}></Button></div>
});break
case ActivityMessage.fail:
that.setState({
result:<h3 className="text-center text-danger"></h3>
});break
}
})
}
//检查是否为空
isNotEmpty(...value:(string | number)[]){
for(let index in value){
if(value[index].toString().length===0){
return false
}
}
return true
}
check(){
return this.isNotEmpty(this.state.title,this.state.content,this.state.serviceAddress)&&this.state.activityImgFile!=null
}
render() { render() {
return ( return (
<Container> <Container>
{/*活动标题*/} {/*活动标题*/}
<Input name="title" desc="活动标题" onChange={(value:string)=>this.setState({title:value})}/> <Input name="title" desc="活动标题" onChange={(value:string)=>this.setState({title:value})} valid={{check:this.state.title.length>0}}/>
{/*活动内容*/} {/*活动内容*/}
<Input name="content" desc="活动内容" as="textarea" valid={{check:true,valid:"您还可输入"+(contentMaxLength-this.state.content.length+"个字符")}} maxLength={contentMaxLength} onChange={(value:string)=>this.setState({content:value})}/> <Input name="content" desc="活动内容" as="textarea" valid={{check:this.state.content.length>0,valid:this.state.content.length===0?"验证失败":"您还可输入"+(contentMaxLength-this.state.content.length+"个字符")}} maxLength={contentMaxLength} onChange={(value:string)=>this.setState({content:value})}/>
{/*活动开始时间*/} {/*活动开始时间*/}
<InputGroup className="col-7 ml-auto mr-auto mt-3"> <InputGroup className="col-7 ml-auto mr-auto mt-3">
<InputGroup.Prepend> <InputGroup.Prepend>
<InputGroup.Text></InputGroup.Text> <InputGroup.Text></InputGroup.Text>
</InputGroup.Prepend> </InputGroup.Prepend>
<ReactDatetimeClass defaultValue={this.state.startTime} onChange={value => { <ReactDatetimeClass defaultValue={this.state.activityStartTime} onChange={value => {
if(moment.isMoment(value)){ if(moment.isMoment(value)){
this.setState({ this.setState({
startTime:value.format("YYYY-MM-DD HH:mm:ss") activityStartTime:value.format("YYYY-MM-DD HH:mm:ss")
}) })
} }
}} dateFormat="YYYY-MM-DD" timeFormat="HH:mm:ss"/> }} dateFormat="YYYY-MM-DD" timeFormat="HH:mm:ss"/>
@ -107,21 +147,21 @@ export class SendHelp extends React.Component<{ undefined?:undefined }, SendHelp
<InputGroup.Prepend> <InputGroup.Prepend>
<InputGroup.Text></InputGroup.Text> <InputGroup.Text></InputGroup.Text>
</InputGroup.Prepend> </InputGroup.Prepend>
<ReactDatetimeClass defaultValue={this.state.endTime} onChange={value => { <ReactDatetimeClass defaultValue={this.state.activityEndTime} onChange={value => {
if(moment.isMoment(value)){ if(moment.isMoment(value)){
this.setState({ this.setState({
endTime:value.format("YYYY-MM-DD HH:mm:ss") activityEndTime:value.format("YYYY-MM-DD HH:mm:ss")
}) })
} }
}} dateFormat="YYYY-MM-DD" timeFormat="HH:mm:ss"/> }} dateFormat="YYYY-MM-DD" timeFormat="HH:mm:ss"/>
</InputGroup> </InputGroup>
<UploadImg tip={"请上传活动背景图"} maxImageSize={maxImageSize} onChange={(value:string)=>this.setState({activityImg:value})} /> <UploadImg tip={"请上传活动背景图"} maxImageSize={maxImageSize} onChange={(value:string)=>this.setState({activityImgFile:value})} />
{/*服务地点*/} {/*服务地点*/}
<Address onChange={(value:string)=>this.setState({address:value})}/> <Address onChange={(value:string)=>this.setState({serviceAddress:value})}/>
<InputGroup className={"mt-3 col-3 ml-auto mr-auto "+(this.state.address.length>0?"":"d-none")}> <InputGroup className={"mt-3 col-3 ml-auto mr-auto "+(this.state.serviceAddress.length>0?"":"d-none")}>
<InputGroup.Prepend> <InputGroup.Prepend>
<InputGroup.Text></InputGroup.Text> <InputGroup.Text></InputGroup.Text>
</InputGroup.Prepend> </InputGroup.Prepend>
@ -176,7 +216,9 @@ export class SendHelp extends React.Component<{ undefined?:undefined }, SendHelp
</ListGroup.Item>)} </ListGroup.Item>)}
</ListGroup> </ListGroup>
<Button className="mt-3"></Button> <Button disabled={!this.check()} className="mt-3" onClick={()=>this.sendHelp()}></Button>
<MyDialog content={this.state.result} open={this.state.result!==null} titleId="register-tip" menuName="发布求助信息反馈" onClose={()=>this.setState({result:null})}/>
</Container> </Container>
); );
} }

@ -21,3 +21,12 @@ export const userObj={
flag:false, flag:false,
userType:UserType.seekHelp.toString() userType:UserType.seekHelp.toString()
} }
export const activityObj={
activityId:0,
title:"活动标题1",
content:"活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动",
activityImg:"logo512.png",
activityStartTime:new Date().getTime(),
activityEndTime:new Date().getTime()
}

@ -1556,6 +1556,13 @@
"@types/react" "*" "@types/react" "*"
hoist-non-react-statics "^3.3.0" hoist-non-react-statics "^3.3.0"
"@types/http-proxy@^1.17.4":
version "1.17.4"
resolved "https://registry.npm.taobao.org/@types/http-proxy/download/@types/http-proxy-1.17.4.tgz#e7c92e3dbe3e13aa799440ff42e6d3a17a9d045b"
integrity sha1-58kuPb4+E6p5lED/QubToXqdBFs=
dependencies:
"@types/node" "*"
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.2" version "2.0.2"
resolved "https://registry.npm.taobao.org/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.2.tgz#79d7a78bad4219f4c03d6557a1c72d9ca6ba62d5" resolved "https://registry.npm.taobao.org/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.2.tgz#79d7a78bad4219f4c03d6557a1c72d9ca6ba62d5"
@ -2566,7 +2573,7 @@ braces@^2.3.1, braces@^2.3.2:
split-string "^3.0.2" split-string "^3.0.2"
to-regex "^3.0.1" to-regex "^3.0.1"
braces@~3.0.2: braces@^3.0.1, braces@~3.0.2:
version "3.0.2" version "3.0.2"
resolved "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" resolved "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha1-NFThpGLujVmeI23zNs2epPiv4Qc= integrity sha1-NFThpGLujVmeI23zNs2epPiv4Qc=
@ -5310,7 +5317,18 @@ http-proxy-middleware@0.19.1:
lodash "^4.17.11" lodash "^4.17.11"
micromatch "^3.1.10" micromatch "^3.1.10"
http-proxy@^1.17.0: http-proxy-middleware@^1.0.4:
version "1.0.4"
resolved "https://registry.npm.taobao.org/http-proxy-middleware/download/http-proxy-middleware-1.0.4.tgz?cache=0&sync_timestamp=1589915518285&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-proxy-middleware%2Fdownload%2Fhttp-proxy-middleware-1.0.4.tgz#425ea177986a0cda34f9c81ec961c719adb6c2a9"
integrity sha1-Ql6hd5hqDNo0+cgeyWHHGa22wqk=
dependencies:
"@types/http-proxy" "^1.17.4"
http-proxy "^1.18.1"
is-glob "^4.0.1"
lodash "^4.17.15"
micromatch "^4.0.2"
http-proxy@^1.17.0, http-proxy@^1.18.1:
version "1.18.1" version "1.18.1"
resolved "https://registry.npm.taobao.org/http-proxy/download/http-proxy-1.18.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-proxy%2Fdownload%2Fhttp-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" resolved "https://registry.npm.taobao.org/http-proxy/download/http-proxy-1.18.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-proxy%2Fdownload%2Fhttp-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
integrity sha1-QBVB8FNIhLv5UmAzTnL4juOXZUk= integrity sha1-QBVB8FNIhLv5UmAzTnL4juOXZUk=
@ -6963,6 +6981,14 @@ micromatch@^3.1.10, micromatch@^3.1.4:
snapdragon "^0.8.1" snapdragon "^0.8.1"
to-regex "^3.0.2" to-regex "^3.0.2"
micromatch@^4.0.2:
version "4.0.2"
resolved "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
integrity sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=
dependencies:
braces "^3.0.1"
picomatch "^2.0.5"
miller-rabin@^4.0.0: miller-rabin@^4.0.0:
version "4.0.1" version "4.0.1"
resolved "https://registry.npm.taobao.org/miller-rabin/download/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" resolved "https://registry.npm.taobao.org/miller-rabin/download/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"
@ -7829,7 +7855,7 @@ performance-now@^2.1.0:
resolved "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" resolved "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
picomatch@^2.0.4, picomatch@^2.2.1: picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1:
version "2.2.2" version "2.2.2"
resolved "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.2.tgz?cache=0&sync_timestamp=1584790434095&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpicomatch%2Fdownload%2Fpicomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" resolved "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.2.tgz?cache=0&sync_timestamp=1584790434095&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpicomatch%2Fdownload%2Fpicomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha1-IfMz6ba46v8CRo9RRupAbTRfTa0= integrity sha1-IfMz6ba46v8CRo9RRupAbTRfTa0=

Loading…
Cancel
Save