Commit f1338701 by yaxiLiuu

fixed the other problem redecer â€

parent 28aeea91
...@@ -144,7 +144,10 @@ export function initGetOtherProblem(postData) { ...@@ -144,7 +144,10 @@ export function initGetOtherProblem(postData) {
} }
} }
export function addNewProbem(postaData) { export function addNewProbem(postaData) {
dispatch(addNewProblemSuccess(fakseJsonData2.data)) return (dispatch) =>{
dispatch(addNewProblemSuccess(fakseJsonData2.data))
}
} }
function initSuccess(data) { function initSuccess(data) {
...@@ -158,4 +161,37 @@ function addNewProblemSuccess(data) { ...@@ -158,4 +161,37 @@ function addNewProblemSuccess(data) {
type:actionTypes.ADD_NEWPROBLEM_SUCCESS, type:actionTypes.ADD_NEWPROBLEM_SUCCESS,
data data
} }
}
function deleteProblemSuccess(data) {
return{
type:actionTypes.DELETE_PROBLEM_SUCCESS,
data
}
}
function submitProblemList(data) {
return{
type:actionTypes.SUBMIT_PROBLEM_SUCCESS,
data
}
}
function addImgSuccess(data) {
return{
type:actionTypes.ADD_IMG_SUCCESS,
data
}
}
function deleteImgSuccess(data) {
return{
type:actionTypes.DELETE_IMG_SUCCESS,
data
}
}
function overStepSuccess(data) {
return{
type:actionTypes.OVER_STEP_SUCCESS,
data
}
} }
\ No newline at end of file
/*const INIT_SCANBARCODEGETPRODUCTINFO_SUCCESS = 'INIT_SCANBARCODEGETPRODUCTINFO_SUCCESS'*/ /*const INIT_SCANBARCODEGETPRODUCTINFO_SUCCESS = 'INIT_SCANBARCODEGETPRODUCTINFO_SUCCESS'*/
// 初始化问题
const INIT_GETNEWPROBLEM_SUCCESS = 'INIT_GETNEWPROBLEM_SUCCESS'; const INIT_GETNEWPROBLEM_SUCCESS = 'INIT_GETNEWPROBLEM_SUCCESS';
// 添加新问题
const ADD_NEWPROBLEM_SUCCESS = 'ADD_NEWPROBLEM_SUCCESS'; const ADD_NEWPROBLEM_SUCCESS = 'ADD_NEWPROBLEM_SUCCESS';
// 删除当前问题
const DELETE_PROBLEM_SUCCESS = 'DELETE_PROBLEM_SUCCESS';
// 提交当前编辑的问题
const SUBMIT_PROBLEM_SUCCESS = 'SUBMIT_PROBLEM_SUCCESS';
// 添加图片
const ADD_IMG_SUCCESS = "ADD_IMG_SUCCESS";
// 删除图片
const DELETE_IMG_SUCCESS = "DELETE_IMG_SUCCESS";
// 跳过
const OVER_STEP_SUCCESS = "OVER-STEP_SUCCESSS";
module.exports = {INIT_GETNEWPROBLEM_SUCCESS,ADD_NEWPROBLEM_SUCCESS} module.exports = {INIT_GETNEWPROBLEM_SUCCESS,ADD_NEWPROBLEM_SUCCESS,DELETE_PROBLEM_SUCCESS,SUBMIT_PROBLEM_SUCCESS,ADD_IMG_SUCCESS,OVER_STEP_SUCCESS,DELETE_IMG_SUCCESS}
...@@ -30,8 +30,6 @@ export default class EditProblemItem extends React.Component{ ...@@ -30,8 +30,6 @@ export default class EditProblemItem extends React.Component{
}) })
} }
handleShowElement(value){ handleShowElement(value){
console.log(value);
console.log(this.state[value]);
if(value == "showDetailElement"){ if(value == "showDetailElement"){
//点击了 小分类 检查如果大分类未选择则进行提示 //点击了 小分类 检查如果大分类未选择则进行提示
if(!this.state.currentBigId){ if(!this.state.currentBigId){
......
...@@ -136,14 +136,12 @@ export default class OtherQuestionContainer extends React.Component{ ...@@ -136,14 +136,12 @@ export default class OtherQuestionContainer extends React.Component{
render(){ render(){
//let 难道初始化的数据: //let 难道初始化的数据:
let {state,addNewProblem} = this.props; let {state,addNewProblem} = this.props;
console.log(state)
let {otherQuestion} = state; let {otherQuestion} = state;
let {feeds,problems} = otherQuestion; let {feeds,problems} = otherQuestion;
let editProblemItemUI = ''; let editProblemItemUI = '';
let swiperCount = 0; let swiperCount = 0;
feeds && feeds.length>0 ?( feeds && feeds.length>0 ?(
editProblemItemUI = feeds.map((i,k)=>{ editProblemItemUI = feeds.map((i,k)=>{
console.log(this.state);
let troubleId = i.id; let troubleId = i.id;
let currentRemark = this.state.problemList[troubleId].remarkText; let currentRemark = this.state.problemList[troubleId].remarkText;
return <EditProblemItem return <EditProblemItem
......
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