Commit 63ed0d3a by Zhang Xin

fix opendoor commonInfo

parent 43f4fd99
import fetch from 'isomorphic-fetch'
import {logout,getTaskList} from "./common";
import {logout, getTaskList, saveCommonInfo} from "./common";
let domain = ENV.domain;
// let domain1='http://192.168.10.184:8080/maxbox/web/'
const willCloseDoor=(data,flag=false)=>{
......@@ -22,7 +22,11 @@ const willCloseDoor=(data,flag=false)=>{
}).then((response)=>response.json())
.then((json)=>{
if(flag){
//回收箱完成
dispatch(getTaskList(data))
}else{
//没有问题,完成任务
// dispatch(saveCommonInfo(Object.assign({},{taskInfo:{currentTaskType:'FINISH'}})))
}
// dispatch(closeDoorSuccess(data));
})
......
......@@ -9,9 +9,10 @@ export default class HomePageContainer extends React.Component{
constructor(props){
super(props);
this.state = {
text : ''
text : '',
closeDoorStatus : 0
}
this.logout = this.logout.bind(this)
this.logout = this.logout.bind(this);
this.showLogoutPopup = this.showLogoutPopup.bind(this)
}
......@@ -38,10 +39,23 @@ export default class HomePageContainer extends React.Component{
}
logout(){
if(this.state.closeDoorStatus === 0){
this.setState({
closeDoorStatus : 1
},()=>{
this.props.willCloseDoor();
// let msg={type:'WILL_CLOSEDOOR'};
// sendMsg(JSON.stringify(msg));
// this.props.changeIsSend(true);
this.props.tempLogout()
})
}
}
componentWillUnmount(){
this.setState({
closeDoorStatus : 0
})
}
showLogoutPopup(){
......@@ -89,7 +103,7 @@ export default class HomePageContainer extends React.Component{
: null
}
<div className={"homeText font42"} style={{marginTop:marginTop20}}>请关门,然后继续完成其他工作</div>
<Button text={'关门'} btnContainer={'colfff font30'} style={buttonStyle} option={this.logout.bind(this)}/>
<Button text={this.state.closeDoorStatus ? '关门中...' : '请点击按钮后关门'} btnContainer={'colfff font30'} style={buttonStyle} option={this.logout.bind(this)}/>
</div> :
<div className={"homeContainer"} >
<img className={"homeIcon"} style={imgStyle} src={UTILPATH.localImg.homePage} alt=""/>
......
......@@ -194,7 +194,7 @@ class PageContainer extends React.Component {
}
if(info.area){
//区域信息
dispatch(saveCommonInfo(Object.assign({},{taskInfo:{area:info.area,taskId:0,currentTaskType:''}})))
dispatch(saveCommonInfo(Object.assign({},{taskInfo:{area:info.area,taskId:0,currentTaskType:'OPEN'}})))
}
this.setState({
......@@ -270,11 +270,11 @@ class PageContainer extends React.Component {
//补货人员,根据type判断显示页面
let nextTaskInfo = nextCommonInfo.taskInfo || {};
let lastCurrentType = taskInfo.currentTaskType;
let lastCurrentType = taskInfo.currentTaskType || '';
if(nextUserInfo.taskType === "SECOND" && nextTaskInfo && nextTaskInfo.currentTaskType &&
nextTaskInfo.currentTaskType !== lastCurrentType
nextTaskInfo.currentTaskType !== lastCurrentType && lastCurrentType !== 'FINISH'
){
switch (nextTaskInfo.currentTaskType) {
case 'LR' :
......@@ -299,6 +299,9 @@ class PageContainer extends React.Component {
case 'REA' :
this.changePages(CONFIG.showPage[15]);
break;
case 'FINISH' :
this.changePages(CONFIG.showPage[131]);
break;
default:
this.changePages(CONFIG.showPage[13]);
break;
......@@ -614,6 +617,9 @@ class PageContainer extends React.Component {
case 'REA' :
this.changePages(CONFIG.showPage[15]);
break;
case 'FINISH':
this.changePages(CONFIG.showPage[131]);
break;
default:
this.changePages(CONFIG.showPage[13]);
break;
......
......@@ -23,11 +23,11 @@ export default class QuestionContainer extends React.Component{
handleNoQuestion(){
let {menuType = '',changePages} = this.props;
let {menuType = '',changePages,willCloseDoor} = this.props;
if(menuType){
this.context.goBackTask()
}else{
this.props.willCloseDoor();
// willCloseDoor();
changePages(CONFIG.showPage[131])
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment