diff --git a/.claude/settings.local.json b/.claude/settings.local.json
index a4fc851..cc75bd3 100644
--- a/.claude/settings.local.json
+++ b/.claude/settings.local.json
@@ -74,7 +74,18 @@
"Read(//c/Users/admin/AppData/Local/Temp/1/claude/d--project-company-rent/949fb73a-e05f-4a74-a5a8-ad2ee982a5f4/tasks/**)",
"Bash(powershell -Command 'Get-NetTCPConnection -LocalPort 3000 -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | Where-Object { $_ -ne 0 } | ForEach-Object { Stop-Process -Id $_ -Force }')",
"Bash(npx tsc *)",
- "Bash(curl -s http://localhost:3000/api/admin/finance/platform-accounts)"
+ "Bash(curl -s http://localhost:3000/api/admin/finance/platform-accounts)",
+ "Bash(cd /d/project/company/rent && ls -la database/seeds/)",
+ "Read(//d/d/project/company/rent/database/**)",
+ "Bash(mysql -u root -p123456 -D rent_platform -e \"SELECT id, account_name, balance, total_income, total_refund, total_withdrawn FROM system_accounts;\")",
+ "Bash(mysql -h localhost -P 3306 -u root -pquan131735 rent_platform)",
+ "Bash(npx ts-node *)",
+ "Bash(mysql -uroot -proot rent_platform -e \"SELECT id, order_no, status, merchant_id, checkout_at, check_out_date FROM orders WHERE status = 'completed' LIMIT 5;\")",
+ "Bash(taskkill /F /PID 3664)",
+ "Bash(taskkill //F //PID 1716)",
+ "Bash(mysql -u root -p123456 rent_platform -e \"SELECT id, name, type, enabled, config FROM mkt_activities WHERE type='invite_cashback' LIMIT 1\")",
+ "Bash(node check-config.js)",
+ "Bash(node verify-fix.js)"
]
}
}
diff --git a/apps/merchant-admin/src/App.tsx b/apps/merchant-admin/src/App.tsx
index f758942..00cdf3b 100644
--- a/apps/merchant-admin/src/App.tsx
+++ b/apps/merchant-admin/src/App.tsx
@@ -16,6 +16,7 @@ import FinanceSettlementDetail from '@/pages/finance/SettlementDetail';
import FinanceWithdrawals from '@/pages/finance/Withdrawals';
import FinanceWallet from '@/pages/finance/Wallet';
import FinanceTransactions from '@/pages/finance/Transactions';
+import FinancePendingSettlement from '@/pages/finance/PendingSettlement';
import Settings from '@/pages/Settings';
const ProtectedRoute: React.FC<{ children: React.ReactNode }> = ({ children }) => {
@@ -42,7 +43,8 @@ const App: React.FC = () => (
} />
} />
- } />
+ } />
+ } />
} />
} />
} />
diff --git a/apps/merchant-admin/src/api/finance.ts b/apps/merchant-admin/src/api/finance.ts
index 901db77..e06b10b 100644
--- a/apps/merchant-admin/src/api/finance.ts
+++ b/apps/merchant-admin/src/api/finance.ts
@@ -43,3 +43,12 @@ export function getSettlementDetail(id: number) {
export function getSettlementItems(id: number, params: any) {
return request.get(`/api/merchant/finance/settlements/${id}/items`, { params });
}
+
+// 待结算订单相关
+export function getPendingSettlementOrders(params: any) {
+ return request.get('/api/merchant/finance/settlements/pending/orders', { params });
+}
+
+export function getPendingSettlementSummary() {
+ return request.get('/api/merchant/finance/settlements/pending/summary');
+}
diff --git a/apps/merchant-admin/src/layouts/MainLayout.tsx b/apps/merchant-admin/src/layouts/MainLayout.tsx
index 9347d6f..e505450 100644
--- a/apps/merchant-admin/src/layouts/MainLayout.tsx
+++ b/apps/merchant-admin/src/layouts/MainLayout.tsx
@@ -14,6 +14,7 @@ import {
AuditOutlined,
PayCircleOutlined,
AccountBookOutlined,
+ ClockCircleOutlined,
} from '@ant-design/icons';
import { useAuthStore } from '@/store/auth';
@@ -30,6 +31,7 @@ const menuItems = [
icon: ,
label: '财务管理',
children: [
+ { key: '/finance/pending-settlement', icon: , label: '待结算订单' },
{ key: '/finance/settlements', icon: , label: '结算对账' },
{ key: '/finance/withdrawals', icon: , label: '收款记录' },
{ key: '/finance/wallet', icon: , label: '我的钱包' },
diff --git a/apps/merchant-admin/src/pages/finance/PendingSettlement.tsx b/apps/merchant-admin/src/pages/finance/PendingSettlement.tsx
new file mode 100644
index 0000000..b2d0073
--- /dev/null
+++ b/apps/merchant-admin/src/pages/finance/PendingSettlement.tsx
@@ -0,0 +1,242 @@
+import React, { useEffect, useState } from 'react';
+import { Card, Table, Statistic, Row, Col, Space, Tag } from 'antd';
+import { ClockCircleOutlined, DollarOutlined, FileTextOutlined, CalendarOutlined } from '@ant-design/icons';
+import { getPendingSettlementOrders, getPendingSettlementSummary } from '@/api/finance';
+import type { ColumnsType } from 'antd/es/table';
+import { formatMoney, formatDate, formatDateTime } from '@rent/shared-utils';
+import { useTableData } from '@/hooks/useTableData';
+
+interface PendingOrder {
+ id: number;
+ orderNo: string;
+ roomName: string;
+ checkInDate: string;
+ checkOutDate: string;
+ nights: number;
+ payAmount: number;
+ serviceFee: number;
+ merchantIncome: number;
+ checkoutAt: string;
+ contactName: string;
+ contactPhone: string;
+}
+
+interface Summary {
+ orderCount: number;
+ totalPayAmount: number;
+ totalServiceFee: number;
+ totalMerchantIncome: number;
+ startDate: string;
+ lastSettlementDate: string | null;
+}
+
+const PendingSettlement: React.FC = () => {
+ const [summary, setSummary] = useState(null);
+ const [summaryLoading, setSummaryLoading] = useState(false);
+
+ const {
+ data: orders,
+ loading,
+ total,
+ page,
+ pageSize,
+ setPage,
+ setPageSize,
+ refresh,
+ } = useTableData({
+ fetchFn: async (params) => {
+ const res = await getPendingSettlementOrders(params);
+ return {
+ list: res.data.list || [],
+ total: res.data.total,
+ page: params.page || 1,
+ pageSize: params.pageSize || 20,
+ totalPages: Math.ceil(res.data.total / (params.pageSize || 20)),
+ };
+ },
+ initialParams: { pageSize: 20 },
+ });
+
+ useEffect(() => {
+ fetchSummary();
+ }, []);
+
+ const fetchSummary = async () => {
+ setSummaryLoading(true);
+ try {
+ const res = await getPendingSettlementSummary();
+ setSummary(res.data);
+ } catch (error) {
+ console.error('获取待结算统计失败', error);
+ } finally {
+ setSummaryLoading(false);
+ }
+ };
+
+ const columns: ColumnsType = [
+ {
+ title: '订单号',
+ dataIndex: 'orderNo',
+ key: 'orderNo',
+ width: 180,
+ fixed: 'left',
+ },
+ {
+ title: '房型名称',
+ dataIndex: 'roomName',
+ key: 'roomName',
+ width: 150,
+ },
+ {
+ title: '入住日期',
+ dataIndex: 'checkInDate',
+ key: 'checkInDate',
+ width: 120,
+ render: (date: string) => formatDate(date),
+ },
+ {
+ title: '离店日期',
+ dataIndex: 'checkOutDate',
+ key: 'checkOutDate',
+ width: 120,
+ render: (date: string) => formatDate(date),
+ },
+ {
+ title: '入住晚数',
+ dataIndex: 'nights',
+ key: 'nights',
+ width: 100,
+ render: (nights: number) => `${nights}晚`,
+ },
+ {
+ title: '订单金额',
+ dataIndex: 'payAmount',
+ key: 'payAmount',
+ width: 120,
+ render: (amount: number) => formatMoney(amount),
+ },
+ {
+ title: '服务费',
+ dataIndex: 'serviceFee',
+ key: 'serviceFee',
+ width: 120,
+ render: (fee: number) => -{formatMoney(fee, '')},
+ },
+ {
+ title: '预计收入',
+ dataIndex: 'merchantIncome',
+ key: 'merchantIncome',
+ width: 120,
+ render: (income: number) => (
+ {formatMoney(income)}
+ ),
+ },
+ {
+ title: '完成时间',
+ dataIndex: 'checkoutAt',
+ key: 'checkoutAt',
+ width: 180,
+ render: (date: string) => formatDateTime(date),
+ },
+ {
+ title: '联系人',
+ key: 'contact',
+ width: 150,
+ render: (_, record) => (
+
+
{record.contactName}
+
{record.contactPhone}
+
+ ),
+ },
+ ];
+
+ return (
+
+
待结算订单
+
+
+
+
+ }
+ suffix="笔"
+ />
+
+
+
+
+ }
+ suffix="元"
+ />
+
+
+
+
+ }
+ suffix="元"
+ valueStyle={{ color: '#ff4d4f' }}
+ />
+
+
+
+
+ }
+ suffix="元"
+ valueStyle={{ color: '#52c41a' }}
+ />
+
+
+
+
+
+ {summary?.lastSettlementDate && (
+ } color="blue">
+ 上次结算: {formatDate(summary.lastSettlementDate)}
+
+ )}
+ } color="orange">
+ 统计起始: {summary?.startDate ? formatDate(summary.startDate) : '-'}
+
+
+ }
+ >
+ `共 ${total} 条`,
+ onChange: setPage,
+ onShowSizeChange: (_, size) => setPageSize(size),
+ }}
+ />
+
+
+ );
+};
+
+export default PendingSettlement;
diff --git a/apps/miniapp/src/api/user/wallet.ts b/apps/miniapp/src/api/user/wallet.ts
index e334b9a..bcbc66b 100644
--- a/apps/miniapp/src/api/user/wallet.ts
+++ b/apps/miniapp/src/api/user/wallet.ts
@@ -7,21 +7,6 @@ export interface WalletInfo {
availableBalance: number;
}
-// 交易流水接口
-export interface Transaction {
- id: number;
- accountId: number;
- direction: 'in' | 'out';
- transactionType: string;
- amount: number;
- balanceBefore: number;
- balanceAfter: number;
- description: string;
- relatedId?: number;
- relatedType?: string;
- createdAt: string;
-}
-
// 提现记录接口
export interface Withdrawal {
id: number;
@@ -46,28 +31,10 @@ export const walletApi = {
});
},
- // 获取交易流水
- getTransactions(params?: {
- direction?: 'in' | 'out';
- transactionType?: string;
- startDate?: string;
- endDate?: string;
- page?: number;
- pageSize?: number;
- }) {
- return request<{ items: Transaction[]; total: number }>({
- url: '/api/app/finance/transactions',
- method: 'GET',
- data: params,
- });
- },
-
// 申请提现
withdraw(data: {
amount: number;
- accountType: 'alipay' | 'wechat';
- accountName: string;
- accountNumber: string;
+ paymentChannel: 'wechat' | 'alipay';
}) {
return request({
url: '/api/app/finance/withdraw',
diff --git a/apps/miniapp/src/pages.json b/apps/miniapp/src/pages.json
index 70c436d..18345c7 100644
--- a/apps/miniapp/src/pages.json
+++ b/apps/miniapp/src/pages.json
@@ -197,12 +197,6 @@
"navigationStyle": "custom"
}
},
- {
- "path": "pages/wallet/transactions",
- "style": {
- "navigationBarTitleText": "交易流水"
- }
- },
{
"path": "pages/wallet/withdraw",
"style": {
diff --git a/apps/miniapp/src/pages/index/index.vue b/apps/miniapp/src/pages/index/index.vue
index 04d4b40..0b0ff41 100644
--- a/apps/miniapp/src/pages/index/index.vue
+++ b/apps/miniapp/src/pages/index/index.vue
@@ -32,9 +32,7 @@
入住
-
{{ nightCount }}晚
-
{{ checkOutLabel }}
@@ -633,11 +631,6 @@ onActivated(() => {
padding: 0 32rpx;
}
-.sep-line {
- width: 40rpx;
- height: 2rpx;
- background: #ddd;
-}
.sep-nights {
font-size: 20rpx;
diff --git a/apps/miniapp/src/pages/invite/index.vue b/apps/miniapp/src/pages/invite/index.vue
index fcff094..11d5f28 100644
--- a/apps/miniapp/src/pages/invite/index.vue
+++ b/apps/miniapp/src/pages/invite/index.vue
@@ -18,37 +18,29 @@
-