- 前端:支付单列表
- 前端:退款单列表
This commit is contained in:
@@ -60,4 +60,9 @@ export default {
|
||||
'menu.promotion.coupon-card-template-list': '优惠劵管理',
|
||||
'menu.promotion.time-limit-discount-list': '限时折扣',
|
||||
'menu.promotion.full-privilege-list': '满减送',
|
||||
// 会员相关
|
||||
'menu.user.user-list': '会员资料',
|
||||
// 支付相关
|
||||
'menu.pay.pay-transaction-list': '支付单',
|
||||
'menu.pay.pay-refund-list': '退款单',
|
||||
};
|
||||
|
||||
97
admin-web/src/models/pay/payRefundList.js
Normal file
97
admin-web/src/models/pay/payRefundList.js
Normal file
@@ -0,0 +1,97 @@
|
||||
import { message } from 'antd';
|
||||
import { productSpuPage, productSpuUpdateSort } from '../../services/product';
|
||||
import {routerRedux} from "dva/router";
|
||||
import PaginationHelper from '../../../helpers/PaginationHelper';
|
||||
import {getPromotionActivityPage} from "../../services/promotion";
|
||||
import {queryPayRefundPage, queryPayTransactionPage} from "../../services/pay";
|
||||
|
||||
const SEARCH_PARAMS_DEFAULT = {
|
||||
createBeginTime: undefined,
|
||||
createEndTime: undefined,
|
||||
finishBeginTime: undefined,
|
||||
finishEndTime: undefined,
|
||||
status: undefined,
|
||||
payChannel: undefined,
|
||||
};
|
||||
|
||||
export default {
|
||||
namespace: 'payRefundList',
|
||||
|
||||
state: {
|
||||
// 分页列表相关
|
||||
list: [],
|
||||
listLoading: false,
|
||||
pagination: PaginationHelper.defaultPaginationConfig,
|
||||
searchParams: SEARCH_PARAMS_DEFAULT,
|
||||
|
||||
// 添加 or 修改表单相关
|
||||
},
|
||||
|
||||
effects: {
|
||||
*page({ payload }, { call, put }) {
|
||||
// const { queryParams } = payload;
|
||||
// const response = yield call(productSpuPage, payload);
|
||||
// message.info('查询成功!');
|
||||
// yield put({
|
||||
// type: 'treeSuccess',
|
||||
// payload: {
|
||||
// list: response.data,
|
||||
// },
|
||||
// });
|
||||
|
||||
// 显示加载中
|
||||
yield put({
|
||||
type: 'changeListLoading',
|
||||
payload: true,
|
||||
});
|
||||
|
||||
// 请求
|
||||
const response = yield call(queryPayRefundPage, payload);
|
||||
// 响应
|
||||
yield put({
|
||||
type: 'setAll',
|
||||
payload: {
|
||||
list: response.data.list,
|
||||
pagination: PaginationHelper.formatPagination(response.data, payload),
|
||||
searchParams: {
|
||||
createBeginTime: payload.createBeginTime,
|
||||
createEndTime: payload.createEndTime,
|
||||
finishBeginTime: payload.finishBeginTime,
|
||||
finishEndTime: payload.finishEndTime,
|
||||
status: payload.status,
|
||||
payChannel: payload.payChannel,
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// 隐藏加载中
|
||||
yield put({
|
||||
type: 'changeListLoading',
|
||||
payload: false,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
reducers: {
|
||||
treeSuccess(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
...payload,
|
||||
};
|
||||
},
|
||||
// 修改加载中的状态
|
||||
changeListLoading(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
listLoading: payload,
|
||||
};
|
||||
},
|
||||
// 设置所有属性
|
||||
setAll(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
...payload,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
101
admin-web/src/models/pay/payTransactionList.js
Normal file
101
admin-web/src/models/pay/payTransactionList.js
Normal file
@@ -0,0 +1,101 @@
|
||||
import { message } from 'antd';
|
||||
import { productSpuPage, productSpuUpdateSort } from '../../services/product';
|
||||
import {routerRedux} from "dva/router";
|
||||
import PaginationHelper from '../../../helpers/PaginationHelper';
|
||||
import {getPromotionActivityPage} from "../../services/promotion";
|
||||
import {queryPayTransactionPage} from "../../services/pay";
|
||||
|
||||
const SEARCH_PARAMS_DEFAULT = {
|
||||
createBeginTime: undefined,
|
||||
createEndTime: undefined,
|
||||
paymentBeginTime: undefined,
|
||||
paymentEndTime: undefined,
|
||||
status: undefined,
|
||||
hasRefund: undefined,
|
||||
payChannel: undefined,
|
||||
orderSubject: '',
|
||||
};
|
||||
|
||||
export default {
|
||||
namespace: 'payTransactionList',
|
||||
|
||||
state: {
|
||||
// 分页列表相关
|
||||
list: [],
|
||||
listLoading: false,
|
||||
pagination: PaginationHelper.defaultPaginationConfig,
|
||||
searchParams: SEARCH_PARAMS_DEFAULT,
|
||||
|
||||
// 添加 or 修改表单相关
|
||||
},
|
||||
|
||||
effects: {
|
||||
*page({ payload }, { call, put }) {
|
||||
// const { queryParams } = payload;
|
||||
// const response = yield call(productSpuPage, payload);
|
||||
// message.info('查询成功!');
|
||||
// yield put({
|
||||
// type: 'treeSuccess',
|
||||
// payload: {
|
||||
// list: response.data,
|
||||
// },
|
||||
// });
|
||||
|
||||
// 显示加载中
|
||||
yield put({
|
||||
type: 'changeListLoading',
|
||||
payload: true,
|
||||
});
|
||||
|
||||
// 请求
|
||||
const response = yield call(queryPayTransactionPage, payload);
|
||||
// 响应
|
||||
yield put({
|
||||
type: 'setAll',
|
||||
payload: {
|
||||
list: response.data.list,
|
||||
pagination: PaginationHelper.formatPagination(response.data, payload),
|
||||
searchParams: {
|
||||
createBeginTime: payload.createBeginTime,
|
||||
createEndTime: payload.createEndTime,
|
||||
paymentBeginTime: payload.paymentBeginTime,
|
||||
paymentEndTime: payload.paymentEndTime,
|
||||
status: payload.status,
|
||||
hasRefund: payload.hasRefund,
|
||||
payChannel: payload.payChannel,
|
||||
orderSubject: payload.orderSubject,
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// 隐藏加载中
|
||||
yield put({
|
||||
type: 'changeListLoading',
|
||||
payload: false,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
reducers: {
|
||||
treeSuccess(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
...payload,
|
||||
};
|
||||
},
|
||||
// 修改加载中的状态
|
||||
changeListLoading(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
listLoading: payload,
|
||||
};
|
||||
},
|
||||
// 设置所有属性
|
||||
setAll(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
...payload,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -5,9 +5,14 @@ import PaginationHelper from '../../../helpers/PaginationHelper';
|
||||
import {getPromotionActivityPage} from "../../services/promotion";
|
||||
|
||||
const SEARCH_PARAMS_DEFAULT = {
|
||||
title: '',
|
||||
activityType: 2,
|
||||
status: 'ALL',
|
||||
createBeginTime: undefined,
|
||||
createEndTime: undefined,
|
||||
paymentBeginTime: undefined,
|
||||
paymentEndTime: undefined,
|
||||
status: undefined,
|
||||
hasRefund: undefined,
|
||||
payChannel: undefined,
|
||||
orderSubject: '',
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -63,36 +68,6 @@ export default {
|
||||
payload: false,
|
||||
});
|
||||
},
|
||||
*updateSort({ payload }, { call, put }) {
|
||||
// 显示加载中
|
||||
yield put({
|
||||
type: 'changeSortModalLoading',
|
||||
payload: true,
|
||||
});
|
||||
|
||||
// 请求
|
||||
const { callback, body } = payload;
|
||||
// 响应
|
||||
const response = yield call(productSpuUpdateSort, body);
|
||||
if(response.code === 0) {
|
||||
if (callback) {
|
||||
callback(response);
|
||||
}
|
||||
yield put({
|
||||
type: 'page',
|
||||
payload: {
|
||||
...this.state.pagination,
|
||||
...this.state.searchParams,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 隐藏加载中
|
||||
yield put({
|
||||
type: 'changeSortModalLoading',
|
||||
payload: false,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
reducers: {
|
||||
@@ -103,12 +78,6 @@ export default {
|
||||
};
|
||||
},
|
||||
// 修改加载中的状态
|
||||
changeSortModalLoading(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
sortModalLoading: payload,
|
||||
};
|
||||
},
|
||||
changeListLoading(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -63,36 +63,6 @@ export default {
|
||||
payload: false,
|
||||
});
|
||||
},
|
||||
*updateSort({ payload }, { call, put }) {
|
||||
// 显示加载中
|
||||
yield put({
|
||||
type: 'changeSortModalLoading',
|
||||
payload: true,
|
||||
});
|
||||
|
||||
// 请求
|
||||
const { callback, body } = payload;
|
||||
// 响应
|
||||
const response = yield call(productSpuUpdateSort, body);
|
||||
if(response.code === 0) {
|
||||
if (callback) {
|
||||
callback(response);
|
||||
}
|
||||
yield put({
|
||||
type: 'page',
|
||||
payload: {
|
||||
...this.state.pagination,
|
||||
...this.state.searchParams,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 隐藏加载中
|
||||
yield put({
|
||||
type: 'changeSortModalLoading',
|
||||
payload: false,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
reducers: {
|
||||
@@ -103,12 +73,6 @@ export default {
|
||||
};
|
||||
},
|
||||
// 修改加载中的状态
|
||||
changeSortModalLoading(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
sortModalLoading: payload,
|
||||
};
|
||||
},
|
||||
changeListLoading(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
|
||||
89
admin-web/src/models/user/userList.js
Normal file
89
admin-web/src/models/user/userList.js
Normal file
@@ -0,0 +1,89 @@
|
||||
import { message } from 'antd';
|
||||
import { productSpuPage, productSpuUpdateSort } from '../../services/product';
|
||||
import {routerRedux} from "dva/router";
|
||||
import PaginationHelper from '../../../helpers/PaginationHelper';
|
||||
import {getPromotionActivityPage} from "../../services/promotion";
|
||||
import {queryUserPage} from "../../services/user";
|
||||
|
||||
const SEARCH_PARAMS_DEFAULT = {
|
||||
nickname: '',
|
||||
status: 1,
|
||||
};
|
||||
|
||||
export default {
|
||||
namespace: 'userList',
|
||||
|
||||
state: {
|
||||
// 分页列表相关
|
||||
list: [],
|
||||
listLoading: false,
|
||||
pagination: PaginationHelper.defaultPaginationConfig,
|
||||
searchParams: SEARCH_PARAMS_DEFAULT,
|
||||
|
||||
// 添加 or 修改表单相关
|
||||
},
|
||||
|
||||
effects: {
|
||||
*page({ payload }, { call, put }) {
|
||||
// const { queryParams } = payload;
|
||||
// const response = yield call(productSpuPage, payload);
|
||||
// message.info('查询成功!');
|
||||
// yield put({
|
||||
// type: 'treeSuccess',
|
||||
// payload: {
|
||||
// list: response.data,
|
||||
// },
|
||||
// });
|
||||
|
||||
// 显示加载中
|
||||
yield put({
|
||||
type: 'changeListLoading',
|
||||
payload: true,
|
||||
});
|
||||
|
||||
// 请求
|
||||
const response = yield call(queryUserPage, payload);
|
||||
// 响应
|
||||
yield put({
|
||||
type: 'setAll',
|
||||
payload: {
|
||||
list: response.data.list,
|
||||
pagination: PaginationHelper.formatPagination(response.data, payload),
|
||||
searchParams: {
|
||||
nickname: payload.nickname,
|
||||
status: payload.status,
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// 隐藏加载中
|
||||
yield put({
|
||||
type: 'changeListLoading',
|
||||
payload: false,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
reducers: {
|
||||
treeSuccess(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
...payload,
|
||||
};
|
||||
},
|
||||
// 修改加载中的状态
|
||||
changeListLoading(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
listLoading: payload,
|
||||
};
|
||||
},
|
||||
// 设置所有属性
|
||||
setAll(state, { payload }) {
|
||||
return {
|
||||
...state,
|
||||
...payload,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
319
admin-web/src/pages/Pay/PayRefundList.js
Normal file
319
admin-web/src/pages/Pay/PayRefundList.js
Normal file
@@ -0,0 +1,319 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import { connect } from 'dva';
|
||||
import moment from 'moment';
|
||||
import {
|
||||
Card,
|
||||
Form,
|
||||
Input,
|
||||
Row,
|
||||
Col,
|
||||
Button,
|
||||
Modal,
|
||||
message,
|
||||
Table,
|
||||
Divider,
|
||||
Tree,
|
||||
Tabs,
|
||||
TreeSelect,
|
||||
Spin,
|
||||
InputNumber, DatePicker, Select
|
||||
} from 'antd';
|
||||
const TabPane = Tabs.TabPane;
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
import styles from './PayRefundList.less';
|
||||
import PaginationHelper from "../../../helpers/PaginationHelper";
|
||||
|
||||
const FormItem = Form.Item;
|
||||
|
||||
const statuses = {
|
||||
1: '处理中',
|
||||
2: '成功',
|
||||
3: '失败',
|
||||
};
|
||||
|
||||
const payChannels = {
|
||||
100: '微信 App 支付',
|
||||
101: '微信 JS API 支付',
|
||||
200: '支付宝 App 支付',
|
||||
9999: 'ping++',
|
||||
};
|
||||
|
||||
// 列表
|
||||
function List({ dataSource, loading, pagination, searchParams, dispatch,}) {
|
||||
|
||||
function onPageChange(page) { // 翻页
|
||||
dispatch({
|
||||
type: 'payRefundList/page',
|
||||
payload: {
|
||||
pageNo: page.current,
|
||||
pageSize: page.pageSize,
|
||||
...searchParams
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const columns = [
|
||||
// {
|
||||
// title: 'id',
|
||||
// dataIndex: 'id',
|
||||
// render: text => <strong>{text}</strong>,
|
||||
// },
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
render: val => <span>{moment(val).format('YYYY-MM-DD HH:mm:ss')}</span>,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '完成时间',
|
||||
dataIndex: 'finishTime',
|
||||
render: val => val ? <span>{moment(val).format('YYYY-MM-DD HH:mm:ss')}</span> : '',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '渠道流水号',
|
||||
dataIndex: 'tradeNo',
|
||||
},
|
||||
{
|
||||
title: '退款金额',
|
||||
dataIndex: 'price',
|
||||
render: val => val / 100.0,
|
||||
},
|
||||
{
|
||||
title: '退款状态',
|
||||
dataIndex: 'status',
|
||||
render: val => statuses[val + ''],
|
||||
},
|
||||
{
|
||||
title: '支付时间',
|
||||
dataIndex: 'transaction.finishTime',
|
||||
render: val => val ? <span>{moment(val).format('YYYY-MM-DD HH:mm:ss')}</span> : '',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '商户订单号',
|
||||
dataIndex: 'orderId',
|
||||
},
|
||||
{
|
||||
title: '商品名称',
|
||||
dataIndex: 'transaction.orderSubject',
|
||||
},
|
||||
{
|
||||
title: '支付金额',
|
||||
dataIndex: 'transaction.price',
|
||||
},
|
||||
{
|
||||
title: '支付渠道',
|
||||
dataIndex: 'transaction.payChannel',
|
||||
render: val => payChannels[val + ''],
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 120,
|
||||
render: (text, record) => (
|
||||
<Fragment>
|
||||
{/*<a onClick={() => this.handleModalVisible(true, 'update', record)}>更新</a>*/}
|
||||
<a onClick={() => alert('正在开发中')}>详情</a>
|
||||
</Fragment>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
// console.log(pagination);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
rowKey="id"
|
||||
pagination={pagination}
|
||||
onChange={onPageChange}
|
||||
loading={loading} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// 搜索表单
|
||||
const SearchForm = Form.create()(props => {
|
||||
const {
|
||||
form,
|
||||
form: { getFieldDecorator },
|
||||
dispatch,
|
||||
searchParams,
|
||||
} = props;
|
||||
|
||||
function search() {
|
||||
const getBeginAndEndTime = (key, beginKey, endKey) => {
|
||||
let val = form.getFieldsValue()[key];
|
||||
if (val && val.length === 2) {
|
||||
let res = {};
|
||||
res[beginKey] = val[0].format('YYYY-MM-DD HH:mm:ss');
|
||||
res[endKey] = val[1].format('YYYY-MM-DD HH:mm:ss');
|
||||
return res;
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
dispatch({
|
||||
type: 'payRefundList/page',
|
||||
payload: {
|
||||
...PaginationHelper.defaultPayload,
|
||||
...searchParams,
|
||||
...form.getFieldsValue(),
|
||||
createTime: undefined,
|
||||
finishTime: undefined,
|
||||
...getBeginAndEndTime('createTime', 'createBeginTime', 'createEndTime'),
|
||||
...getBeginAndEndTime('finishTime', 'finishBeginTime', 'finishEndTime'),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 提交搜索
|
||||
function handleSubmit(e) {
|
||||
// 阻止默认事件
|
||||
e.preventDefault();
|
||||
// 提交搜索
|
||||
search();
|
||||
}
|
||||
|
||||
// 重置搜索
|
||||
function handleReset() {
|
||||
// 重置表单
|
||||
form.resetFields();
|
||||
// 执行搜索
|
||||
search();
|
||||
}
|
||||
|
||||
return (
|
||||
<Form onSubmit={handleSubmit} layout="inline">
|
||||
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="创建时间">{getFieldDecorator('createTime')(<RangePicker style={{ width: '250px' }} />)}</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="完成时间">{getFieldDecorator('finishTime')(<RangePicker style={{ width: '250px' }} />)}</FormItem>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="支付渠道">
|
||||
{getFieldDecorator('payChannel')(
|
||||
<Select placeholder="请选择" style={{ width: '250px' }}>
|
||||
{Object.keys(payChannels).map((key, index) => <Option key={key} value={key + ''}>{payChannels[key]}</Option>)}
|
||||
</Select>
|
||||
)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="退款状态">
|
||||
{getFieldDecorator('status')(
|
||||
<Select placeholder="请选择" style={{ width: '250px' }}>
|
||||
{Object.keys(statuses).map((key, index) => <Option key={key} value={key + ''}>{statuses[key]}</Option>)}
|
||||
</Select>
|
||||
)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<span className={styles.submitButtons}>
|
||||
<Button type="primary" htmlType="submit">
|
||||
查询
|
||||
</Button>
|
||||
<Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
||||
重置
|
||||
</Button>
|
||||
</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
);
|
||||
});
|
||||
|
||||
// payRefundList
|
||||
@connect(({ payRefundList }) => ({
|
||||
...payRefundList,
|
||||
// list: payRefundList.list.spus,
|
||||
// loading: loading.models.payRefundList,
|
||||
}))
|
||||
|
||||
@Form.create()
|
||||
class PayTransactionList extends PureComponent {
|
||||
state = {
|
||||
modalVisible: false,
|
||||
modalType: 'add', //add update
|
||||
initValues: {},
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const { dispatch, searchParams } = this.props;
|
||||
// 查询初始数据
|
||||
dispatch({
|
||||
type: 'payRefundList/page',
|
||||
payload: {
|
||||
...searchParams,
|
||||
...PaginationHelper.defaultPayload,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
handleSortModalVisible = (sortModalVisible, record) => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch({
|
||||
type: 'payRefundList/setAll',
|
||||
payload: {
|
||||
sortModalVisible,
|
||||
formVals: record || {}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dispatch,
|
||||
list, listLoading, searchParams, pagination,
|
||||
categoryTree, formVals, } = this.props;
|
||||
|
||||
// 列表属性
|
||||
const listProps = {
|
||||
dataSource: list,
|
||||
pagination,
|
||||
searchParams,
|
||||
dispatch,
|
||||
categoryTree,
|
||||
loading: listLoading,
|
||||
handleSortModalVisible: this.handleSortModalVisible, // Func
|
||||
};
|
||||
|
||||
// 搜索表单属性
|
||||
const searchFormProps = {
|
||||
dispatch,
|
||||
categoryTree,
|
||||
searchParams,
|
||||
};
|
||||
|
||||
return (
|
||||
<PageHeaderWrapper title="">
|
||||
<Card bordered={false}>
|
||||
<div className={styles.tableList}>
|
||||
<div className={styles.tableListOperator}>
|
||||
{/*<Button*/}
|
||||
{/* icon="plus"*/}
|
||||
{/* type="primary"*/}
|
||||
{/* onClick={() => alert('正在开发中')}*/}
|
||||
{/*>*/}
|
||||
{/* 新建限时折扣*/}
|
||||
{/*</Button>*/}
|
||||
</div>
|
||||
</div>
|
||||
<SearchForm {...searchFormProps} />
|
||||
<List {...listProps} />
|
||||
</Card>
|
||||
</PageHeaderWrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PayTransactionList;
|
||||
15
admin-web/src/pages/Pay/PayRefundList.less
Normal file
15
admin-web/src/pages/Pay/PayRefundList.less
Normal file
@@ -0,0 +1,15 @@
|
||||
@import '~antd/lib/style/themes/default.less';
|
||||
@import '~@/utils/utils.less';
|
||||
|
||||
.tableList {
|
||||
.tableListOperator {
|
||||
margin-bottom: 16px;
|
||||
button {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tableDelete {
|
||||
color: red;
|
||||
}
|
||||
328
admin-web/src/pages/Pay/PayTransactionList.js
Normal file
328
admin-web/src/pages/Pay/PayTransactionList.js
Normal file
@@ -0,0 +1,328 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import { connect } from 'dva';
|
||||
import moment from 'moment';
|
||||
import {
|
||||
Card,
|
||||
Form,
|
||||
Input,
|
||||
Row,
|
||||
Col,
|
||||
Button,
|
||||
Modal,
|
||||
message,
|
||||
Table,
|
||||
Divider,
|
||||
Tree,
|
||||
Tabs,
|
||||
TreeSelect,
|
||||
Spin,
|
||||
InputNumber, DatePicker, Select
|
||||
} from 'antd';
|
||||
const TabPane = Tabs.TabPane;
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
import styles from './PayTransactionList.less';
|
||||
import PaginationHelper from "../../../helpers/PaginationHelper";
|
||||
|
||||
const FormItem = Form.Item;
|
||||
|
||||
const statuses = {
|
||||
1: '等待支付',
|
||||
2: '支付成功',
|
||||
3: '取消支付',
|
||||
};
|
||||
|
||||
const payChannels = {
|
||||
100: '微信 App 支付',
|
||||
101: '微信 JS API 支付',
|
||||
200: '支付宝 App 支付',
|
||||
9999: 'ping++',
|
||||
};
|
||||
|
||||
// 列表
|
||||
function List({ dataSource, loading, pagination, searchParams, dispatch,}) {
|
||||
|
||||
function onPageChange(page) { // 翻页
|
||||
dispatch({
|
||||
type: 'payTransactionList/page',
|
||||
payload: {
|
||||
pageNo: page.current,
|
||||
pageSize: page.pageSize,
|
||||
...searchParams
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const columns = [
|
||||
// {
|
||||
// title: 'id',
|
||||
// dataIndex: 'id',
|
||||
// render: text => <strong>{text}</strong>,
|
||||
// },
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
render: val => <span>{moment(val).format('YYYY-MM-DD HH:mm:ss')}</span>,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '支付时间',
|
||||
dataIndex: 'paymentTime',
|
||||
render: val => val ? <span>{moment(val).format('YYYY-MM-DD HH:mm:ss')}</span> : '',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '商户订单号',
|
||||
dataIndex: 'orderId',
|
||||
},
|
||||
{
|
||||
title: '商品名称',
|
||||
dataIndex: 'orderSubject',
|
||||
},
|
||||
{
|
||||
title: '支付金额',
|
||||
dataIndex: 'price',
|
||||
render: val => val / 100.0,
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
dataIndex: 'status',
|
||||
render: val => statuses[val + ''],
|
||||
},
|
||||
{
|
||||
title: '支付渠道',
|
||||
dataIndex: 'payChannel',
|
||||
render: val => payChannels[val + ''],
|
||||
},
|
||||
{
|
||||
title: '退款情况',
|
||||
dataIndex: 'refundTotal',
|
||||
render: val => val && val > 0 ? '有退款' : '无退款' ,
|
||||
},
|
||||
{
|
||||
title: '退款金额',
|
||||
dataIndex: 'refundTotal',
|
||||
render: val => val && val > 0 ? val / 100.0 : undefined ,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 120,
|
||||
render: (text, record) => (
|
||||
<Fragment>
|
||||
{/*<a onClick={() => this.handleModalVisible(true, 'update', record)}>更新</a>*/}
|
||||
<a onClick={() => alert('正在开发中')}>退款</a>
|
||||
</Fragment>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
// console.log(pagination);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
rowKey="id"
|
||||
pagination={pagination}
|
||||
onChange={onPageChange}
|
||||
loading={loading} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// 搜索表单
|
||||
const SearchForm = Form.create()(props => {
|
||||
const {
|
||||
form,
|
||||
form: { getFieldDecorator },
|
||||
dispatch,
|
||||
searchParams,
|
||||
} = props;
|
||||
|
||||
function search() {
|
||||
const getBeginAndEndTime = (key, beginKey, endKey) => {
|
||||
let val = form.getFieldsValue()[key];
|
||||
if (val && val.length === 2) {
|
||||
let res = {};
|
||||
res[beginKey] = val[0].format('YYYY-MM-DD HH:mm:ss');
|
||||
res[endKey] = val[1].format('YYYY-MM-DD HH:mm:ss');
|
||||
return res;
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
dispatch({
|
||||
type: 'payTransactionList/page',
|
||||
payload: {
|
||||
...PaginationHelper.defaultPayload,
|
||||
...searchParams,
|
||||
...form.getFieldsValue(),
|
||||
createTime: undefined,
|
||||
paymentTime: undefined,
|
||||
...getBeginAndEndTime('createTime', 'createBeginTime', 'createEndTime'),
|
||||
...getBeginAndEndTime('paymentTime', 'paymentBeginTime', 'paymentEndTime'),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 提交搜索
|
||||
function handleSubmit(e) {
|
||||
// 阻止默认事件
|
||||
e.preventDefault();
|
||||
// 提交搜索
|
||||
search();
|
||||
}
|
||||
|
||||
// 重置搜索
|
||||
function handleReset() {
|
||||
// 重置表单
|
||||
form.resetFields();
|
||||
// 执行搜索
|
||||
search();
|
||||
}
|
||||
|
||||
return (
|
||||
<Form onSubmit={handleSubmit} layout="inline">
|
||||
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="创建时间">{getFieldDecorator('createTime')(<RangePicker style={{ width: '250px' }} />)}</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="支付时间">{getFieldDecorator('paymentTime')(<RangePicker style={{ width: '250px' }} />)}</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="商品名称">{getFieldDecorator('orderSubject')(<Input placeholder="请输入" style={{ width: '250px' }} />)}</FormItem>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="支付渠道">
|
||||
{getFieldDecorator('payChannel')(
|
||||
<Select placeholder="请选择" style={{ width: '250px' }}>
|
||||
{Object.keys(payChannels).map((key, index) => <Option key={key} value={key + ''}>{payChannels[key]}</Option>)}
|
||||
</Select>
|
||||
)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="支付状态">
|
||||
{getFieldDecorator('status')(
|
||||
<Select placeholder="请选择" style={{ width: '250px' }}>
|
||||
{Object.keys(statuses).map((key, index) => <Option key={key} value={key + ''}>{statuses[key]}</Option>)}
|
||||
</Select>
|
||||
)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="退款状态">
|
||||
{getFieldDecorator('hasRefund')(
|
||||
<Select placeholder="请选择" style={{ width: '250px' }}>
|
||||
<Option value={true}>有退款</Option>
|
||||
<Option value={false}>无退款</Option>
|
||||
</Select>
|
||||
)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<span className={styles.submitButtons}>
|
||||
<Button type="primary" htmlType="submit">
|
||||
查询
|
||||
</Button>
|
||||
<Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
||||
重置
|
||||
</Button>
|
||||
</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
);
|
||||
});
|
||||
|
||||
// payTransactionList
|
||||
@connect(({ payTransactionList }) => ({
|
||||
...payTransactionList,
|
||||
// list: payTransactionList.list.spus,
|
||||
// loading: loading.models.payTransactionList,
|
||||
}))
|
||||
|
||||
@Form.create()
|
||||
class PayTransactionList extends PureComponent {
|
||||
state = {
|
||||
modalVisible: false,
|
||||
modalType: 'add', //add update
|
||||
initValues: {},
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const { dispatch, searchParams } = this.props;
|
||||
// 查询初始数据
|
||||
dispatch({
|
||||
type: 'payTransactionList/page',
|
||||
payload: {
|
||||
...searchParams,
|
||||
...PaginationHelper.defaultPayload,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
handleSortModalVisible = (sortModalVisible, record) => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch({
|
||||
type: 'payTransactionList/setAll',
|
||||
payload: {
|
||||
sortModalVisible,
|
||||
formVals: record || {}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dispatch,
|
||||
list, listLoading, searchParams, pagination,
|
||||
categoryTree, formVals, } = this.props;
|
||||
|
||||
// 列表属性
|
||||
const listProps = {
|
||||
dataSource: list,
|
||||
pagination,
|
||||
searchParams,
|
||||
dispatch,
|
||||
categoryTree,
|
||||
loading: listLoading,
|
||||
handleSortModalVisible: this.handleSortModalVisible, // Func
|
||||
};
|
||||
|
||||
// 搜索表单属性
|
||||
const searchFormProps = {
|
||||
dispatch,
|
||||
categoryTree,
|
||||
searchParams,
|
||||
};
|
||||
|
||||
return (
|
||||
<PageHeaderWrapper title="">
|
||||
<Card bordered={false}>
|
||||
<div className={styles.tableList}>
|
||||
<div className={styles.tableListOperator}>
|
||||
{/*<Button*/}
|
||||
{/* icon="plus"*/}
|
||||
{/* type="primary"*/}
|
||||
{/* onClick={() => alert('正在开发中')}*/}
|
||||
{/*>*/}
|
||||
{/* 新建限时折扣*/}
|
||||
{/*</Button>*/}
|
||||
</div>
|
||||
</div>
|
||||
<SearchForm {...searchFormProps} />
|
||||
<List {...listProps} />
|
||||
</Card>
|
||||
</PageHeaderWrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PayTransactionList;
|
||||
15
admin-web/src/pages/Pay/PayTransactionList.less
Normal file
15
admin-web/src/pages/Pay/PayTransactionList.less
Normal file
@@ -0,0 +1,15 @@
|
||||
@import '~antd/lib/style/themes/default.less';
|
||||
@import '~@/utils/utils.less';
|
||||
|
||||
.tableList {
|
||||
.tableListOperator {
|
||||
margin-bottom: 16px;
|
||||
button {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tableDelete {
|
||||
color: red;
|
||||
}
|
||||
266
admin-web/src/pages/User/UserList.js
Normal file
266
admin-web/src/pages/User/UserList.js
Normal file
@@ -0,0 +1,266 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import { connect } from 'dva';
|
||||
import moment from 'moment';
|
||||
import {
|
||||
Card,
|
||||
Form,
|
||||
Input,
|
||||
Row,
|
||||
Col,
|
||||
Button,
|
||||
Modal,
|
||||
message,
|
||||
Table,
|
||||
Divider,
|
||||
Tree,
|
||||
Tabs,
|
||||
TreeSelect,
|
||||
Spin,
|
||||
InputNumber, Select
|
||||
} from 'antd';
|
||||
const TabPane = Tabs.TabPane;
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import styles from './UserList.less';
|
||||
import PaginationHelper from "../../../helpers/PaginationHelper";
|
||||
|
||||
const FormItem = Form.Item;
|
||||
|
||||
const statuses = {
|
||||
1: '开启',
|
||||
2: '关闭',
|
||||
};
|
||||
|
||||
// 列表
|
||||
function List({ dataSource, loading, pagination, searchParams, dispatch,}) {
|
||||
|
||||
function onPageChange(page) { // 翻页
|
||||
dispatch({
|
||||
type: 'userList/page',
|
||||
payload: {
|
||||
pageNo: page.current,
|
||||
pageSize: page.pageSize,
|
||||
...searchParams
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const columns = [
|
||||
// {
|
||||
// title: 'id',
|
||||
// dataIndex: 'id',
|
||||
// render: text => <strong>{text}</strong>,
|
||||
// },
|
||||
{
|
||||
title: '昵称',
|
||||
dataIndex: 'nickname',
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'mobile',
|
||||
},
|
||||
{
|
||||
title: '会员卡', // TODO 芋艿,未来增加
|
||||
},
|
||||
{
|
||||
title: '累积交易次数', // TODO 芋艿,未来增加
|
||||
},
|
||||
{
|
||||
title: '累计交易额', // TODO 芋艿,未来增加
|
||||
},
|
||||
{
|
||||
title: '积分', // TODO 芋艿,未来增加
|
||||
},
|
||||
{
|
||||
title: '会员标签', // TODO 芋艿,未来增加
|
||||
},
|
||||
{
|
||||
title: '备注', // TODO 芋艿,未来增加
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
render: val => statuses[val + ''],
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 300,
|
||||
render: (text, record) => (
|
||||
<Fragment>
|
||||
{/*<a onClick={() => this.handleModalVisible(true, 'update', record)}>更新</a>*/}
|
||||
<a onClick={() => alert('正在开发中')}>编辑</a>
|
||||
</Fragment>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
// console.log(pagination);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
rowKey="id"
|
||||
pagination={pagination}
|
||||
onChange={onPageChange}
|
||||
loading={loading} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// 搜索表单
|
||||
const SearchForm = Form.create()(props => {
|
||||
const {
|
||||
form,
|
||||
form: { getFieldDecorator },
|
||||
dispatch,
|
||||
searchParams,
|
||||
} = props;
|
||||
|
||||
function search() {
|
||||
dispatch({
|
||||
type: 'userList/page',
|
||||
payload: {
|
||||
...PaginationHelper.defaultPayload,
|
||||
...searchParams,
|
||||
...form.getFieldsValue(),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 提交搜索
|
||||
function handleSubmit(e) {
|
||||
// 阻止默认事件
|
||||
e.preventDefault();
|
||||
// 提交搜索
|
||||
search();
|
||||
}
|
||||
|
||||
// 重置搜索
|
||||
function handleReset() {
|
||||
// 重置表单
|
||||
form.resetFields();
|
||||
// 执行搜索
|
||||
search();
|
||||
}
|
||||
|
||||
return (
|
||||
<Form onSubmit={handleSubmit} layout="inline">
|
||||
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="会员昵称">
|
||||
{getFieldDecorator('nickname')(<Input placeholder="请输入" />)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="会员状态">
|
||||
{getFieldDecorator('status')(
|
||||
<Select placeholder="请选择" style={{ width: '200px' }}>
|
||||
<Option value="1">开启</Option>
|
||||
<Option value="2">关闭</Option>
|
||||
</Select>
|
||||
)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<span className={styles.submitButtons}>
|
||||
<Button type="primary" htmlType="submit">
|
||||
查询
|
||||
</Button>
|
||||
<Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
||||
重置
|
||||
</Button>
|
||||
</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
);
|
||||
});
|
||||
|
||||
// userList
|
||||
@connect(({ userList }) => ({
|
||||
...userList,
|
||||
// list: userList.list.spus,
|
||||
// loading: loading.models.userList,
|
||||
}))
|
||||
|
||||
@Form.create()
|
||||
class UserList extends PureComponent {
|
||||
state = {
|
||||
modalVisible: false,
|
||||
modalType: 'add', //add update
|
||||
initValues: {},
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const { dispatch, searchParams } = this.props;
|
||||
// 查询初始数据
|
||||
dispatch({
|
||||
type: 'userList/page',
|
||||
payload: {
|
||||
...searchParams,
|
||||
...PaginationHelper.defaultPayload,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
handleSortModalVisible = (sortModalVisible, record) => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch({
|
||||
type: 'userList/setAll',
|
||||
payload: {
|
||||
sortModalVisible,
|
||||
formVals: record || {}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dispatch,
|
||||
list, listLoading, searchParams, pagination,
|
||||
categoryTree, formVals, } = this.props;
|
||||
|
||||
// 列表属性
|
||||
const listProps = {
|
||||
dataSource: list,
|
||||
pagination,
|
||||
searchParams,
|
||||
dispatch,
|
||||
categoryTree,
|
||||
loading: listLoading,
|
||||
handleSortModalVisible: this.handleSortModalVisible, // Func
|
||||
};
|
||||
|
||||
// 搜索表单属性
|
||||
const searchFormProps = {
|
||||
dispatch,
|
||||
categoryTree,
|
||||
searchParams,
|
||||
};
|
||||
|
||||
return (
|
||||
<PageHeaderWrapper title="">
|
||||
<Card bordered={false}>
|
||||
<div className={styles.tableList}>
|
||||
<div className={styles.tableListOperator}>
|
||||
{/*<Button*/}
|
||||
{/* icon="plus"*/}
|
||||
{/* type="primary"*/}
|
||||
{/* onClick={() => alert('正在开发中')}*/}
|
||||
{/*>*/}
|
||||
{/* 新建会员*/}
|
||||
{/*</Button>*/}
|
||||
</div>
|
||||
</div>
|
||||
<SearchForm {...searchFormProps} />
|
||||
<List {...listProps} />
|
||||
</Card>
|
||||
</PageHeaderWrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default UserList;
|
||||
15
admin-web/src/pages/User/UserList.less
Normal file
15
admin-web/src/pages/User/UserList.less
Normal file
@@ -0,0 +1,15 @@
|
||||
@import '~antd/lib/style/themes/default.less';
|
||||
@import '~@/utils/utils.less';
|
||||
|
||||
.tableList {
|
||||
.tableListOperator {
|
||||
margin-bottom: 16px;
|
||||
button {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tableDelete {
|
||||
color: red;
|
||||
}
|
||||
18
admin-web/src/services/pay.js
Normal file
18
admin-web/src/services/pay.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { stringify } from '@/utils/request.qs';
|
||||
import request from '@/utils/request';
|
||||
|
||||
// Transaction
|
||||
|
||||
export async function queryPayTransactionPage(params) {
|
||||
return request(`/pay-api/admins/transaction/page?${stringify(params)}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// Refund
|
||||
|
||||
export async function queryPayRefundPage(params) {
|
||||
return request(`/pay-api/admins/refund/page?${stringify(params)}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { stringify } from '@/utils/request.qs';
|
||||
import request from '@/utils/request';
|
||||
|
||||
export async function query() {
|
||||
@@ -7,3 +8,11 @@ export async function query() {
|
||||
export async function queryCurrent() {
|
||||
return request('/api/currentUser');
|
||||
}
|
||||
|
||||
// User
|
||||
|
||||
export async function queryUserPage(params) {
|
||||
return request(`/user-api/admins/user/page?${stringify(params)}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user