Commit ebd5255b by Zhang Xin

放到安卓上调试

parent 260c7578
......@@ -47,14 +47,18 @@ const getStoreInfo = (storeId)=>{
}).then((response)=>response.json())
.then(json=>{
console.log(json);
if(json.meta.success && json.data.warehouse){
dispatch(saveStoreInfo(Object.assign({},json.data.warehouse,{id:storeId})))
}else{
//没有店铺信息
}
// if(json.meta.success && json.data.warehouse){
// dispatch(saveStoreInfo(Object.assign({},json.data.warehouse,{id:storeId})))
// }else{
// //没有店铺信息
// }
}).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 = {
"description": "2:左侧动作故障,4:机械手移动到放货位置出错()",
"files": [
{
"id": 16,
"filePath": "/tmp/2016-08-16/1471329685902.jpg"
},
{
"id": 17,
"filePath": "/sku/0/0/427/1471329704482.jpg"
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
{
"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)=>{
body : JSON.stringify(bodyData)
}).then((response)=>response.json())
.then(json=>{
if(json.meta.success && json.data){
dispatch(saveHeaderInfo({taskId:json.data.taskId,sellOrderId:json.data.sellOrderId}))
dispatch(saveTroubleList(json.data))
}
// if(json.meta.success && json.data){
// dispatch(saveHeaderInfo({taskId:json.data.taskId,sellOrderId:json.data.sellOrderId}))
// dispatch(saveTroubleList(json.data))
// }
}).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 = {
"message": "成功",
"success": true
},
"data": [
{
"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": 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": 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": 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": 19,
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
}
]
"data": {
"files":[
{
"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": 19,
"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": 22,
"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": 24,
"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": 26,
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
}
]
}
}
const refreshImg = (data)=>{
......@@ -89,15 +91,20 @@ const getRefreshImg = (errorId,type)=>{
.then(json=>{
console.log(json);
if(json.meta.success && json.data){
let data = {
errorId,
type,
files : json.data.files ? json.data.files : []
};
dispatch(refreshImg(data))
// let data = {
// errorId,
// type,
// files : json.data.files ? json.data.files : []
// };
// dispatch(refreshImg(data))
}
}).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)=>{
.then(parseJson)
.then((data) => {
console.log("data :",data);
if(data.meta.success){
dispatch(getRefreshImg(errorId,type))
}
// if(data.meta.success){
// dispatch(getRefreshImg(errorId,type))
// }
})
.catch((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{
}) : null;
return (
<div className={"troubleItemComponent"}>
<div className={"troubleItemComponent "+((item.isExistProblem === 1 && item.explanation) || item.isExistProblem === 2 ? 'finish':'')}>
<div className={"finishBox"}>
<div className={"finishText colfff font24"}>已处理</div>
</div>
......
......@@ -49,7 +49,8 @@ class PageContainer extends React.Component {
page : null,
popupInfo : defaultPopupInfo,
showClock : false, //关门页面显示倒计时
headerInfo : {}
headerInfo : {},
pageStyle : {}
};
this.getPages = this.getPages.bind(this); //获取当前页面
this.showPopup = this.showPopup.bind(this); //显示弹窗
......@@ -70,6 +71,7 @@ class PageContainer extends React.Component {
this.showTroublePage = this.showTroublePage.bind(this); //根据用户type判断显示页面
this.showError = this.showError.bind(this); //展示错误信息
this.hideError = this.hideError.bind(this); //隐藏错误信息
this.getPageStyle = this.getPageStyle.bind(this); //
this.maxCountBackTime = 300;
this.count = 1000;
......@@ -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() {
this.getPageStyle();
let that = this;
let {dispatch} = this.props;
on(CONFIG.socketType.GETSTOREINFO,this,function (data) {
......@@ -414,7 +435,7 @@ class PageContainer extends React.Component {
render() {
let {state} = this.props;
return (
<div className={"pageContainer "} onTouchStart={()=>this.handleTouch()}>
<div className={"pageContainer "} onTouchStart={()=>this.handleTouch()} style={this.state.pageStyle}>
<PopupComponent popupInfo={this.state.popupInfo} />
{this.getPages()}
</div>
......
.pageContainer{
position: relative;
height: 945px;
width: 1920px;
height: 0;
width: 0;
transform-origin: 0 0 0;
/*transform: scale(0.67) translate(-483px,-232px);*/
}
.pageContainer.backColfff{
background-color: #ffffff;
......
......@@ -10,6 +10,7 @@ export default class TextAreaContainer extends React.Component{
}
this.getOtherHeader = this.getOtherHeader.bind(this);
this.saveText = this.saveText.bind(this);
this.handleChange = this.handleChange.bind(this);
}
componentWillMount() {
......@@ -23,6 +24,21 @@ export default class TextAreaContainer extends React.Component{
let value = e.target.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(){
if(this.state.text){
......@@ -54,7 +70,11 @@ export default class TextAreaContainer extends React.Component{
</HeaderComponent>
<div className={"textAreaContainer"}>
<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>
......
......@@ -23,7 +23,8 @@ export default class TroubleContainer extends React.Component{
currentErrorCode : 0,
tmpText : '',
tmpUrl : '',
showStatus:showDom[1]
showStatus:showDom[1],
style : {}
};
this.setItem = this.setItem.bind(this);
this.showText = this.showText.bind(this);
......@@ -35,6 +36,7 @@ export default class TroubleContainer extends React.Component{
this.getQrcodeDom = this.getQrcodeDom.bind(this);
this.updateImg = this.updateImg.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{
this.setState({
currentErrorCode : errcode,
showStatus : showDom[2],
tmpText: text
tmpText: text,
})
}
}
showQrcode(errcode){
......@@ -107,7 +108,7 @@ export default class TroubleContainer extends React.Component{
this.setState({
currentErrorCode : errcode,
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{
currentErrorCode : 0,
showStatus : showDom[1],
tmpText: '',
tmpUrl : ''
tmpUrl : '',
style:{}
})
}
......@@ -215,11 +217,19 @@ export default class TroubleContainer extends React.Component{
)
}
setStyle(style){
// this.setState({
// style : style
// })
}
getTextAreaDom(){
return <TextArea
text={this.state.tmpText}
goBack={this.goBack}
saveText={this.saveText}/>
saveText={this.saveText}
setStyle={this.setStyle}
/>
}
getQrcodeDom(){
......
......@@ -26,7 +26,7 @@ button, input, select, textarea { /* for ie */
outline: none;
}
html, body {
height: 100%;
/*height: 100%;*/
background-color: #f5f5f5;
}
......
......@@ -2,6 +2,6 @@
* Created by ruibing on 16/11/2.
*/
module.exports = {
domain: 'http://192.168.10.120:8080/maxbox/web/',
domain: 'http://test.mjitech.com/web/',
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