优化操作反馈

master
pan 5 years ago
parent 6e4ba4f201
commit 958b6566aa
  1. 20
      src/Main.tsx
  2. 2
      src/my/MyHelp.tsx
  3. 4
      src/public.tsx

@ -58,6 +58,8 @@ export class Main extends React.Component<
userId:string;
//显示欢迎信息
result:boolean;
//打开个人信息变化提示
changeTip:JSX.Element|null;
}
>{
@ -77,7 +79,8 @@ export class Main extends React.Component<
result:Boolean(this.props.cookies.get(welcome_cookie)),
userType:this.props.cookies.get(user_type_cookie),
userId:this.props.cookies.get(user_cookie),
timeScore:this.props.cookies.get(time_score)
timeScore:this.props.cookies.get(time_score),
changeTip:null
}
}
@ -204,6 +207,11 @@ export class Main extends React.Component<
this.props.cookies.remove(welcome_cookie)
}}/>
<MyDialog content={this.state.changeTip} open={this.state.changeTip!==null} titleId='change-user-dialog'
menuName='个人信息刷新提示' onClose={()=>this.setState({
changeTip:null
})}/>
{this.state.subMenu}
</div>
);
@ -216,10 +224,18 @@ export class Main extends React.Component<
private refreshInfo(value:any) {
if('userType' in value) {
this.props.cookies.set(user_type_cookie, value.userType)
this.setState({
userType:value.userType,
changeTip:<h3 className='text-center text-info'></h3>
})
}
if('timeScore' in value){
this.props.cookies.set(time_score,value.timeScore)
this.setState({
userType:value.userType,
changeTip:<h3 className='text-center text-info'></h3>
})
}
this.setState(value)
}
}

@ -193,7 +193,7 @@ export class MyHelp extends React.Component<{
this.setState({
result:null
})
if(this.props.cookies?.get(time_score)!==this.state.timeScore&&this.props.refreshFun) {
if(this.state.timeScore&&this.props.cookies?.get(time_score)!==this.state.timeScore&&this.props.refreshFun) {
this.props.refreshFun({
timeScore:this.state.timeScore
})

@ -30,7 +30,9 @@ export function changeActivity(activityId:number,activityStatus:ActivityStatus,t
case SimpleMessage.ok:
callback(res.timeScore)
that.setState({
result:<h3 className="text-info text-center">{getStatus(activityStatus)}</h3>
result:<div>
<h3 className="text-info text-center">{getStatus(activityStatus)},{ActivityStatus.complete===activityStatus?'关闭此窗口将刷新时间币':null}</h3>
</div>
});break
case SimpleMessage.fail:
that.setState({

Loading…
Cancel
Save