Commit 54f8f3f4 by yaxiLiuu

Merge branch 'dev' of git.mjitech.com:zhangxin/max_android_panel into dev

parents 7b38ac04 5697e6c6
......@@ -34,9 +34,54 @@ let json = {
},
{
"id": 1,
"errorCode": null,
"errorCode": "ER00002",
"type": "OP",
"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"
},
],
"parentProblemName": "机械故障",
"subProblemName": "其他问题111"
},
{
"id": 1,
"errorCode": "ER00003",
"type": "OP",
"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": 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"
}
],
"parentProblemName": "机械故障",
"subProblemName": "其他问题111"
......
......@@ -42,18 +42,16 @@ export default class ImgToolComponent extends React.Component{
if(type == "add" && disabled){
imgSrc = addIconDisabledSrc;
}
if(type == "refresh" && disabled){
if(type === "refresh" && disabled){
imgSrc = refreshIconDisabledSrc;
}
return(
<div className={"ImgToolComponent"}>
<div className={"imgItem"}>
<img src={imgSrc} alt="" onClick={props.handleClikImgFunc}/>
<img src={imgSrc} data-src={imgSrc} className={"swiper-lazy"} alt="" onClick={props.handleClikImgFunc}/>
{
noCloseBtn?"":(<span className={"closeBtn"} onClick={props.handleClikCloseFunc}>×</span>)
}
</div>
</div>
)
}
......
.ImgToolComponent {
display: inline-block;
}
.ImgToolComponent .imgItem {
width: 90px;
height: 90px;
display: inline-block;
box-sizing: border-box;
/*width: 90px;*/
/*height: 90px;*/
/*box-sizing: border-box;*/
margin-right: 25px;
position: relative;
}
.ImgToolComponent .uploadImgRight{
float: left;
}
.ImgToolComponent .imgItem img{
.ImgToolComponent>img{
width: 90px;
height: 90px;
border-radius: 10px;
}
.ImgToolComponent .imgItem .closeBtn{
.ImgToolComponent .closeBtn{
width: 32px;
height: 32px;
display: inline-block;
......@@ -41,7 +35,9 @@
height: 732px;
width: 976px;
text-align: center;
line-height: 732px;
}
.showBigImg>img{
height: 100%;
max-height: 100%;
vertical-align: middle;
}
\ No newline at end of file
......@@ -28,17 +28,20 @@ export default class SwiperComponent extends React.Component{
}
componentWillReceiveProps(nextProps){
}
componentDidUpdate(prevProps){
const { swiperCount,swiperContainer,initialSlide,initialSlideTime } = this.props;
if (prevProps.swiperCount !== swiperCount) {
this.state.swiperList[swiperContainer].init();
}
if(
initialSlideTime &&
initialSlide !== prevProps.initialSlide
){
this.state.swiperList[swiperContainer].slideTo(initialSlide,0);
}
// if(
// initialSlideTime &&
// initialSlide !== prevProps.initialSlide
// ){
// this.state.swiperList[swiperContainer].slideTo(initialSlide,0);
// }
}
componentWillUnmount() {
......
......@@ -126,14 +126,8 @@ export default class TroubleItemComponent extends React.Component{
</div>
<div className={"itemControl rel"}>
{/*<div className={"plusImg controlBox "} onClick={()=>props.showQrcode(item.errorCode)}>*/}
{/*<img src={UTILPATH.localImg.plusIcon} alt=""/>*/}
{/*</div>*/}
{/*<div className={"refreshImg controlBox "} onClick={()=>props.getRefreshImg(item.id,item.type)}>*/}
{/*<img src={UTILPATH.localImg.refreshIcon} alt=""/>*/}
{/*</div>*/}
{imgFiles}
<ImageComponent type={"add"} handleClikImgFunc = {this.addImg} noCloseBtn = {true} />
<ImageComponent disabled={!(item.isExistProblem && parseInt(item.isExistProblem) === 1)} type={"add"} handleClikImgFunc = {this.addImg} noCloseBtn = {true} />
<ImageComponent handleClikImgFunc = {this.reRreshImg} type={"refresh"} noCloseBtn = {true} />
</div>
......
.troubleItemComponent{
width: 1396px;
height: 608px;
border: 1px solid #e5e5e5;
border: 3px solid #e5e5e5;
background-color: #ffffff;
border-radius: 20px;
overflow: hidden;
......@@ -91,9 +91,9 @@
right: 46px;
}
.troubleItemComponent .itemControl{
display: flex;
flex-direction: row;
flex-wrap: nowrap;
/*display: flex;*/
/*flex-direction: row;*/
/*flex-wrap: nowrap;*/
}
.troubleItemComponent .itemControl .controlBox{
width: 90px;
......@@ -128,7 +128,7 @@
text-align: center;
width: 178px;
height: 178px;
line-height: 126px;
line-height: 106px;
left: -89px;
top: -89px;
transform: rotate(45deg);
......
......@@ -37,7 +37,7 @@ const defaultPopupInfo = {
popupButtons : [], // 默认弹窗的按钮
classNames : '' //自定义类名
};
const initPage = showPage[7];
const initPage = 7;
const errorType = {
1 : 1, //屏幕超时操作
......@@ -49,7 +49,7 @@ class PageContainer extends React.Component {
constructor(props) {
super(props);
this.state = {
showPage : initPage,
showPage : showPage[initPage],
lastPage : '',
page : null,
popupInfo : defaultPopupInfo,
......@@ -402,7 +402,7 @@ class PageContainer extends React.Component {
refreshImg = {state.refreshImg}
storeInfo={state.storeInfo}
userInfo={state.userInfo}
initTroubleList={()=>dispatch(getTroubleList())}
initTroubleList={(info)=>dispatch(getTroubleList(info))}
showTextArea={(text)=>this.showTextArea(text)}
showPopup={(info)=>this.showPopup(info)}
hidePopup={()=>this.hidePopup()}
......
......@@ -24,7 +24,9 @@ export default class TroubleContainer extends React.Component{
tmpText : '',
tmpUrl : '',
showStatus:showDom[1],
style : {}
style : {},
initialSlide : 0,
tempinitialSlide : 0
};
this.setItem = this.setItem.bind(this);
this.showText = this.showText.bind(this);
......@@ -37,12 +39,13 @@ export default class TroubleContainer extends React.Component{
this.updateImg = this.updateImg.bind(this);
this.dealTrouble = this.dealTrouble.bind(this);
this.setStyle = this.setStyle.bind(this);
this.onSlideChangeEnd = this.onSlideChangeEnd.bind(this);
}
componentWillMount(){
let {troubleList} = this.props;
// initTroubleList();
let {troubleList,initTroubleList} = this.props;
// initTroubleList({storeId: 17, employeeId: 5, token: "966D5C0B-3CF2-420D-B9A3-313BA37DE092"});
this.setState({
troubleList : troubleList
})
......@@ -71,7 +74,6 @@ export default class TroubleContainer extends React.Component{
this.updateImg(refreshImg);
}
}
updateImg(info){
......@@ -90,12 +92,15 @@ export default class TroubleContainer extends React.Component{
let troubleList = this.state.troubleList;
let details = troubleList.details;
let indexInfo = details.find(d=>d.errorCode === errcode);
let index = details.findIndex(d=>d.errorCode === errcode);
console.log("showText index ", index)
if(indexInfo && indexInfo.id){
let text = indexInfo.explanation;
this.setState({
currentErrorCode : errcode,
showStatus : showDom[2],
tmpText: text,
tempinitialSlide : index
})
}
}
......@@ -104,11 +109,14 @@ export default class TroubleContainer extends React.Component{
let troubleList = this.state.troubleList;
let details = troubleList.details;
let indexInfo = details.find(d=>d.errorCode === errcode);
let index = details.findIndex(d=>d.errorCode === errcode);
console.log("showQrcode index ", index)
if(indexInfo && indexInfo.id){
this.setState({
currentErrorCode : errcode,
showStatus : showDom[3],
tmpUrl: `${ENV.uploadImg}/${indexInfo.id}/${indexInfo.type}`,
tempinitialSlide : index
})
}
}
......@@ -133,12 +141,14 @@ export default class TroubleContainer extends React.Component{
}
goBack(){
console.log("goBack initialSlide ", this.state.initialSlide)
this.setState({
currentErrorCode : 0,
showStatus : showDom[1],
tmpText: '',
tmpUrl : '',
style:{}
style:{},
initialSlide : this.state.tempinitialSlide
})
}
......@@ -167,6 +177,9 @@ export default class TroubleContainer extends React.Component{
}
}
onSlideChangeEnd(swiper){
}
getDefaultDom(){
let {userInfo,storeInfo,getRefreshImg,deleteImg,changePages,showPopup,hidePopup} = this.props;
let troubleList = this.state.troubleList;
......@@ -182,13 +195,32 @@ export default class TroubleContainer extends React.Component{
/>;
});
let initialSlide = this.state.initialSlide;
let swiperOptions = {
width : 1396,
spaceBetween: 30,
freeMode:true,
// freeMode:true,
// pagination: '.pagination',
// loop:false,
mode: 'horizontal',
touchRatio:0.5,
longSwipesRatio:0.1,
threshold:50,
lazyLoadingInPrevNext:true,
lazyLoading : true,
followFinger:false,
observer: true,//修改swiper自己或子元素时,自动初始化swiper
observeParents: true,//修改swiper的父元素时,自动初始化swiper
lazyLoadingInPrevNextAmount: 1,
onSlideChangeEnd : this.onSlideChangeEnd,
initialSlide : initialSlide
};
let swiperContainer = CONFIG.swiperContainers.troubleSwiperContainer;
let swiperCount = details.length;
console.log("render slide ",this.state.initialSlide)
return(
<div className={"toubleContainer " + (showTrouble ? '' : 'hide')}>
<HeaderComponent
......@@ -204,6 +236,7 @@ export default class TroubleContainer extends React.Component{
<div className={"troubleBox"}>
<SwiperComponent
swiperContainer={swiperContainer} swiperOptions={swiperOptions} swiperCount={swiperCount}
initialSlide={initialSlide}
>
{dom}
</SwiperComponent>
......
......@@ -31,5 +31,6 @@ let store = activateVendor();
// UTILPATH.socket.init(129,17);
UTILPATH.socket.testIp(209);
// UTILPATH.socket.testIp(199);
renderPage(store);
\ 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