Commit d2dc6b14 authored by wangxuelai's avatar wangxuelai

bww

parent cf99d9e8
......@@ -38,6 +38,12 @@ export default {
price: 0,
inventory: 0,
},
type1: {
single: 0,
copySingle: 0,
daily_limit: 0,
checked: true,
},
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -177,6 +183,7 @@ export default {
cover,
status,
banner,
callBack,
} = payload;
console.log(payload, 'payload');
const loadmessage = message.loading('保存中...', 0);
......@@ -210,6 +217,9 @@ export default {
editGoodsModalShow: false,
},
});
if (callBack && (typeof callBack == 'function')) {
callBack();
}
} else {
yield put({
type: 'webapp/errorrequestresolve',
......@@ -341,6 +351,52 @@ export default {
},
});
},
* handleSubmit({ payload }, { call, put, select }) {
const { type1 } = yield select(state => state.integral);
const { sid } = yield select(state => state.webapp);
console.log(type1);
const data = {
1: {
single: type1.single || 0,
day_limit: type1.day_limit || 0,
school_id: sid,
},
// 2: type2,
};
console.log(data, 'data');
},
* valueChange({ payload }, { call, put, select }) {
const state = yield select(state => state.integral);
const { value, index, key } = payload;
// ley typevalue = state[]
// ley typevalue = state[]
// console.log({
// ...state[`type${index}`],
// single: 0,
// }, 'd111');
// if (key == 'checked') {
// if (!value) {
// yield put({
// type: 'updateState',
// payload: {
// [`type${index}`]: {
// ...state[`type${index}`],
// single: 0,
// },
// },
// });
// }
// }
yield put({
type: 'updateState',
payload: {
[`type${index}`]: {
...state[`type${index}`],
[`${key}`]: value,
},
},
});
},
},
reducers: {
save(state, action) {
......
......@@ -36,7 +36,6 @@ class CouponAddModal extends React.Component {
}
form.validateFields((err, values) => {
if (!err) {
console.log(values, 'values');
const {
price,
title,
......@@ -54,6 +53,9 @@ class CouponAddModal extends React.Component {
inventory,
type,
status,
callBack: () => {
form.resetFields();
},
});
}
});
......
......@@ -27,7 +27,6 @@ class GoodsAddModal extends React.Component {
const {
form, save, editCouponInfo, couponImg,
} = this.props;
console.log(couponImg, 'couponImg');
if (editCouponInfo.id == 0 && (couponImg == '' || couponImg == undefined)) {
message.error('请上传卡券封面', 0.5);
return;
......@@ -52,6 +51,9 @@ class GoodsAddModal extends React.Component {
inventory,
type,
status,
callBack: () => {
form.resetFields();
},
});
}
});
......
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