添加 orderList 订单页面

This commit is contained in:
sin
2019-03-28 00:43:50 +08:00
parent c23eb737f0
commit e2a19a1d9d
3 changed files with 192 additions and 138 deletions

View File

@@ -5,17 +5,32 @@ export default {
namespace: 'orderList',
state: {
list: [],
list: {
pagination: {
current: 0,
pageSize: 10,
total: 0,
},
dataSource: [],
},
},
effects: {
*queryPage({ payload }, { call, put }) {
const response = yield call(orderPage, payload);
message.info('查询成功!');
message.info('查询成功!', response);
const { total, orders } = response.data;
yield put({
type: 'queryPageSuccess',
payload: {
list: response.data,
list: {
dataSource: orders,
pagination: {
total,
current: payload.pageNo,
pageSize: payload.pageSize,
},
},
},
});
},
@@ -34,9 +49,10 @@ export default {
reducers: {
queryPageSuccess(state, { payload }) {
const { list } = payload;
return {
...state,
...payload,
list,
};
},
},