fix: 对接提现申请与用户钱包,支付流水页面,对接角色权限页面
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* 支付流水假数据
|
||||
* 对应接口:GET /admin/finance/paymentFlow/page
|
||||
*/
|
||||
import type { PaymentFlowVO, PaymentFlowQueryParams, PageData } from '@/api/payments';
|
||||
import type { PaymentFlowVO, PaymentFlowQueryParams, PaymentFlowPageData } from '@/api/payments';
|
||||
|
||||
const MOCK_LIST: PaymentFlowVO[] = [
|
||||
{
|
||||
@@ -127,7 +127,7 @@ export function buildMockPaymentFlowPage(
|
||||
page: number,
|
||||
limit: number,
|
||||
params: PaymentFlowQueryParams,
|
||||
): PageData<PaymentFlowVO> {
|
||||
): PaymentFlowPageData {
|
||||
let filtered = [...MOCK_LIST];
|
||||
|
||||
if (params.nickname) {
|
||||
@@ -143,7 +143,22 @@ export function buildMockPaymentFlowPage(
|
||||
inDateRange(item.createDate, params.createDateBegin, params.createDateEnd),
|
||||
);
|
||||
|
||||
let totalAmount = 0;
|
||||
let totalRefundAmount = 0;
|
||||
for (const item of filtered) {
|
||||
const amt = Number(item.amount) || 0;
|
||||
if (item.type === 1) totalAmount += amt;
|
||||
else if (item.type === 2) totalRefundAmount += amt;
|
||||
}
|
||||
|
||||
const total = filtered.length;
|
||||
const start = (page - 1) * limit;
|
||||
return { total, list: filtered.slice(start, start + limit) };
|
||||
return {
|
||||
total,
|
||||
list: filtered.slice(start, start + limit),
|
||||
exData: {
|
||||
totalAmount: totalAmount.toFixed(2),
|
||||
totalRefundAmount: totalRefundAmount.toFixed(2),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user