- 添加订单列表

This commit is contained in:
sin
2019-03-24 16:55:52 +08:00
parent bb4d9721ab
commit 93b235fac6
9 changed files with 552 additions and 6 deletions

View File

@@ -0,0 +1,43 @@
import { message } from 'antd';
import { orderPage, updateOrderItem } from '../../services/order';
export default {
namespace: 'orderList',
state: {
list: [],
},
effects: {
*queryPage({ payload }, { call, put }) {
const response = yield call(orderPage, payload);
message.info('查询成功!');
yield put({
type: 'queryPageSuccess',
payload: {
list: response.data,
},
});
},
*updateOrderItem({ payload }, { call, put }) {
const { params } = payload;
const response = yield call(updateOrderItem, params);
message.info('查询成功!');
yield put({
type: 'queryPageSuccess',
payload: {
list: response.data,
},
});
},
},
reducers: {
queryPageSuccess(state, { payload }) {
return {
...state,
...payload,
};
},
},
};