diff --git a/admin-web/src/models/order/orderList.js b/admin-web/src/models/order/orderList.js
index 890c07d53..e337c1493 100644
--- a/admin-web/src/models/order/orderList.js
+++ b/admin-web/src/models/order/orderList.js
@@ -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,
};
},
},
diff --git a/admin-web/src/pages/Order/OrderList.js b/admin-web/src/pages/Order/OrderList.js
index ff9b0abde..eb3b790a2 100644
--- a/admin-web/src/pages/Order/OrderList.js
+++ b/admin-web/src/pages/Order/OrderList.js
@@ -1,128 +1,113 @@
-import React, { PureComponent } from 'react';
+import React, { Fragment, PureComponent } from 'react';
import moment from 'moment';
import { connect } from 'dva';
-import {
- Button,
- Card,
- Col,
- Dropdown,
- Form,
- Icon,
- Input,
- List,
- Menu,
- Modal,
- Row,
- Select,
-} from 'antd';
+import { Button, Card, Col, Divider, Form, Input, Row, Table, DatePicker } from 'antd';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import DictionaryText from '@/components/Dictionary/DictionaryText';
+import DictionarySelect from '@/components/Dictionary/DictionarySelect';
import dictionary from '@/utils/dictionary';
import styles from './OrderList.less';
+const { RangePicker } = DatePicker;
const FormItem = Form.Item;
-const SelectOption = Select.Option;
const OrderList = props => {
- const { list, loading } = props;
+ const { list, dispatch, loading, handleModalVisible } = props;
- const paginationProps = {
- showSizeChanger: true,
- showQuickJumper: true,
- pageSize: 5,
- total: 50,
- };
-
- const deleteItem = id => {
- const { dispatch } = props;
+ // 翻页
+ const onPageChange = page => {
+ const { searchParams } = props;
dispatch({
- type: 'list/submit',
- payload: { id },
+ type: 'adminList/query',
+ payload: {
+ pageNo: page.current,
+ pageSize: page.pageSize,
+ ...searchParams,
+ },
});
};
- const handleEditor = currentItem => {
- const { handleEditorClick } = props;
- if (handleEditorClick) {
- handleEditorClick(currentItem);
- }
+ const columns = [
+ {
+ title: '订单id',
+ dataIndex: 'id',
+ },
+ {
+ title: '用户',
+ dataIndex: 'userId',
+ },
+ {
+ title: '订单号',
+ dataIndex: 'orderNo',
+ },
+ {
+ title: '金额',
+ dataIndex: 'price',
+ render(val) {
+ return {val} 元;
+ },
+ },
+ {
+ title: '状态',
+ dataIndex: 'status',
+ render(val) {
+ return
编号: {data.orderNo}
-创建时间:{moment(data.createTime).format('YYYY-MM-DD HH:mm')}
-