Commit 3a2942b8 by Zhang Xin

Merge remote-tracking branch 'refs/remotes/origin/dev' into dev

parents e120d176 28aeea91
import fetch from 'isomorphic-fetch';
import actionTypes from '../actiontype/refreshImg'
const domain = ENV.domain;
let json = {
"meta": {
"code": "200",
"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"
}
]
}
const refreshImg = (data)=>{
return{
type:actionTypes.REFRESHIMG,
data
}
};
const getRefreshImg = (errorId,type)=>{
return(dispatch)=>{
// fetch(domain + '/web/flush_image.action',{
// credentials : 'include',
// method : 'POST',
// mode : 'cors',
// body : {}
//
// }).then((response)=>response.json())
// .then(json=>{
// console.log(json);
// }).catch(e=>{console.error(e)})
if(json.meta.success && json.data){
let data = {
errorId,
type,
files : json.data
};
dispatch(refreshImg(data))
}
}
}
export {getRefreshImg}
const actionTypes = {
REFRESHIMG : 'REFRESHIMG'
}
export default actionTypes
\ No newline at end of file
import React from 'react';
import Button from '../../CommonComponent/ButtonComponent/ButtonComponent'
require('./index.css');
export default class FinishTroubleComponent extends React.Component{
constructor(props){
super(props);
}
haveNext(){
console.log("有")
}
haveNoNext(){
console.log("没有")
}
render(){
return(
<div className={"finishTroubleComponent "}>
<div className={"selectText font40 col333"} style={{"marginTop":"230px"}}>出货板传送区、机械手平台、轨道是否有未出货遗留的货品</div>
<div className={"selectButtons"}>
<Button text={"有"} option={this.haveNext.bind(this)} style={{"marginTop":"128px"}}/>
<Button text={"没有"} option={this.haveNoNext.bind(this)} style={{"marginTop":"49px"}}/>
</div>
</div>
)
}
}
\ No newline at end of file
.finishTroubleComponent{
text-align: center;
}
.finishTroubleComponent .selectButtons{
display: flex;
flex-direction: column;
align-items:center;
}
\ No newline at end of file
const troubleType = {
1 : 'KN', //已知故障
3 : 'OP', //新建问题
};
module.exports = troubleType;
\ No newline at end of file
import actionTypes from '../actiontype/refreshImg';
const refreshImg = (content,data)=>{
return Object.assign({},content,data);
}
export default function(state={}, action) {
switch (action.type) {
case actionTypes.REFRESHIMG:
return refreshImg(state,action.data)
default:
return state;
}
}
\ 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