Commit ebd5255b by Zhang Xin

放到安卓上调试

parent 260c7578
...@@ -47,14 +47,18 @@ const getStoreInfo = (storeId)=>{ ...@@ -47,14 +47,18 @@ const getStoreInfo = (storeId)=>{
}).then((response)=>response.json()) }).then((response)=>response.json())
.then(json=>{ .then(json=>{
console.log(json); console.log(json);
if(json.meta.success && json.data.warehouse){ // if(json.meta.success && json.data.warehouse){
dispatch(saveStoreInfo(Object.assign({},json.data.warehouse,{id:storeId}))) // dispatch(saveStoreInfo(Object.assign({},json.data.warehouse,{id:storeId})))
}else{ // }else{
//没有店铺信息 // //没有店铺信息
} // }
}).catch(e=>{console.error(e)}) }).catch(e=>{console.error(e)})
if(json.meta.success && json.data.warehouse){
dispatch(saveStoreInfo(Object.assign({},json.data.warehouse,{id:storeId})))
}else{
//没有店铺信息
}
} }
} }
......
...@@ -19,17 +19,17 @@ let json = { ...@@ -19,17 +19,17 @@ let json = {
"description": "2:左侧动作故障,4:机械手移动到放货位置出错()", "description": "2:左侧动作故障,4:机械手移动到放货位置出错()",
"files": [ "files": [
{ {
"id": 16,
"filePath": "/tmp/2016-08-16/1471329685902.jpg"
},
{
"id": 17, "id": 17,
"filePath": "/sku/0/0/427/1471329704482.jpg" "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
}, },
{ {
"id": 18, "id": 18,
"filePath": "/sku/0/0/426/1471330380712.jpg" "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
} },
{
"id": 19,
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
], ],
}, },
{ {
...@@ -92,12 +92,15 @@ const getTroubleList = (info)=>{ ...@@ -92,12 +92,15 @@ const getTroubleList = (info)=>{
body : JSON.stringify(bodyData) body : JSON.stringify(bodyData)
}).then((response)=>response.json()) }).then((response)=>response.json())
.then(json=>{ .then(json=>{
if(json.meta.success && json.data){ // if(json.meta.success && json.data){
dispatch(saveHeaderInfo({taskId:json.data.taskId,sellOrderId:json.data.sellOrderId})) // dispatch(saveHeaderInfo({taskId:json.data.taskId,sellOrderId:json.data.sellOrderId}))
dispatch(saveTroubleList(json.data)) // dispatch(saveTroubleList(json.data))
} // }
}).catch(e=>{console.error(e)}) }).catch(e=>{console.error(e)})
if(json.meta.success && json.data){
dispatch(saveHeaderInfo({taskId:json.data.taskId,sellOrderId:json.data.sellOrderId}))
dispatch(saveTroubleList(json.data))
}
} }
}; };
......
...@@ -10,44 +10,46 @@ let json = { ...@@ -10,44 +10,46 @@ let json = {
"message": "成功", "message": "成功",
"success": true "success": true
}, },
"data": [ "data": {
{ "files":[
"id": 17, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 17,
}, "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
{ },
"id": 18, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 18,
}, "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
{ },
"id": 19, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 19,
}, "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
{ },
"id": 17, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 21,
}, "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
{ },
"id": 18, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 22,
}, "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
{ },
"id": 19, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 23,
}, "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
{ },
"id": 17, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 24,
}, "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
{ },
"id": 18, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 25,
}, "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
{ },
"id": 19, {
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg" "id": 26,
} "filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
] }
]
}
} }
const refreshImg = (data)=>{ const refreshImg = (data)=>{
...@@ -89,15 +91,20 @@ const getRefreshImg = (errorId,type)=>{ ...@@ -89,15 +91,20 @@ const getRefreshImg = (errorId,type)=>{
.then(json=>{ .then(json=>{
console.log(json); console.log(json);
if(json.meta.success && json.data){ if(json.meta.success && json.data){
let data = { // let data = {
errorId, // errorId,
type, // type,
files : json.data.files ? json.data.files : [] // files : json.data.files ? json.data.files : []
}; // };
dispatch(refreshImg(data)) // dispatch(refreshImg(data))
} }
}).catch(e=>{console.error(e)}) }).catch(e=>{console.error(e)})
let data = {
errorId,
type,
files : json.data.files ? json.data.files : []
};
dispatch(refreshImg(data))
} }
}; };
...@@ -119,13 +126,21 @@ const deleteImg = (errorId,type,fileId)=>{ ...@@ -119,13 +126,21 @@ const deleteImg = (errorId,type,fileId)=>{
.then(parseJson) .then(parseJson)
.then((data) => { .then((data) => {
console.log("data :",data); console.log("data :",data);
if(data.meta.success){ // if(data.meta.success){
dispatch(getRefreshImg(errorId,type)) // dispatch(getRefreshImg(errorId,type))
} // }
}) })
.catch((err) =>{ .catch((err) =>{
console.error("Err:",err); console.error("Err:",err);
}); });
let info = json.data.files.filter(i=>i.id !== fileId);
let data = {
errorId,
type,
files : info
};
dispatch(refreshImg(data))
} }
} }
......
...@@ -63,7 +63,7 @@ export default class TroubleItemComponent extends React.Component{ ...@@ -63,7 +63,7 @@ export default class TroubleItemComponent extends React.Component{
}) : null; }) : null;
return ( return (
<div className={"troubleItemComponent"}> <div className={"troubleItemComponent "+((item.isExistProblem === 1 && item.explanation) || item.isExistProblem === 2 ? 'finish':'')}>
<div className={"finishBox"}> <div className={"finishBox"}>
<div className={"finishText colfff font24"}>已处理</div> <div className={"finishText colfff font24"}>已处理</div>
</div> </div>
......
...@@ -49,7 +49,8 @@ class PageContainer extends React.Component { ...@@ -49,7 +49,8 @@ class PageContainer extends React.Component {
page : null, page : null,
popupInfo : defaultPopupInfo, popupInfo : defaultPopupInfo,
showClock : false, //关门页面显示倒计时 showClock : false, //关门页面显示倒计时
headerInfo : {} headerInfo : {},
pageStyle : {}
}; };
this.getPages = this.getPages.bind(this); //获取当前页面 this.getPages = this.getPages.bind(this); //获取当前页面
this.showPopup = this.showPopup.bind(this); //显示弹窗 this.showPopup = this.showPopup.bind(this); //显示弹窗
...@@ -70,6 +71,7 @@ class PageContainer extends React.Component { ...@@ -70,6 +71,7 @@ class PageContainer extends React.Component {
this.showTroublePage = this.showTroublePage.bind(this); //根据用户type判断显示页面 this.showTroublePage = this.showTroublePage.bind(this); //根据用户type判断显示页面
this.showError = this.showError.bind(this); //展示错误信息 this.showError = this.showError.bind(this); //展示错误信息
this.hideError = this.hideError.bind(this); //隐藏错误信息 this.hideError = this.hideError.bind(this); //隐藏错误信息
this.getPageStyle = this.getPageStyle.bind(this); //
this.maxCountBackTime = 300; this.maxCountBackTime = 300;
this.count = 1000; this.count = 1000;
...@@ -82,7 +84,26 @@ class PageContainer extends React.Component { ...@@ -82,7 +84,26 @@ class PageContainer extends React.Component {
}; };
} }
getPageStyle(){
let deviceWidth = window.innerWidth;
let deviceHeight = window.innerHeight;
let scaleX = deviceWidth / 1920;
let scaleY = deviceHeight / 1080;
let left = 1920 - deviceWidth;
let top = 1080 * (1 - scaleX);
let style = {
'transform':`scale(${scaleX})`,
'height': '945px',
'width': '1920px'
};
this.setState({
pageStyle : style
})
}
componentWillMount() { componentWillMount() {
this.getPageStyle();
let that = this; let that = this;
let {dispatch} = this.props; let {dispatch} = this.props;
on(CONFIG.socketType.GETSTOREINFO,this,function (data) { on(CONFIG.socketType.GETSTOREINFO,this,function (data) {
...@@ -414,7 +435,7 @@ class PageContainer extends React.Component { ...@@ -414,7 +435,7 @@ class PageContainer extends React.Component {
render() { render() {
let {state} = this.props; let {state} = this.props;
return ( return (
<div className={"pageContainer "} onTouchStart={()=>this.handleTouch()}> <div className={"pageContainer "} onTouchStart={()=>this.handleTouch()} style={this.state.pageStyle}>
<PopupComponent popupInfo={this.state.popupInfo} /> <PopupComponent popupInfo={this.state.popupInfo} />
{this.getPages()} {this.getPages()}
</div> </div>
......
.pageContainer{ .pageContainer{
position: relative; position: relative;
height: 945px; height: 0;
width: 1920px; width: 0;
transform-origin: 0 0 0;
/*transform: scale(0.67) translate(-483px,-232px);*/
} }
.pageContainer.backColfff{ .pageContainer.backColfff{
background-color: #ffffff; background-color: #ffffff;
......
...@@ -10,6 +10,7 @@ export default class TextAreaContainer extends React.Component{ ...@@ -10,6 +10,7 @@ export default class TextAreaContainer extends React.Component{
} }
this.getOtherHeader = this.getOtherHeader.bind(this); this.getOtherHeader = this.getOtherHeader.bind(this);
this.saveText = this.saveText.bind(this); this.saveText = this.saveText.bind(this);
this.handleChange = this.handleChange.bind(this);
} }
componentWillMount() { componentWillMount() {
...@@ -23,6 +24,21 @@ export default class TextAreaContainer extends React.Component{ ...@@ -23,6 +24,21 @@ export default class TextAreaContainer extends React.Component{
let value = e.target.value; let value = e.target.value;
this.setState({text: value}); this.setState({text: value});
} }
handleBlur(){
console.log("--handleBlur--");
this.props.setStyle({
'position':'absolute',
'top':'0px'
})
}
handleFocus(){
console.log("==handleFocus==");
this.props.setStyle({
'position':'absolute',
'top':'120px'
})
}
saveText(){ saveText(){
if(this.state.text){ if(this.state.text){
...@@ -54,7 +70,11 @@ export default class TextAreaContainer extends React.Component{ ...@@ -54,7 +70,11 @@ export default class TextAreaContainer extends React.Component{
</HeaderComponent> </HeaderComponent>
<div className={"textAreaContainer"}> <div className={"textAreaContainer"}>
<div className={"textAreaDiv font30 col999"} > <div className={"textAreaDiv font30 col999"} >
<textarea className={"textAreaBox font30 col999"} name="" id="" cols="30" rows="10" onChange={this.handleChange.bind(this)} value={this.state.text} placeholder={"点击输入"}></textarea> <textarea className={"textAreaBox font30 col999"} name="" id="" cols="30" rows="10"
onChange={this.handleChange.bind(this)} value={this.state.text}
placeholder={"点击输入"} onBlur={this.handleBlur.bind(this)}
onFocus={this.handleFocus.bind(this)}
></textarea>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -23,7 +23,8 @@ export default class TroubleContainer extends React.Component{ ...@@ -23,7 +23,8 @@ export default class TroubleContainer extends React.Component{
currentErrorCode : 0, currentErrorCode : 0,
tmpText : '', tmpText : '',
tmpUrl : '', tmpUrl : '',
showStatus:showDom[1] showStatus:showDom[1],
style : {}
}; };
this.setItem = this.setItem.bind(this); this.setItem = this.setItem.bind(this);
this.showText = this.showText.bind(this); this.showText = this.showText.bind(this);
...@@ -35,6 +36,7 @@ export default class TroubleContainer extends React.Component{ ...@@ -35,6 +36,7 @@ export default class TroubleContainer extends React.Component{
this.getQrcodeDom = this.getQrcodeDom.bind(this); this.getQrcodeDom = this.getQrcodeDom.bind(this);
this.updateImg = this.updateImg.bind(this); this.updateImg = this.updateImg.bind(this);
this.dealTrouble = this.dealTrouble.bind(this); this.dealTrouble = this.dealTrouble.bind(this);
this.setStyle = this.setStyle.bind(this);
} }
...@@ -93,10 +95,9 @@ export default class TroubleContainer extends React.Component{ ...@@ -93,10 +95,9 @@ export default class TroubleContainer extends React.Component{
this.setState({ this.setState({
currentErrorCode : errcode, currentErrorCode : errcode,
showStatus : showDom[2], showStatus : showDom[2],
tmpText: text tmpText: text,
}) })
} }
} }
showQrcode(errcode){ showQrcode(errcode){
...@@ -107,7 +108,7 @@ export default class TroubleContainer extends React.Component{ ...@@ -107,7 +108,7 @@ export default class TroubleContainer extends React.Component{
this.setState({ this.setState({
currentErrorCode : errcode, currentErrorCode : errcode,
showStatus : showDom[3], showStatus : showDom[3],
tmpUrl: `${ENV.uploadImg}/${indexInfo.id}/${indexInfo.type}` tmpUrl: `${ENV.uploadImg}/${indexInfo.id}/${indexInfo.type}`,
}) })
} }
} }
...@@ -136,7 +137,8 @@ export default class TroubleContainer extends React.Component{ ...@@ -136,7 +137,8 @@ export default class TroubleContainer extends React.Component{
currentErrorCode : 0, currentErrorCode : 0,
showStatus : showDom[1], showStatus : showDom[1],
tmpText: '', tmpText: '',
tmpUrl : '' tmpUrl : '',
style:{}
}) })
} }
...@@ -215,11 +217,19 @@ export default class TroubleContainer extends React.Component{ ...@@ -215,11 +217,19 @@ export default class TroubleContainer extends React.Component{
) )
} }
setStyle(style){
// this.setState({
// style : style
// })
}
getTextAreaDom(){ getTextAreaDom(){
return <TextArea return <TextArea
text={this.state.tmpText} text={this.state.tmpText}
goBack={this.goBack} goBack={this.goBack}
saveText={this.saveText}/> saveText={this.saveText}
setStyle={this.setStyle}
/>
} }
getQrcodeDom(){ getQrcodeDom(){
......
...@@ -26,7 +26,7 @@ button, input, select, textarea { /* for ie */ ...@@ -26,7 +26,7 @@ button, input, select, textarea { /* for ie */
outline: none; outline: none;
} }
html, body { html, body {
height: 100%; /*height: 100%;*/
background-color: #f5f5f5; background-color: #f5f5f5;
} }
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
* Created by ruibing on 16/11/2. * Created by ruibing on 16/11/2.
*/ */
module.exports = { module.exports = {
domain: 'http://192.168.10.120:8080/maxbox/web/', domain: 'http://test.mjitech.com/web/',
uploadImg : 'https://test.mjitech.com/static/uploadTrouble/' uploadImg : 'https://test.mjitech.com/static/uploadTrouble/'
} }
\ No newline at end of file
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