Merge remote-tracking branch 'origin/huangzhenbao-admin'

This commit is contained in:
not-like-juvenile
2026-03-18 17:14:05 +08:00
676 changed files with 25158 additions and 46646 deletions

View File

@@ -0,0 +1,256 @@
<template>
<view class="finance-balance-record">
<!-- 筛选卡片 -->
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">订单时间:</text>
<view class="date-picker-wrap">
<text class="calendar-icon">📅</text>
<text class="date-placeholder">开始日期 - 结束日期</text>
</view>
</view>
<view class="filter-item">
<text class="filter-label">交易类型:</text>
<view class="select-box">
<text class="select-txt">请选择</text>
<text class="arrow-down">▼</text>
</view>
</view>
</view>
</view>
<!-- 列表表格 -->
<view class="table-container border-shadow">
<view class="table-header">
<view class="th col-id"><text class="th-txt">ID</text></view>
<view class="th col-order"><text class="th-txt">关联订单</text></view>
<view class="th col-time"><text class="th-txt">交易时间</text></view>
<view class="th col-amount"><text class="th-txt">交易金额</text></view>
<view class="th col-user"><text class="th-txt">用户</text></view>
<view class="th col-type"><text class="th-txt">交易类型</text></view>
<view class="th col-remark"><text class="th-txt">备注</text></view>
<view class="th col-op"><text class="th-txt">操作</text></view>
</view>
<scroll-view class="table-body">
<view class="table-row" v-for="item in pagedList" :key="item.id">
<view class="td col-id"><text class="td-txt">{{ item.id }}</text></view>
<view class="td col-order text-left"><text class="td-txt">{{ item.order }}</text></view>
<view class="td col-time"><text class="td-txt">{{ item.time }}</text></view>
<view class="td col-amount">
<text :class="['td-txt', item.amount.startsWith('+') ? 'red-txt' : 'green-txt']">{{ item.amount }}</text>
</view>
<view class="td col-user"><text class="td-txt">{{ item.user }}</text></view>
<view class="td col-type"><text class="td-txt">{{ item.type }}</text></view>
<view class="td col-remark text-left"><text class="td-txt">{{ item.remark }}</text></view>
<view class="td col-op">
<text class="btn-link">备注</text>
</view>
</view>
</scroll-view>
<CommonPagination
v-if="total > 0"
:total="total"
:loading="false"
:currentPage="currentPage"
:pageSize="pageSize"
:pageSizeOptionLabels="pageSizeOptionLabels"
:pageSizeIndex="pageSizeIndex"
:visiblePages="visiblePages"
:totalPage="totalPage"
:jumpPageInput="jumpPageInput"
@page-size-change="handlePageSizeChange"
@page-change="handlePageChange"
@update:jumpPageInput="(val: string) => { jumpPageInput.value = val }"
@jump-page="handleJumpPage"
/>
</view>
</view>
</template>
<script setup lang="uts">
import { ref, computed } from 'vue'
import CommonPagination from '@/components/CommonPagination/CommonPagination.uvue'
interface BalanceRecord {
id: string
order: string
time: string
amount: string
user: string
type: string
remark: string
}
// ========== MOCK DATA START ==========
// TODO: 接真实接口时替换此处 tableData 为 fetchBalanceRecordList() 调用
const tableData = ref<BalanceRecord[]>([
{ id: '31216', order: '新用户注册赠送余额', time: '2026-02-03 10:30:11', amount: '+ 88888.00', user: '1', type: '新用户注册赠送余额', remark: '新用户注册赠送88888余额' },
{ id: '31215', order: '新用户注册赠送余额', time: '2026-02-03 10:19:52', amount: '+ 88888.00', user: 'circus', type: '新用户注册赠送余额', remark: '新用户注册赠送88888余额' },
{ id: '31214', order: 'cp541560738494283776', time: '2026-02-03 10:09:07', amount: '- 999.00', user: '1岁上班22岁退休', type: '余额支付购买商品', remark: '余额支付999.00元购买商品' },
{ id: '31213', order: '新用户注册赠送余额', time: '2026-02-03 10:07:59', amount: '+ 88888.00', user: '1岁上班22岁退休', type: '新用户注册赠送余额', remark: '新用户注册赠送88888余额' },
{ id: '31212', order: '新用户注册赠送余额', time: '2026-02-03 02:17:24', amount: '+ 88888.00', user: '136****0434', type: '新用户注册赠送余额', remark: '新用户注册赠送88888余额' },
{ id: '31211', order: '新用户注册赠送余额', time: '2026-02-03 02:04:17', amount: '+ 88888.00', user: '灵境', type: '新用户注册赠送余额', remark: '新用户注册赠送88888余额' },
{ id: '31210', order: '新用户注册赠送余额', time: '2026-02-03 00:58:21', amount: '+ 88888.00', user: 'J.', type: '新用户注册赠送余额', remark: '新用户注册赠送88888余额' },
{ id: '31209', order: 'cp540123456789012345', time: '2026-02-02 18:30:00', amount: '- 288.00', user: '张小明', type: '余额支付购买商品', remark: '余额支付288.00元购买商品' },
{ id: '31208', order: '管理员手动充值', time: '2026-02-02 16:00:00', amount: '+ 500.00', user: '李大力', type: '管理员手动充值', remark: '管理员充值500元' },
{ id: '31207', order: 'cp539876543210987654', time: '2026-02-02 14:20:00', amount: '- 99.00', user: '王芳', type: '余额支付购买商品', remark: '余额支付99.00元购买商品' },
{ id: '31206', order: '退款退回余额', time: '2026-02-02 11:45:00', amount: '+ 150.00', user: '赵明', type: '退款退回余额', remark: '订单退款150元返还余额' },
{ id: '31205', order: 'cp538765432109876543', time: '2026-02-02 09:00:00', amount: '- 1280.00', user: '陈小燕', type: '余额支付购买商品', remark: '余额支付1280.00元购买商品' },
{ id: '31204', order: '签到赠送余额', time: '2026-02-01 23:59:00', amount: '+ 10.00', user: '刘建国', type: '签到赠送余额', remark: '每日签到赠送10元余额' },
{ id: '31203', order: 'cp537654321098765432', time: '2026-02-01 20:30:00', amount: '- 450.00', user: '黄晓兰', type: '余额支付购买商品', remark: '余额支付450.00元购买商品' },
{ id: '31202', order: '新用户注册赠送余额', time: '2026-02-01 18:00:00', amount: '+ 88888.00', user: '周大卫', type: '新用户注册赠送余额', remark: '新用户注册赠送88888余额' },
{ id: '31201', order: '管理员手动充值', time: '2026-02-01 15:30:00', amount: '+ 1000.00', user: '吴玲玲', type: '管理员手动充值', remark: '管理员充值1000元' },
{ id: '31200', order: 'cp536543210987654321', time: '2026-02-01 12:00:00', amount: '- 680.00', user: '郑明亮', type: '余额支付购买商品', remark: '余额支付680.00元购买商品' },
{ id: '31199', order: '活动赠送余额', time: '2026-02-01 10:00:00', amount: '+ 200.00', user: '孙小丽', type: '活动赠送余额', remark: '新春活动赠送200元余额' },
{ id: '31198', order: 'cp535432109876543210', time: '2026-01-31 16:30:00', amount: '- 320.00', user: '冯浩', type: '余额支付购买商品', remark: '余额支付320.00元购买商品' },
{ id: '31197', order: '退款退回余额', time: '2026-01-31 14:00:00', amount: '+ 99.00', user: '陈建国', type: '退款退回余额', remark: '订单退款99元返还余额' },
])
// ========== MOCK DATA END ==========
// ========== PAGINATION STATE ==========
const currentPage = ref(1)
const pageSize = ref(15)
const jumpPageInput = ref('')
const pageSizeOptions = [10, 15, 20, 30, 50]
const pageSizeOptionLabels = computed(() => pageSizeOptions.map((n: number) => `${n}条/页`))
const pageSizeIndex = computed(() => { const idx = pageSizeOptions.indexOf(pageSize.value); return idx >= 0 ? idx : 0 })
const total = computed(() => tableData.value.length)
const totalPage = computed(() => Math.max(1, Math.ceil(total.value / pageSize.value)))
const pagedList = computed(() => {
const start = (currentPage.value - 1) * pageSize.value
return tableData.value.slice(start, start + pageSize.value)
})
const visiblePages = computed((): number[] => {
const t = totalPage.value; const cur = currentPage.value
if (t <= 7) return Array.from({ length: t }, (_: any, i: number) => i + 1)
if (cur <= 4) return [1, 2, 3, 4, 5, -1, t]
if (cur >= t - 3) return [1, -1, t - 4, t - 3, t - 2, t - 1, t]
return [1, -1, cur - 1, cur, cur + 1, -1, t]
})
const handlePageChange = (p: number) => { currentPage.value = p }
const handlePageSizeChange = (e: any) => {
const idx = Number(e.detail.value)
pageSize.value = pageSizeOptions[idx] ?? pageSizeOptions[0]
currentPage.value = 1
}
const handleJumpPage = () => {
const p = parseInt(jumpPageInput.value)
if (!isNaN(p) && p >= 1 && p <= totalPage.value) currentPage.value = p
}
// ========== END PAGINATION STATE ==========
</script>
<style scoped lang="scss">
.finance-balance-record {
padding: 0;
background-color: transparent;
min-height: auto;
}
.border-shadow {
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
.filter-card { padding: 24px; margin-bottom: 20px; }
.filter-row { display: flex; flex-direction: row; align-items: center; }
.filter-item { display: flex; flex-direction: row; align-items: center; margin-right: 40px; }
.filter-label { font-size: 14px; color: #333; margin-right: 15px; }
.date-picker-wrap {
width: 260px;
height: 36px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 12px;
}
.select-box {
width: 200px;
height: 36px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 12px;
}
.calendar-icon { font-size: 14px; margin-right: 10px; color: #c0c4cc; }
.date-placeholder, .select-txt { font-size: 14px; color: #c0c4cc; }
.arrow-down { margin-left: auto; font-size: 10px; color: #c0c4cc; }
/* 表格样式 */
.table-container {
display: flex;
flex-direction: column;
min-height: 600px;
}
.table-header {
background-color: #e6f0ff;
display: flex;
flex-direction: row;
border-bottom: 1px solid #f0f0f0;
padding: 4px 0;
}
.th {
padding: 12px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.th-txt {
font-size: 13px;
font-weight: 500;
color: #606266;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #f0f0f0;
background-color: #fff;
}
.table-row:hover {
background-color: #f9f9f9;
}
.td {
padding: 16px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.td-txt {
font-size: 13px;
color: #606266;
}
/* 列宽分配 (参考截图比例) */
.col-id { width: 70px; }
.col-order { flex: 1.5; min-width: 180px; justify-content: flex-start; }
.col-time { width: 160px; }
.col-amount { width: 120px; }
.col-user { width: 120px; }
.col-type { width: 150px; }
.col-remark { flex: 1.8; min-width: 200px; justify-content: flex-start; }
.col-op { width: 80px; }
.text-left { justify-content: flex-start; text-align: left; }
/* 颜色 */
.red-txt { color: #f56c6c; font-weight: 500; }
.green-txt { color: #67c23a; font-weight: 500; }
.btn-link { color: #1890ff; font-size: 13px; cursor: pointer; }
</style>

View File

@@ -328,9 +328,9 @@ function toggleConsumptionStyle() {
<style scoped lang="scss">
.finance-balance-stats {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
padding: 0;
background-color: transparent;
min-height: auto;
}
.border-shadow {

View File

@@ -1,367 +0,0 @@
<template>
<view class="finance-capital-flow">
<!-- 头部筛选区 -->
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">交易类型:</text>
<uni-data-select v-model="typeValue" :localdata="typeOptions" class="data-select" @change="handleQuery" />
</view>
<view class="filter-item">
<text class="filter-label">收支类型:</text>
<uni-data-select v-model="pmValue" :localdata="pmOptions" class="data-select" @change="handleQuery" />
</view>
<view class="filter-item search-wrap">
<text class="filter-label">流水搜索:</text>
<input class="search-input" v-model="searchKeyword" placeholder="订单号/昵称/电话/用户ID" @confirm="handleQuery" />
</view>
<view class="btn-query" @click="handleQuery">
<text class="btn-txt">查询</text>
</view>
</view>
</view>
<!-- 数据表格 (Flex 模拟) -->
<view class="table-container border-shadow">
<view class="table-header">
<view class="th col-flow"><text class="th-txt">交易 ID</text></view>
<view class="th col-order"><text class="th-txt">关联单据</text></view>
<view class="th col-time"><text class="th-txt">交易时间</text></view>
<view class="th col-amount"><text class="th-txt">交易金额</text></view>
<view class="th col-user"><text class="th-txt">交易用户</text></view>
<view class="th col-method"><text class="th-txt">业务类型</text></view>
<view class="th col-remark"><text class="th-txt">备注</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view v-if="loading" class="table-loading" style="padding: 40px; text-align: center;">
<text>加载中...</text>
</view>
<view v-else-if="tableData.length === 0" class="table-empty" style="padding: 40px; text-align: center;">
<text>暂无流水记录</text>
</view>
<view class="table-row" v-for="item in tableData" :key="item.id">
<view class="td col-flow"><text class="td-txt">{{ item.id.substring(0, 8) }}...</text></view>
<view class="td col-order text-left"><text class="td-txt">{{ item.link_id || '-' }}</text></view>
<view class="td col-time"><text class="td-txt">{{ item.created_at.substring(0, 16).replace('T', ' ') }}</text></view>
<view class="td col-amount">
<text class="td-txt" :class="item.pm === 1 ? 'red-txt' : 'green-txt'">
{{ item.pm === 1 ? '+' : '-' }}{{ item.number.toFixed(2) }}
</text>
</view>
<view class="td col-user">
<view class="u-info-box">
<text class="u-name">{{ item.user_name || '未知' }}</text>
<text class="u-id">UID:{{ item.uid.substring(0, 8) }}</text>
</view>
</view>
<view class="td col-method"><text class="td-txt">{{ getBillTypeText(item.type) }}</text></view>
<view class="td col-remark"><text class="td-txt">{{ item.mark || '-' }}</text></view>
<view class="td col-ops">
<text class="op-link">详情</text>
</view>
</view>
</view>
</view>
<!-- 分页区域 -->
<view class="pagination-footer">
<view class="page-total">
<text class="total-txt">共 {{ total }} 条</text>
</view>
<view class="page-btns">
<view class="p-btn" :class="{ disabled: page <= 1 }" @click="prevPage">
<text><</text>
</view>
<view class="p-btn active">
<text>{{ page }}</text>
</view>
<view class="p-btn" :class="{ disabled: page >= totalPages }" @click="nextPage">
<text>></text>
</view>
</view>
<view class="page-jump">
<text class="jump-txt">前往</text>
<input class="jump-input" v-model="jumpPage" type="number" @confirm="goToJumpPage" />
<text class="jump-txt">页</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { ref, onMounted, computed } from 'vue'
import { fetchUserBillList } from '@/services/admin/financeService.uts'
import { UserBillRecord } from '@/types/admin/finance.uts'
const typeValue = ref<string>('all')
const pmValue = ref<string>('all')
const searchKeyword = ref('')
const page = ref(1)
const pageSize = ref(15)
const total = ref(0)
const loading = ref(false)
const jumpPage = ref('')
const typeOptions = [
{ value: 'all', text: '全部类型' },
{ value: 'recharge', text: '充值' },
{ value: 'extract', text: '提现' },
{ value: 'pay', text: '支付' },
{ value: 'refund', text: '退款' }
]
const pmOptions = [
{ value: 'all', text: '全部' },
{ value: '1', text: '收入' },
{ value: '0', text: '支出' }
]
const tableData = ref<UserBillRecord[]>([])
const totalPages = computed(() : number => {
if (pageSize.value <= 0) return 1
return Math.ceil(total.value / pageSize.value)
})
async function loadList() {
loading.value = true
try {
const pm = pmValue.value == 'all' ? null : parseInt(pmValue.value)
const type = typeValue.value == 'all' ? null : typeValue.value
const res = await fetchUserBillList(
page.value,
pageSize.value,
null, // category 先不传
type,
pm,
null,
null,
searchKeyword.value || null
)
tableData.value = res.items
total.value = res.total
} catch (e) {
uni.showToast({ title: '加载流水失败', icon: 'none' })
} finally {
loading.value = false
}
}
onMounted(() => {
loadList()
})
const handleQuery = () => {
page.value = 1
loadList()
}
const prevPage = () => {
if (page.value > 1) {
page.value--
loadList()
}
}
const nextPage = () => {
if (page.value < totalPages.value) {
page.value++
loadList()
}
}
const goToJumpPage = () => {
const targetPage = parseInt(jumpPage.value)
if (!isNaN(targetPage) && targetPage >= 1 && targetPage <= totalPages.value) {
page.value = targetPage
loadList()
jumpPage.value = ''
} else {
uni.showToast({ title: '页码无效', icon: 'none' })
}
}
function getBillTypeText(type : string) : string {
const found = typeOptions.find(opt => opt.value === type)
return found != null ? found.text : type
}
</script>
<style scoped lang="scss">
.finance-capital-flow {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
}
.border-shadow {
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 筛选卡片 */
.filter-card {
padding: 20px 24px;
margin-bottom: 20px;
}
.filter-row {
display: flex;
flex-direction: row;
align-items: center;
}
.filter-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 28px;
}
.filter-label {
font-size: 14px;
color: #333;
margin-right: 10px;
white-space: nowrap;
}
.data-select {
width: 140px;
}
.search-wrap {
flex: 1;
}
.search-input {
flex: 1;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 0 12px;
font-size: 13px;
}
.btn-query {
background-color: #1890ff;
border-radius: 4px;
height: 32px;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: center;
margin-left: 10px;
cursor: pointer;
}
.btn-txt {
color: #fff;
font-size: 14px;
}
/* 表格 */
.table-container {
display: flex;
flex-direction: column;
}
.table-header {
background-color: #f8f9fb;
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.th {
padding: 12px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.th-txt {
font-size: 14px;
font-weight: 600;
color: #909399;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
min-height: 60px;
}
.td {
padding: 12px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.td-txt {
font-size: 13px;
color: #606266;
}
.u-info-box {
display: flex;
flex-direction: column;
align-items: flex-start;
.u-name { font-size: 13px; color: #303133; font-weight: 500; }
.u-id { font-size: 11px; color: #909399; }
}
.red-txt { color: #f5222d; font-weight: bold; }
.green-txt { color: #52c41a; font-weight: bold; }
.col-flow { width: 140px; }
.col-order { width: 200px; }
.col-time { width: 160px; }
.col-amount { width: 120px; }
.col-user { width: 160px; }
.col-method { width: 120px; }
.col-remark { flex: 1; min-width: 150px; }
.col-ops { width: 100px; }
.text-left { justify-content: flex-start; }
.op-link {
font-size: 13px;
color: #1890ff;
cursor: pointer;
}
/* 分页 */
.pagination-footer {
padding: 24px 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
gap: 12px;
}
.total-txt { font-size: 14px; color: #606266; }
.page-btns { display: flex; flex-direction: row; gap: 8px; }
.p-btn {
width: 32px;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
cursor: pointer;
}
.p-btn.active { background-color: #2d8cf0; border-color: #2d8cf0; color: #fff; }
.p-btn.disabled { color: #c0c4cc; background-color: #f5f7fa; cursor: not-allowed; }
.page-jump { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.jump-txt { font-size: 14px; color: #606266; }
.jump-input { width: 40px; height: 32px; border: 1px solid #dcdfe6; text-align: center; border-radius: 4px; font-size: 14px; }
</style>

View File

@@ -0,0 +1,270 @@
<template>
<view class="finance-commission">
<!-- 筛选卡片 -->
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">昵称/手机号/分销商ID:</text>
<input class="search-input" placeholder="请输入昵称搜索" />
</view>
<view class="btn-query">
<text class="btn-txt">查询</text>
</view>
</view>
</view>
<!-- 列表表格 -->
<view class="table-card border-shadow">
<view class="action-bar">
<view class="btn-export">
<text class="export-txt">导出</text>
</view>
</view>
<view class="table-container">
<view class="table-header">
<view class="th col-user"><text class="th-txt">用户信息</text></view>
<view class="th col-total"><text class="th-txt">总佣金金额</text></view>
<view class="th col-account"><text class="th-txt">账户佣金</text></view>
<view class="th col-withdraw"><text class="th-txt">提现佣金</text></view>
</view>
<view class="table-body">
<view class="table-row" v-for="item in pagedList" :key="item.uid">
<view class="td col-user">
<text class="td-txt">{{ item.userInfo }}</text>
</view>
<view class="td col-total">
<text class="td-txt">{{ item.totalAmount }}</text>
</view>
<view class="td col-account">
<text class="td-txt">{{ item.accountAmount }}</text>
</view>
<view class="td col-withdraw">
<text class="td-txt">{{ item.withdrawAmount }}</text>
</view>
</view>
</view>
</view>
<CommonPagination
v-if="total > 0"
:total="total"
:loading="false"
:currentPage="currentPage"
:pageSize="pageSize"
:pageSizeOptionLabels="pageSizeOptionLabels"
:pageSizeIndex="pageSizeIndex"
:visiblePages="visiblePages"
:totalPage="totalPage"
:jumpPageInput="jumpPageInput"
@page-size-change="handlePageSizeChange"
@page-change="handlePageChange"
@update:jumpPageInput="(val: string) => { jumpPageInput.value = val }"
@jump-page="handleJumpPage"
/>
</view>
</view>
</template>
<script setup lang="uts">
import { ref, computed } from 'vue'
import CommonPagination from '@/components/CommonPagination/CommonPagination.uvue'
interface CommissionSummary {
uid: string
userInfo: string
totalAmount: string
accountAmount: string
withdrawAmount: string
}
// ========== MOCK DATA START ==========
// TODO: 接真实接口时替换此处 tableData 为 fetchCommissionList() 调用
const tableData = ref<CommissionSummary[]>([
{ uid: '77418', userInfo: '张迪 | 155****5525 | 77418', totalAmount: '11.00', accountAmount: '11.00', withdrawAmount: '0' },
{ uid: '69696', userInfo: "I'm yours - | 69696", totalAmount: '0.40', accountAmount: '0.40', withdrawAmount: '0' },
{ uid: '68582', userInfo: 'guan | 68582', totalAmount: '140.80', accountAmount: '140.80', withdrawAmount: '0' },
{ uid: '65258', userInfo: '纯爱战神别名王富贵儿 | 158****4881 | 65258', totalAmount: '11.00', accountAmount: '11.00', withdrawAmount: '0' },
{ uid: '66265', userInfo: '王伟兴 | 66265', totalAmount: '11.99', accountAmount: '11.99', withdrawAmount: '0' },
{ uid: '65270', userInfo: '199****1781 | 199****1781 | 65270', totalAmount: '31.60', accountAmount: '31.60', withdrawAmount: '0' },
{ uid: '64572', userInfo: '洒笾菂艸 | 188****2434 | 64572', totalAmount: '0.20', accountAmount: '0.20', withdrawAmount: '0' },
{ uid: '47952', userInfo: '那小子 | 134****3573 | 47952', totalAmount: '19.80', accountAmount: '19.80', withdrawAmount: '0' },
{ uid: '43210', userInfo: '小花猫 | 132****0011 | 43210', totalAmount: '56.00', accountAmount: '30.00', withdrawAmount: '26.00' },
{ uid: '39876', userInfo: '蓝色天空 | 136****5566 | 39876', totalAmount: '88.50', accountAmount: '50.00', withdrawAmount: '38.50' },
{ uid: '35432', userInfo: '星星之火 | 159****7788 | 35432', totalAmount: '200.00', accountAmount: '100.00', withdrawAmount: '100.00' },
{ uid: '31098', userInfo: '夜行者 | 177****9900 | 31098', totalAmount: '15.60', accountAmount: '15.60', withdrawAmount: '0' },
{ uid: '26754', userInfo: '晨曦 | 138****1122 | 26754', totalAmount: '320.00', accountAmount: '200.00', withdrawAmount: '120.00' },
{ uid: '22410', userInfo: '落叶归根 | 152****3344 | 22410', totalAmount: '45.80', accountAmount: '45.80', withdrawAmount: '0' },
{ uid: '18066', userInfo: '风中漫步 | 189****5566 | 18066', totalAmount: '800.00', accountAmount: '500.00', withdrawAmount: '300.00' },
{ uid: '13722', userInfo: '快乐小屋 | 133****7788 | 13722', totalAmount: '12.00', accountAmount: '12.00', withdrawAmount: '0' },
{ uid: '9378', userInfo: '云端漫步 | 176****9900 | 9378', totalAmount: '650.00', accountAmount: '400.00', withdrawAmount: '250.00' },
{ uid: '5034', userInfo: '绿草如茵 | 156****0011 | 5034', totalAmount: '28.40', accountAmount: '28.40', withdrawAmount: '0' },
{ uid: '88901', userInfo: '阳光路上 | 139****2233 | 88901', totalAmount: '1200.00', accountAmount: '800.00', withdrawAmount: '400.00' },
{ uid: '84557', userInfo: '繁花似锦 | 173****4455 | 84557', totalAmount: '76.60', accountAmount: '76.60', withdrawAmount: '0' },
])
// ========== MOCK DATA END ==========
// ========== PAGINATION STATE ==========
const currentPage = ref(1)
const pageSize = ref(15)
const jumpPageInput = ref('')
const pageSizeOptions = [10, 15, 20, 30, 50]
const pageSizeOptionLabels = computed(() => pageSizeOptions.map((n: number) => `${n}条/页`))
const pageSizeIndex = computed(() => { const idx = pageSizeOptions.indexOf(pageSize.value); return idx >= 0 ? idx : 0 })
const total = computed(() => tableData.value.length)
const totalPage = computed(() => Math.max(1, Math.ceil(total.value / pageSize.value)))
const pagedList = computed(() => {
const start = (currentPage.value - 1) * pageSize.value
return tableData.value.slice(start, start + pageSize.value)
})
const visiblePages = computed((): number[] => {
const t = totalPage.value; const cur = currentPage.value
if (t <= 7) return Array.from({ length: t }, (_: any, i: number) => i + 1)
if (cur <= 4) return [1, 2, 3, 4, 5, -1, t]
if (cur >= t - 3) return [1, -1, t - 4, t - 3, t - 2, t - 1, t]
return [1, -1, cur - 1, cur, cur + 1, -1, t]
})
const handlePageChange = (p: number) => { currentPage.value = p }
const handlePageSizeChange = (e: any) => {
const idx = Number(e.detail.value)
pageSize.value = pageSizeOptions[idx] ?? pageSizeOptions[0]
currentPage.value = 1
}
const handleJumpPage = () => {
const p = parseInt(jumpPageInput.value)
if (!isNaN(p) && p >= 1 && p <= totalPage.value) currentPage.value = p
}
// ========== END PAGINATION STATE ==========
</script>
<style scoped lang="scss">
.finance-commission {
padding: 0;
background-color: transparent;
min-height: auto;
}
.border-shadow {
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 筛选 */
.filter-card {
padding: 24px;
margin-bottom: 20px;
}
.filter-row {
display: flex;
flex-direction: row;
align-items: center;
}
.filter-label {
font-size: 14px;
color: #333;
margin-right: 12px;
}
.search-input {
width: 240px;
height: 36px;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 0 12px;
font-size: 14px;
}
.btn-query {
margin-left: 12px;
background-color: #1890ff;
border-radius: 4px;
height: 36px;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-txt {
color: #fff;
font-size: 14px;
}
/* 表格区域 */
.table-card {
padding: 0;
}
.action-bar {
padding: 15px 20px;
}
.btn-export {
width: 60px;
height: 32px;
background-color: #e6f7ff;
border: 1px solid #91d5ff;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.export-txt {
color: #1890ff;
font-size: 14px;
}
.table-container {
display: flex;
flex-direction: column;
}
.table-header {
background-color: #e6f0ff; /* 淡蓝色表头 */
display: flex;
flex-direction: row;
}
.th {
padding: 14px 20px;
display: flex;
align-items: center;
}
.th-txt {
font-size: 14px;
font-weight: 500;
color: #606266;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #f0f0f0;
}
.table-row:hover {
background-color: #fafafa;
}
.td {
padding: 16px 20px;
display: flex;
align-items: center;
}
.td-txt {
font-size: 14px;
color: #606266;
}
/* 列宽分配 */
.col-user { flex: 2; min-width: 300px; justify-content: flex-start; }
.col-total { flex: 1; justify-content: flex-start; }
.col-account { flex: 1; justify-content: flex-start; }
.col-withdraw { flex: 1; justify-content: flex-start; }
</style>

View File

@@ -0,0 +1,394 @@
<template>
<view class="finance-invoice">
<!-- 头部筛选区 -->
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">创建时间:</text>
<view class="date-picker-wrap">
<text class="calendar-icon">📅</text>
<text class="date-placeholder">开始日期 - 结束日期</text>
</view>
</view>
<view class="filter-item">
<text class="filter-label">搜索:</text>
<view class="search-group">
<view class="select-trigger">
<text class="select-txt">请选择</text>
<text class="arrow-down">▼</text>
</view>
<input class="search-input" placeholder="请输入" />
</view>
</view>
<view class="btn-query">
<text class="btn-txt">查询</text>
</view>
</view>
</view>
<!-- 状态切换选项卡 -->
<view class="tab-section">
<view
v-for="(tab, index) in tabs"
:key="index"
class="tab-item"
:class="{ active: activeTab === index }"
@click="activeTab = index"
>
<text class="tab-title">{{ tab.name }} ({{ tab.count }})</text>
<view class="active-line" v-if="activeTab === index"></view>
</view>
</view>
<!-- 数据表格 (Flex 模拟) -->
<view class="table-container border-shadow">
<view class="table-header">
<view class="th col-order"><text class="th-txt">订单号</text></view>
<view class="th col-amount"><text class="th-txt">订单金额</text></view>
<view class="th col-type"><text class="th-txt">发票类型</text></view>
<view class="th col-header"><text class="th-txt">发票抬头类型</text></view>
<view class="th col-time"><text class="th-txt">下单时间</text></view>
<view class="th col-status-inv"><text class="th-txt">开票状态</text></view>
<view class="th col-status-order"><text class="th-txt">订单状态</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view class="table-row" v-for="item in pagedList" :key="item.orderNo">
<view class="td col-order text-left"><text class="td-txt">{{ item.orderNo }}</text></view>
<view class="td col-amount"><text class="td-txt">¥ {{ item.amount }}</text></view>
<view class="td col-type"><text class="td-txt">{{ item.invoiceType }}</text></view>
<view class="td col-header"><text class="td-txt">{{ item.headerType }}</text></view>
<view class="td col-time"><text class="td-txt">{{ item.time }}</text></view>
<view class="td col-status-inv"><text class="td-txt red-cell">{{ item.invStatus }}</text></view>
<view class="td col-status-order"><text class="td-txt">{{ item.orderStatus }}</text></view>
<view class="td col-ops">
<view class="ops-box">
<text class="op-link">操作</text>
<text class="sep">|</text>
<text class="op-link">订单信息</text>
</view>
</view>
</view>
</view>
</view>
<CommonPagination
v-if="total > 0"
:total="total"
:loading="false"
:currentPage="currentPage"
:pageSize="pageSize"
:pageSizeOptionLabels="pageSizeOptionLabels"
:pageSizeIndex="pageSizeIndex"
:visiblePages="visiblePages"
:totalPage="totalPage"
:jumpPageInput="jumpPageInput"
@page-size-change="handlePageSizeChange"
@page-change="handlePageChange"
@update:jumpPageInput="(val: string) => { jumpPageInput.value = val }"
@jump-page="handleJumpPage"
/>
</view>
</template>
<script setup lang="uts">
import { ref, computed } from 'vue'
import CommonPagination from '@/components/CommonPagination/CommonPagination.uvue'
const activeTab = ref(0)
const tabs = ref([
{ name: '全部发票', count: 163 },
{ name: '待开发票', count: 105 },
{ name: '已开发票', count: 34 },
{ name: '退款发票', count: 33 }
])
// ========== MOCK DATA START ==========
// TODO: 接真实接口时替换此处 tableData 为 fetchInvoiceList() 调用
const tableData = ref([
{ orderNo: 'cp538981381384962048', amount: '999.00', invoiceType: '电子普通发票', headerType: '个人', time: '2026-01-27 07:19:35', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp523490058603331584', amount: '9.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-12-15 13:22:35', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp524967077409193984', amount: '9.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-12-19 15:11:44', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp521126678106210304', amount: '11890.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-12-09 00:51:22', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp521126166883467264', amount: '11800.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-12-09 00:49:20', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp517015093888679936', amount: '142.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-11-27 16:33:24', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp313601579989073920', amount: '0.00', invoiceType: '电子普通发票', headerType: '个人', time: '2024-05-15 08:59:56', invStatus: '未开票', orderStatus: '待评价' },
{ orderNo: 'cp503871643047690240', amount: '999.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-10-22 10:06:01', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp510234567890123456', amount: '288.00', invoiceType: '电子增值税发票', headerType: '企业', time: '2025-11-05 09:30:00', invStatus: '已开票', orderStatus: '已发货' },
{ orderNo: 'cp511234567890123456', amount: '1580.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-11-10 14:20:00', invStatus: '退款发票', orderStatus: '已退款' },
{ orderNo: 'cp512234567890123456', amount: '680.00', invoiceType: '电子增值税发票', headerType: '企业', time: '2025-11-12 16:45:00', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp513234567890123456', amount: '99.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-11-15 11:00:00', invStatus: '已开票', orderStatus: '已签收' },
{ orderNo: 'cp514234567890123456', amount: '350.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-11-18 08:30:00', invStatus: '未开票', orderStatus: '配送中' },
{ orderNo: 'cp515234567890123456', amount: '2500.00', invoiceType: '电子增值税发票', headerType: '企业', time: '2025-11-20 10:15:00', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp516234567890123456', amount: '120.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-11-22 13:40:00', invStatus: '已开票', orderStatus: '待评价' },
{ orderNo: 'cp518234567890123456', amount: '799.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-11-28 09:50:00', invStatus: '未开票', orderStatus: '未发货' },
{ orderNo: 'cp519234567890123456', amount: '3200.00', invoiceType: '电子增值税发票', headerType: '企业', time: '2025-12-01 14:30:00', invStatus: '退款发票', orderStatus: '已退款' },
{ orderNo: 'cp520234567890123456', amount: '450.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-12-05 10:00:00', invStatus: '未开票', orderStatus: '已发货' },
{ orderNo: 'cp522234567890123456', amount: '980.00', invoiceType: '电子增值税发票', headerType: '企业', time: '2025-12-12 15:20:00', invStatus: '已开票', orderStatus: '已签收' },
{ orderNo: 'cp525234567890123456', amount: '199.00', invoiceType: '电子普通发票', headerType: '个人', time: '2025-12-25 12:00:00', invStatus: '未开票', orderStatus: '未发货' },
])
// ========== MOCK DATA END ==========
// ========== PAGINATION STATE ==========
const currentPage = ref(1)
const pageSize = ref(15)
const jumpPageInput = ref('')
const pageSizeOptions = [10, 15, 20, 30, 50]
const pageSizeOptionLabels = computed(() => pageSizeOptions.map((n: number) => `${n}条/页`))
const pageSizeIndex = computed(() => { const idx = pageSizeOptions.indexOf(pageSize.value); return idx >= 0 ? idx : 0 })
const total = computed(() => tableData.value.length)
const totalPage = computed(() => Math.max(1, Math.ceil(total.value / pageSize.value)))
const pagedList = computed(() => {
const start = (currentPage.value - 1) * pageSize.value
return tableData.value.slice(start, start + pageSize.value)
})
const visiblePages = computed((): number[] => {
const t = totalPage.value; const cur = currentPage.value
if (t <= 7) return Array.from({ length: t }, (_: any, i: number) => i + 1)
if (cur <= 4) return [1, 2, 3, 4, 5, -1, t]
if (cur >= t - 3) return [1, -1, t - 4, t - 3, t - 2, t - 1, t]
return [1, -1, cur - 1, cur, cur + 1, -1, t]
})
const handlePageChange = (p: number) => { currentPage.value = p }
const handlePageSizeChange = (e: any) => {
const idx = Number(e.detail.value)
pageSize.value = pageSizeOptions[idx] ?? pageSizeOptions[0]
currentPage.value = 1
}
const handleJumpPage = () => {
const p = parseInt(jumpPageInput.value)
if (!isNaN(p) && p >= 1 && p <= totalPage.value) currentPage.value = p
}
// ========== END PAGINATION STATE ==========
</script>
<style scoped lang="scss">
.finance-invoice {
padding: 0;
background-color: transparent;
min-height: auto;
}
.border-shadow {
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 筛选栏 */
.filter-card {
padding: 20px 24px;
margin-bottom: 20px;
}
.filter-row {
display: flex;
flex-direction: row;
align-items: center;
}
.filter-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 30px;
}
.filter-label {
font-size: 14px;
color: #333;
margin-right: 8px;
}
.date-picker-wrap {
width: 240px;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 10px;
}
.calendar-icon {
margin-right: 8px;
font-size: 12px;
}
.date-placeholder {
font-size: 13px;
color: #c0c4cc;
}
.search-group {
display: flex;
flex-direction: row;
align-items: center;
border: 1px solid #dcdfe6;
border-radius: 4px;
height: 32px;
overflow: hidden;
}
.select-trigger {
width: 90px;
height: 100%;
border-right: 1px solid #dcdfe6;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 10px;
background-color: #fff;
}
.select-txt {
font-size: 13px;
color: #606266;
}
.arrow-down {
font-size: 8px;
color: #c0c4cc;
}
.search-input {
width: 160px;
height: 100%;
padding: 0 12px;
font-size: 13px;
}
.btn-query {
background-color: #1890ff;
border-radius: 4px;
padding: 0 20px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-txt {
color: #fff;
font-size: 14px;
}
/* 选项卡 */
.tab-section {
display: flex;
flex-direction: row;
margin-bottom: 20px;
border-bottom: 1px solid #e4e7ed;
padding: 0 10px;
}
.tab-item {
padding: 12px 20px;
position: relative;
cursor: pointer;
}
.tab-title {
font-size: 14px;
color: #606266;
transition: all 0.3s;
}
.tab-item.active .tab-title {
color: #1890ff;
font-weight: 600;
}
.active-line {
position: absolute;
bottom: 0;
left: 20px;
right: 20px;
height: 2px;
background-color: #1890ff;
}
/* 表格 */
.table-container {
display: flex;
flex-direction: column;
}
.table-header {
background-color: #f8f9fb;
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.th {
padding: 15px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.th-txt {
font-size: 14px;
font-weight: 600;
color: #909399;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
transition: background-color 0.3s;
}
.td {
padding: 15px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.td-txt {
font-size: 13px;
color: #606266;
}
/* 列宽分配 */
.col-order { width: 220px; justify-content: flex-start; padding-left: 20px; }
.col-amount { width: 120px; }
.col-type { width: 150px; }
.col-header { width: 120px; }
.col-time { width: 180px; }
.col-status-inv { width: 120px; }
.col-status-order { width: 120px; }
.col-ops { flex: 1; min-width: 140px; }
.text-left {
justify-content: flex-start;
}
.red-cell {
color: #f56c6c;
}
.ops-box {
display: flex;
flex-direction: row;
align-items: center;
}
.op-link {
font-size: 13px;
color: #1890ff;
cursor: pointer;
}
.sep {
font-size: 12px;
color: #ebeef5;
margin: 0 8px;
}
</style>

View File

@@ -0,0 +1,562 @@
<template>
<view class="finance-withdrawal">
<!-- 头部筛选区 -->
<view class="filter-card">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">时间选择:</text>
<input class="date-input" type="text" v-model="timeRangeText" placeholder="请选择时间范围" />
</view>
<view class="filter-item">
<text class="filter-label">提现状态:</text>
<picker mode="selector" :range="statusOptions" range-key="text" @change="statusChange">
<view class="picker-view">
<text>{{ statusLabel }}</text>
<text class="iconfont icon-arrow-down" style="font-size: 12px;"></text>
</view>
</picker>
</view>
<view class="filter-item">
<text class="filter-label">提现方式:</text>
<picker mode="selector" :range="methodOptions" range-key="text" @change="methodChange">
<view class="picker-view">
<text>{{ methodLabel }}</text>
<text class="iconfont icon-arrow-down" style="font-size: 12px;"></text>
</view>
</picker>
</view>
<view class="filter-item search-wrap">
<text class="filter-label">搜索:</text>
<input class="search-input" v-model="searchKeyword" placeholder="微信昵称/姓名/支付宝账号/银行卡号" />
</view>
<button class="btn-query" @click="handleQuery">查询</button>
</view>
</view>
<!-- 统计指标网格 -->
<view class="stats-grid">
<view class="stat-card" v-for="(item, index) in stats" :key="index">
<view class="icon-circle" :class="item.colorClass">
<text class="stat-icon">{{ item.icon }}</text>
</view>
<view class="stat-info">
<text class="stat-value">{{ item.value }}</text>
<text class="stat-label">{{ item.label }}</text>
</view>
</view>
</view>
<!-- 操作按钮区 -->
<view class="action-section">
<view class="btn-record">
<text class="btn-record-txt">佣金记录</text>
</view>
</view>
<!-- 数据表格 (使用 Flex 模拟以确保兼容性和精度) -->
<view class="table-container">
<view class="table-header">
<view class="th col-id"><text class="th-txt">ID</text></view>
<view class="th col-user"><text class="th-txt">用户信息</text></view>
<view class="th col-amount"><text class="th-txt">提现金额</text></view>
<view class="th col-fee"><text class="th-txt">提现手续费</text></view>
<view class="th col-net"><text class="th-txt">到账金额</text></view>
<view class="th col-method"><text class="th-txt">提现方式</text></view>
<view class="th col-qr"><text class="th-txt">收款码</text></view>
<view class="th col-time"><text class="th-txt">申请时间</text></view>
<view class="th col-remark"><text class="th-txt">备注</text></view>
<view class="th col-status"><text class="th-txt">审核状态</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view class="table-row" v-for="(item, index) in pagedList" :key="item.id">
<view class="td col-id"><text class="td-txt">{{ item.id }}</text></view>
<view class="td col-user">
<view class="user-info-box">
<view class="avatar-box">
<text class="avatar-placeholder">U</text>
</view>
<view class="user-detail">
<text class="user-nickname">{{ item.nickname }}</text>
<text class="user-id">用户id:{{ item.userId }}</text>
</view>
</view>
</view>
<view class="td col-amount"><text class="td-txt">{{ item.amount }}</text></view>
<view class="td col-fee"><text class="td-txt">{{ item.fee }}</text></view>
<view class="td col-net"><text class="td-txt green-txt">{{ item.netAmount }}</text></view>
<view class="td col-method">
<view class="method-box">
<text class="m-line">姓名:{{ item.name }}</text>
<text class="m-line">{{ item.type }}:{{ item.account }}</text>
<text v-if="item.bank" class="m-line">银行开户地址:{{ item.bank }}</text>
</view>
</view>
<view class="td col-qr">
<view class="qr-box" v-if="item.id === 57">
<text class="qr-icon-txt">■</text>
</view>
</view>
<view class="td col-time"><text class="td-txt">{{ item.time }}</text></view>
<view class="td col-remark"><text class="td-txt">{{ item.remark || '' }}</text></view>
<view class="td col-status"><text class="td-txt">申请中</text></view>
<view class="td col-ops">
<view class="ops-box">
<text class="op-btn blue">编辑</text>
<text class="op-sep">|</text>
<text class="op-btn blue">通过</text>
<text class="op-sep">|</text>
<text class="op-btn blue">驳回</text>
</view>
</view>
</view>
</view>
</view>
<CommonPagination
v-if="total > 0"
:total="total"
:loading="false"
:currentPage="currentPage"
:pageSize="pageSize"
:pageSizeOptionLabels="pageSizeOptionLabels"
:pageSizeIndex="pageSizeIndex"
:visiblePages="visiblePages"
:totalPage="totalPage"
:jumpPageInput="jumpPageInput"
@page-size-change="handlePageSizeChange"
@page-change="handlePageChange"
@update:jumpPageInput="(val: string) => { jumpPageInput.value = val }"
@jump-page="handleJumpPage"
/>
</view>
</template>
<script setup lang="uts">
import { ref, computed } from 'vue'
import CommonPagination from '@/components/CommonPagination/CommonPagination.uvue'
const timeRange = ref([])
const timeRangeText = ref('')
const statusValue = ref('all')
const methodValue = ref('all')
const searchKeyword = ref('')
const statusOptions = ref([
{ value: 'all', text: '全部' },
{ value: '0', text: '待审核' },
{ value: '1', text: '已通过' },
{ value: '-1', text: '已驳回' }
])
const methodOptions = ref([
{ value: 'all', text: '全部' },
{ value: 'alipay', text: '支付宝' },
{ value: 'bank', text: '银行卡' },
{ value: 'weixin', text: '微信' }
])
const statusLabel = computed(() => {
const item = statusOptions.value.find((opt: any) => opt.value === statusValue.value)
return item ? item.text : '全部'
})
const methodLabel = computed(() => {
const item = methodOptions.value.find((opt: any) => opt.value === methodValue.value)
return item ? item.text : '全部'
})
const stats = ref([
{ label: '佣金总金额', value: '676809.25', icon: '$', colorClass: 'blue' },
{ label: '待提现金额', value: '71', icon: '¥', colorClass: 'orange' },
{ label: '已提现金额', value: '68879.25', icon: '$', colorClass: 'green' },
{ label: '未提现金额', value: '607930.00', icon: '¥', colorClass: 'pink' }
])
// ========== MOCK DATA START ==========
// TODO: 接真实接口时替换此处 tableData 为 fetchWithdrawalList() 调用
const tableData = ref([
{ id: 57, nickname: '用户昵称: 177****766', userId: '58837', amount: '20.00', fee: '0.00', netAmount: '20.00', name: '接口', type: '支付宝', account: '1195953899', time: '2025-10-24 16:04', remark: '' },
{ id: 56, nickname: '用户昵称: 测试员的', userId: '20695', amount: '1.00', fee: '0.00', netAmount: '1.00', name: '123', type: '银行卡', account: '4001231221', bank: '中国银行', time: '2025-07-04 15:11', remark: '' },
{ id: 55, nickname: '张小红', userId: '18340', amount: '50.00', fee: '0.50', netAmount: '49.50', name: '张小红', type: '微信', account: 'wx_zhangxh', time: '2025-06-20 10:22', remark: '' },
{ id: 54, nickname: '李大明', userId: '29501', amount: '200.00', fee: '2.00', netAmount: '198.00', name: '李大明', type: '支付宝', account: 'lidaming@qq.com', time: '2025-06-15 09:30', remark: '' },
{ id: 53, nickname: '王芳芳', userId: '32110', amount: '80.00', fee: '0.00', netAmount: '80.00', name: '王芳芳', type: '银行卡', account: '6200123456789', bank: '建设银行', time: '2025-06-10 14:55', remark: '' },
{ id: 52, nickname: '赵刚', userId: '44422', amount: '150.00', fee: '1.50', netAmount: '148.50', name: '赵刚', type: '支付宝', account: 'zhaogang@163.com', time: '2025-06-05 16:40', remark: '请尽快处理' },
{ id: 51, nickname: '陈小燕', userId: '55631', amount: '30.00', fee: '0.00', netAmount: '30.00', name: '陈小燕', type: '微信', account: 'wx_chenxy', time: '2025-05-28 11:15', remark: '' },
{ id: 50, nickname: '刘建军', userId: '61204', amount: '500.00', fee: '5.00', netAmount: '495.00', name: '刘建军', type: '银行卡', account: '6228480012345678', bank: '农业银行', time: '2025-05-20 08:00', remark: '' },
{ id: 49, nickname: '黄小兰', userId: '72890', amount: '25.00', fee: '0.00', netAmount: '25.00', name: '黄小兰', type: '支付宝', account: 'huangxl@sina.com', time: '2025-05-15 13:22', remark: '' },
{ id: 48, nickname: '周大伟', userId: '83456', amount: '100.00', fee: '1.00', netAmount: '99.00', name: '周大伟', type: '支付宝', account: 'zhoudw@gmail.com', time: '2025-05-10 17:30', remark: '' },
{ id: 47, nickname: '吴玲玲', userId: '91223', amount: '60.00', fee: '0.00', netAmount: '60.00', name: '吴玲玲', type: '微信', account: 'wx_wull', time: '2025-05-05 10:45', remark: '' },
{ id: 46, nickname: '郑明亮', userId: '10234', amount: '300.00', fee: '3.00', netAmount: '297.00', name: '郑明亮', type: '银行卡', account: '6217000012345', bank: '工商银行', time: '2025-04-28 09:00', remark: '' },
{ id: 45, nickname: '孙小丽', userId: '21345', amount: '45.00', fee: '0.00', netAmount: '45.00', name: '孙小丽', type: '支付宝', account: 'sunxl@aliyun.com', time: '2025-04-20 15:10', remark: '' },
{ id: 44, nickname: '冯浩', userId: '32456', amount: '88.00', fee: '0.88', netAmount: '87.12', name: '冯浩', type: '微信', account: 'wx_fenghao', time: '2025-04-15 11:30', remark: '' },
{ id: 43, nickname: '陈建国', userId: '43567', amount: '120.00', fee: '1.20', netAmount: '118.80', name: '陈建国', type: '支付宝', account: 'chenjg@hotmail.com', time: '2025-04-10 14:00', remark: '' },
{ id: 42, nickname: '蒋小娟', userId: '54678', amount: '75.00', fee: '0.00', netAmount: '75.00', name: '蒋小娟', type: '银行卡', account: '6225880099887766', bank: '招商银行', time: '2025-04-05 08:45', remark: '' },
{ id: 41, nickname: '卫东', userId: '65789', amount: '40.00', fee: '0.40', netAmount: '39.60', name: '卫东', type: '支付宝', account: 'weidong@126.com', time: '2025-03-28 16:20', remark: '' },
{ id: 40, nickname: '韩美丽', userId: '76890', amount: '250.00', fee: '2.50', netAmount: '247.50', name: '韩美丽', type: '微信', account: 'wx_hanml', time: '2025-03-20 10:00', remark: '' },
{ id: 39, nickname: '杨志远', userId: '87901', amount: '16.00', fee: '0.00', netAmount: '16.00', name: '杨志远', type: '银行卡', account: '6228001234567890', bank: '中国银行', time: '2025-03-15 12:35', remark: '' },
{ id: 38, nickname: '秦晓', userId: '98012', amount: '180.00', fee: '1.80', netAmount: '178.20', name: '秦晓', type: '支付宝', account: 'qinxiao@vip.qq.com', time: '2025-03-10 09:50', remark: '' },
])
// ========== MOCK DATA END ==========
// ========== PAGINATION STATE ==========
const currentPage = ref(1)
const pageSize = ref(15)
const jumpPageInput = ref('')
const pageSizeOptions = [10, 15, 20, 30, 50]
const pageSizeOptionLabels = computed(() => pageSizeOptions.map((n: number) => `${n}条/页`))
const pageSizeIndex = computed(() => { const idx = pageSizeOptions.indexOf(pageSize.value); return idx >= 0 ? idx : 0 })
const total = computed(() => tableData.value.length)
const totalPage = computed(() => Math.max(1, Math.ceil(total.value / pageSize.value)))
const pagedList = computed(() => {
const start = (currentPage.value - 1) * pageSize.value
return tableData.value.slice(start, start + pageSize.value)
})
const visiblePages = computed((): number[] => {
const t = totalPage.value; const cur = currentPage.value
if (t <= 7) return Array.from({ length: t }, (_: any, i: number) => i + 1)
if (cur <= 4) return [1, 2, 3, 4, 5, -1, t]
if (cur >= t - 3) return [1, -1, t - 4, t - 3, t - 2, t - 1, t]
return [1, -1, cur - 1, cur, cur + 1, -1, t]
})
const handlePageChange = (p: number) => { currentPage.value = p }
const handlePageSizeChange = (e: any) => {
const idx = Number(e.detail.value)
pageSize.value = pageSizeOptions[idx] ?? pageSizeOptions[0]
currentPage.value = 1
}
const handleJumpPage = () => {
const p = parseInt(jumpPageInput.value)
if (!isNaN(p) && p >= 1 && p <= totalPage.value) currentPage.value = p
}
// ========== END PAGINATION STATE ==========
const statusChange = (e: any) => {
statusValue.value = statusOptions.value[e.detail.value].value
}
const methodChange = (e: any) => {
methodValue.value = methodOptions.value[e.detail.value].value
}
const handleQuery = () => {
console.log('Query with:', statusValue.value, methodValue.value, searchKeyword.value)
}
</script>
<style scoped lang="scss">
.finance-withdrawal {
padding: 0;
background-color: transparent;
min-height: auto;
}
/* 筛选样式更新 */
.filter-card {
background-color: #fff;
padding: 24px;
border-radius: 4px;
margin-bottom: 20px;
}
.filter-row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
}
.filter-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 24px;
margin-bottom: 16px;
}
.filter-label {
font-size: 14px;
color: #606266;
margin-right: 12px;
white-space: nowrap;
}
.date-input {
width: 260px;
height: 32px;
padding: 0 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
}
.picker-view {
width: 140px;
height: 32px;
padding: 0 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
font-size: 14px;
}
.search-wrap {
flex: 1;
min-width: 320px;
}
.search-input {
flex: 1;
height: 32px;
padding: 0 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
}
.btn-query {
background-color: #1890ff;
color: #fff;
font-size: 14px;
height: 36px;
line-height: 36px;
padding: 0 24px;
border-radius: 4px;
border: none;
margin-bottom: 16px;
}
/* 统计卡片样式 */
.stats-grid {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20px;
}
.stat-card {
width: 24%;
background-color: #fff;
padding: 24px 20px;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
box-shadow: 0 2px 12px 0 rgba(0,0,0,0.05);
}
.icon-circle {
width: 52px;
height: 52px;
border-radius: 26px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16px;
}
.blue { background-color: #e6f7ff; color: #1890ff; }
.orange { background-color: #fff7e1; color: #fa8c16; }
.green { background-color: #f6ffed; color: #52c41a; }
.pink { background-color: #fff0f6; color: #eb2f96; }
.stat-icon { font-size: 24px; font-weight: bold; }
.stat-info {
display: flex;
flex-direction: column;
}
.stat-value {
font-size: 22px;
font-weight: 700;
color: #303133;
line-height: 1.1;
}
.stat-label {
font-size: 13px;
color: #909399;
margin-top: 6px;
}
/* 操作区域 */
.action-section {
margin-bottom: 12px;
display: flex;
flex-direction: row;
}
.btn-record {
background-color: #1890ff;
border-radius: 4px;
padding: 6px 16px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-record-txt {
color: #fff;
font-size: 13px;
}
/* 表格容器样式 (Flex 模拟) */
.table-container {
background-color: #fff;
border-radius: 4px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.table-header {
background-color: #f8f9fb;
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.th {
padding: 12px 8px;
display: flex;
align-items: center;
justify-content: center;
}
.th-txt {
font-size: 14px;
font-weight: 600;
color: #909399;
}
.table-body {
display: flex;
flex-direction: column;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.td {
padding: 12px 8px;
display: flex;
align-items: center;
justify-content: center;
}
.td-txt {
font-size: 13px;
color: #606266;
}
/* 列宽定义 (与截图匹配) */
.col-id { width: 60px; }
.col-user { width: 180px; justify-content: flex-start; }
.col-amount { width: 100px; }
.col-fee { width: 100px; }
.col-net { width: 100px; }
.col-method { flex: 1; min-width: 220px; justify-content: flex-start; }
.col-qr { width: 80px; }
.col-time { width: 150px; }
.col-remark { width: 80px; }
.col-status { width: 100px; }
.col-ops { width: 160px; }
/* 用户信息单元格 */
.user-info-box {
display: flex;
flex-direction: row;
align-items: center;
}
.avatar-box {
width: 32px;
height: 32px;
border-radius: 16px;
background-color: #f0f2f5;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.avatar-placeholder {
font-size: 14px;
color: #999;
}
.user-detail {
display: flex;
flex-direction: column;
}
.user-nickname {
font-size: 13px;
color: #303133;
margin-bottom: 2px;
}
.user-id {
font-size: 11px;
color: #909399;
}
/* 提现方式单元格 */
.method-box {
display: flex;
flex-direction: column;
}
.m-line {
font-size: 12px;
color: #666;
margin-bottom: 2px;
}
.green-txt {
color: #52c41a;
font-weight: 600;
}
/* 收款码 */
.qr-box {
width: 40px;
height: 40px;
background-color: #1a1a1a;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.qr-icon-txt {
color: #fff;
font-size: 16px;
}
/* 操作项 */
.ops-box {
display: flex;
flex-direction: row;
align-items: center;
}
.op-btn {
font-size: 13px;
margin: 0 4px;
}
.blue { color: #1890ff; }
.op-sep {
color: #ebeef5;
font-size: 12px;
}
</style>

View File

@@ -1,55 +0,0 @@
.page-container {
padding: 20px;
min-height: 100vh;
background: #f5f5f5;
}
.page-header {
margin-bottom: 20px;
}
.page-title {
display: block;
font-size: 24px;
font-weight: 600;
color: #333;
margin-bottom: 8px;
}
.page-subtitle {
display: block;
font-size: 14px;
color: #999;
}
.page-content {
background: #fff;
border-radius: 4px;
padding: 24px;
}
.placeholder-card {
text-align: center;
padding: 60px 20px;
}
.placeholder-title {
display: block;
font-size: 18px;
font-weight: 600;
color: #666;
margin-bottom: 12px;
}
.placeholder-desc {
display: block;
font-size: 14px;
color: #999;
margin-bottom: 8px;
}
.placeholder-info {
display: block;
font-size: 12px;
color: #1890ff;
}

View File

@@ -4,10 +4,10 @@
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">时间筛选:</text>
<text class="filter-label">创建时间:</text>
<view class="date-picker-wrap">
<text class="calendar-icon">📅</text>
<text class="date-placeholder">最近30天</text>
<text class="date-placeholder">开始日期 - 结束日期</text>
</view>
</view>
</view>
@@ -17,45 +17,36 @@
<view class="content-card border-shadow">
<!-- 汇总选项卡 -->
<view class="tab-header">
<view
v-for="(item, index) in intervalOptions"
:key="index"
:class="['tab-item', currentTab === index ? 'active' : '']"
@click="handleTabChange(index)"
>
<text :class="['tab-txt', currentTab === index ? 'active-txt' : '']">{{ item.label }}</text>
</view>
<view class="tab-item active"><text class="tab-txt active-txt">日账单</text></view>
<view class="tab-item"><text class="tab-txt">周账单</text></view>
<view class="tab-item"><text class="tab-txt">月账单</text></view>
</view>
<!-- 表格区域 -->
<view class="table-container">
<view class="table-header">
<view class="th col-id"><text class="th-txt">序号</text></view>
<view class="th col-title"><text class="th-txt">账单周期</text></view>
<view class="th col-date"><text class="th-txt">具体日期/周期</text></view>
<view class="th col-id"><text class="th-txt">ID</text></view>
<view class="th col-title"><text class="th-txt">标题</text></view>
<view class="th col-date"><text class="th-txt">期</text></view>
<view class="th col-income"><text class="th-txt">收入金额</text></view>
<view class="th col-expense"><text class="th-txt">支出金额</text></view>
<view class="th col-entry"><text class="th-txt">入账</text></view>
<view class="th col-entry"><text class="th-txt">入账金额</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view v-if="loading" class="table-loading" style="padding: 40px; text-align: center;">
<text>加载中...</text>
</view>
<view v-else-if="tableData.length === 0" class="table-empty" style="padding: 40px; text-align: center;">
<text>暂无账单数据</text>
</view>
<view v-else class="table-row" v-for="(item, index) in tableData" :key="index">
<view class="td col-id"><text class="td-txt">{{ index + 1 }}</text></view>
<view class="td col-title text-left"><text class="td-txt">{{ intervalOptions[currentTab].label }}</text></view>
<view class="td col-date"><text class="td-txt">{{ item.date_group }}</text></view>
<view class="td col-income"><text class="td-txt red-txt">¥{{ item.income.toFixed(2) }}</text></view>
<view class="td col-expense"><text class="td-txt green-txt">¥{{ item.expense.toFixed(2) }}</text></view>
<view class="td col-entry"><text class="td-txt">¥{{ item.net_entry.toFixed(2) }}</text></view>
<view class="table-row" v-for="item in tableData" :key="item.id">
<view class="td col-id"><text class="td-txt">{{ item.id }}</text></view>
<view class="td col-title text-left"><text class="td-txt">{{ item.title }}</text></view>
<view class="td col-date"><text class="td-txt">{{ item.date }}</text></view>
<view class="td col-income"><text class="td-txt red-txt">¥{{ item.income }}</text></view>
<view class="td col-expense"><text class="td-txt green-txt">¥{{ item.expense }}</text></view>
<view class="td col-entry"><text class="td-txt">¥{{ item.entry }}</text></view>
<view class="td col-ops">
<view class="ops-wrap">
<text class="op-link">查看流水</text>
<text class="op-link">账单详情</text>
<text class="op-divider">|</text>
<text class="op-link">下载</text>
</view>
</view>
</view>
@@ -66,53 +57,36 @@
</template>
<script setup lang="uts">
import { ref, onMounted } from 'vue'
import { fetchFinanceBillSummary } from '@/services/admin/financeService.uts'
import { ref } from 'vue'
const currentTab = ref(0)
const loading = ref(false)
const tableData = ref<any[]>([])
const intervalOptions = [
{ label: '日账单', value: 'day' },
{ label: '周账单', value: 'week' },
{ label: '月账单', value: 'month' }
]
async function loadData() {
loading.value = true
const endTime = new Date().toISOString()
const startTime = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() // 默认查最近90天
try {
const res = await fetchFinanceBillSummary(
startTime,
endTime,
intervalOptions[currentTab.value].value
)
tableData.value = res
} catch (e) {
uni.showToast({ title: '加载账单失败', icon: 'none' })
} finally {
loading.value = false
}
interface BillSumRecord {
id: number
title: string
date: string
income: string
expense: string
entry: string
}
onMounted(() => {
loadData()
})
const handleTabChange = (index : number) => {
currentTab.value = index
loadData()
}
const tableData = ref<BillSumRecord[]>([
{ id: 1, title: '日账单', date: '2026-02-03', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 2, title: '日账单', date: '2026-02-01', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 3, title: '日账单', date: '2026-01-30', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 4, title: '日账单', date: '2026-01-29', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 5, title: '日账单', date: '2026-01-28', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 6, title: '日账单', date: '2026-01-27', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 7, title: '日账单', date: '2026-01-26', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 8, title: '日账单', date: '2026-01-25', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 9, title: '日账单', date: '2026-01-23', income: '0.00', expense: '0.00', entry: '0.00' },
{ id: 10, title: '日账单', date: '2026-01-22', income: '0.00', expense: '0.00', entry: '0.00' }
])
</script>
<style scoped lang="scss">
.finance-bill {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
padding: 0;
background-color: transparent;
min-height: auto;
}
.border-shadow {
@@ -213,7 +187,7 @@ const handleTabChange = (index : number) => {
}
.table-header {
background-color: #e6f0ff;
background-color: #e6f0ff; /* 对应截图的淡蓝色背景 */
display: flex;
flex-direction: row;
}
@@ -253,6 +227,7 @@ const handleTabChange = (index : number) => {
color: #606266;
}
/* 列宽分配 */
.col-id { width: 80px; }
.col-title { width: 150px; }
.col-date { width: 220px; }
@@ -265,14 +240,16 @@ const handleTabChange = (index : number) => {
justify-content: flex-start;
}
/* 颜色 */
.red-txt {
color: #f5222d;
color: #f5222d; /* 收入红色 */
}
.green-txt {
color: #52c41a;
color: #52c41a; /* 支出绿色 */
}
/* 操作项 */
.ops-wrap {
display: flex;
flex-direction: row;
@@ -284,4 +261,10 @@ const handleTabChange = (index : number) => {
color: #1890ff;
cursor: pointer;
}
.op-divider {
margin: 0 8px;
color: #e8e8e8;
font-size: 12px;
}
</style>

View File

@@ -0,0 +1,378 @@
<template>
<view class="finance-capital-flow">
<!-- 头部筛选区 -->
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">订单时间:</text>
<view class="date-picker-wrap">
<text class="calendar-icon">📅</text>
<text class="date-placeholder">开始日期 - 结束日期</text>
</view>
</view>
<view class="filter-item">
<text class="filter-label">交易类型:</text>
<view class="select-box">
<text class="select-txt">请选择</text>
<text class="arrow-down">▼</text>
</view>
</view>
<view class="filter-item search-wrap">
<text class="filter-label">流水搜索:</text>
<input class="search-input" placeholder="订单号/昵称/电话/用户ID" />
</view>
<view class="btn-query">
<text class="btn-txt">查询</text>
</view>
</view>
</view>
<!-- 数据表格 (Flex 模拟) -->
<view class="table-container border-shadow">
<view class="table-header">
<view class="th col-flow"><text class="th-txt">交易单号</text></view>
<view class="th col-order"><text class="th-txt">关联订单</text></view>
<view class="th col-time"><text class="th-txt">交易时间</text></view>
<view class="th col-amount"><text class="th-txt">交易金额</text></view>
<view class="th col-user"><text class="th-txt">交易用户</text></view>
<view class="th col-method"><text class="th-txt">支付方式</text></view>
<view class="th col-remark"><text class="th-txt">备注</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view class="table-row" v-for="item in pagedList" :key="item.flowNo">
<view class="td col-flow"><text class="td-txt">{{ item.flowNo }}</text></view>
<view class="td col-order text-left"><text class="td-txt">{{ item.orderNo }}</text></view>
<view class="td col-time"><text class="td-txt">{{ item.time }}</text></view>
<view class="td col-amount"><text class="td-txt red-txt">{{ item.amount }}</text></view>
<view class="td col-user"><text class="td-txt">{{ item.user }}</text></view>
<view class="td col-method"><text class="td-txt">{{ item.method }}</text></view>
<view class="td col-remark"><text class="td-txt">{{ item.remark }}</text></view>
<view class="td col-ops">
<text class="op-link">备注</text>
</view>
</view>
</view>
</view>
<CommonPagination
v-if="true"
:total="total"
:loading="false"
:currentPage="currentPage"
:pageSize="pageSize"
:pageSizeOptionLabels="pageSizeOptionLabels"
:pageSizeIndex="pageSizeIndex"
:visiblePages="visiblePages"
:totalPage="totalPage"
:jumpPageInput="jumpPageInput"
@page-size-change="handlePageSizeChange"
@page-change="handlePageChange"
@update:jumpPageInput="(val: string) => { jumpPageInput.value = val }"
@jump-page="handleJumpPage"
/>
</view>
</template>
<script setup lang="uts">
import { ref, computed } from 'vue'
import CommonPagination from '@/components/CommonPagination/CommonPagination.uvue'
interface FlowRecord {
flowNo: string
orderNo: string
time: string
amount: string
user: string
method: string
remark: string
}
const tableData = ref<FlowRecord[]>([
{
flowNo: 'ZJ202602031258428744',
orderNo: 'hy541422245264752640',
time: '2026-02-03 00:58:42',
amount: '+0.00',
user: 'J.',
method: '微信',
remark: ''
},
{
flowNo: 'ZJ202602011056592117',
orderNo: 'hy541029224517992448',
time: '2026-02-01 22:56:59',
amount: '+0.00',
user: 'dev 王鑫',
method: '微信',
remark: ''
},
{
flowNo: 'ZJ202602010513443817',
orderNo: 'hy540942844546777088',
time: '2026-02-01 17:13:44',
amount: '+0.00',
user: 'Sunshine',
method: '微信',
remark: ''
},
{
flowNo: 'ZJ202602010127248683',
orderNo: 'hy540885887420989440',
time: '2026-02-01 13:27:24',
amount: '+0.00',
user: '132****8769',
method: '微信',
remark: ''
},
{
flowNo: 'ZJ202602011215407366',
orderNo: 'hy540686639874179072',
time: '2026-02-01 00:15:40',
amount: '+0.00',
user: '177****9187',
method: '微信',
remark: ''
},
{
flowNo: 'ZJ202601301026512881',
orderNo: 'hy540296867267739648',
time: '2026-01-30 22:26:51',
amount: '+0.00',
user: '暂未成功人士',
method: '微信',
remark: ''
},
{
flowNo: 'ZJ202601300534267557',
orderNo: 'hy540223279126806528',
time: '2026-01-30 17:34:26',
amount: '+0.00',
user: 'b342865d2077',
method: '微信',
remark: ''
},
{ flowNo: 'ZJ202601290823456789', orderNo: 'hy539987654321234567', time: '2026-01-29 08:23:45', amount: '+88.00', user: '张小明', method: '支付宝', remark: '' },
{ flowNo: 'ZJ202601281534267890', orderNo: 'hy539765432109876543', time: '2026-01-28 15:34:26', amount: '+200.00', user: '王芳芳', method: '微信', remark: '' },
{ flowNo: 'ZJ202601270945123450', orderNo: 'hy539543210987654321', time: '2026-01-27 09:45:12', amount: '-50.00', user: '李建国', method: '余额', remark: '退款' },
{ flowNo: 'ZJ202601261200345678', orderNo: 'hy539321098765432109', time: '2026-01-26 12:00:34', amount: '+150.00', user: 'Tom Wang', method: '支付宝', remark: '' },
{ flowNo: 'ZJ202601251756890123', orderNo: 'hy539098765432109876', time: '2026-01-25 17:56:08', amount: '+30.00', user: '赵小燕', method: '微信', remark: '' },
{ flowNo: 'ZJ202601240314567890', orderNo: 'hy538876543210987654', time: '2026-01-24 03:14:56', amount: '+500.00', user: '陈大伟', method: '微信', remark: '' },
{ flowNo: 'ZJ202601231023456789', orderNo: 'hy538654321098765432', time: '2026-01-23 10:23:45', amount: '+1000.00', user: '周总', method: '支付宝', remark: '' },
{ flowNo: 'ZJ202601221445678901', orderNo: 'hy538432109876543210', time: '2026-01-22 14:45:06', amount: '-20.00', user: '刘小丽', method: '余额', remark: '佣金提现' },
{ flowNo: 'ZJ202601210856789012', orderNo: 'hy538209876543210987', time: '2026-01-21 08:56:07', amount: '+75.00', user: '黄志强', method: '微信', remark: '' },
{ flowNo: 'ZJ202601201234567890', orderNo: 'hy537987654321098765', time: '2026-01-20 12:34:56', amount: '+320.00', user: '吴晓东', method: '支付宝', remark: '' },
{ flowNo: 'ZJ202601191634234567', orderNo: 'hy537765432109876543', time: '2026-01-19 16:34:23', amount: '+65.00', user: '郑美华', method: '微信', remark: '' },
{ flowNo: 'ZJ202601181034567890', orderNo: 'hy537543210987654321', time: '2026-01-18 10:34:56', amount: '+128.00', user: '孙小峰', method: '微信', remark: '' }
])
// ========== PAGINATION STATE ==========
const currentPage = ref(1)
const pageSize = ref(15)
const jumpPageInput = ref('')
const pageSizeOptions = [10, 15, 20, 30, 50]
const pageSizeOptionLabels = computed(() => pageSizeOptions.map((n: number) => `${n}条/页`))
const pageSizeIndex = computed(() => { const idx = pageSizeOptions.indexOf(pageSize.value); return idx >= 0 ? idx : 0 })
const total = computed(() => tableData.value.length)
const totalPage = computed(() => Math.max(1, Math.ceil(total.value / pageSize.value)))
const pagedList = computed(() => {
const start = (currentPage.value - 1) * pageSize.value
return tableData.value.slice(start, start + pageSize.value)
})
const visiblePages = computed((): number[] => {
const t = totalPage.value; const cur = currentPage.value
if (t <= 7) return Array.from({ length: t }, (_: any, i: number) => i + 1)
if (cur <= 4) return [1, 2, 3, 4, 5, -1, t]
if (cur >= t - 3) return [1, -1, t - 4, t - 3, t - 2, t - 1, t]
return [1, -1, cur - 1, cur, cur + 1, -1, t]
})
const handlePageChange = (p: number) => { currentPage.value = p }
const handlePageSizeChange = (e: any) => {
const idx = Number(e.detail.value)
pageSize.value = pageSizeOptions[idx] ?? pageSizeOptions[0]
currentPage.value = 1
}
const handleJumpPage = () => {
const p = parseInt(jumpPageInput.value)
if (!isNaN(p) && p >= 1 && p <= totalPage.value) currentPage.value = p
}
// ========== END PAGINATION STATE ==========
</script>
<style scoped lang="scss">
.finance-capital-flow {
padding: 0;
background-color: transparent;
min-height: auto;
}
.border-shadow {
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 筛选卡片 */
.filter-card {
padding: 20px 24px;
margin-bottom: 20px;
}
.filter-row {
display: flex;
flex-direction: row;
align-items: center;
}
.filter-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 28px;
}
.filter-label {
font-size: 14px;
color: #333;
margin-right: 10px;
white-space: nowrap;
}
.date-picker-wrap {
width: 220px;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 12px;
}
.calendar-icon {
font-size: 12px;
margin-right: 8px;
}
.date-placeholder {
font-size: 13px;
color: #c0c4cc;
}
.select-box {
width: 200px;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 12px;
}
.select-txt {
font-size: 13px;
color: #606266;
}
.arrow-down {
font-size: 8px;
color: #c0c4cc;
}
.search-wrap {
flex: 1;
}
.search-input {
flex: 1;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 0 12px;
font-size: 13px;
}
.btn-query {
background-color: #1890ff;
border-radius: 4px;
height: 32px;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: center;
margin-left: 10px;
}
.btn-txt {
color: #fff;
font-size: 14px;
}
/* 表格 */
.table-container {
display: flex;
flex-direction: column;
}
.table-header {
background-color: #f8f9fb;
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.th {
padding: 15px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.th-txt {
font-size: 14px;
font-weight: 600;
color: #909399;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.td {
padding: 15px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.td-txt {
font-size: 13px;
color: #606266;
}
.col-flow { width: 200px; }
.col-order { width: 220px; }
.col-time { width: 180px; }
.col-amount { width: 120px; }
.col-user { width: 150px; }
.col-method { width: 120px; }
.col-remark { flex: 1; min-width: 100px; }
.col-ops { width: 100px; }
.text-left {
justify-content: flex-start;
}
.red-txt {
color: #f56c6c;
}
.op-link {
font-size: 13px;
color: #1890ff;
}
</style>

View File

@@ -0,0 +1,489 @@
<template>
<view class="finance-recharge">
<!-- 头部筛选区 -->
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">时间选择:</text>
<view class="date-picker-wrap">
<text class="calendar-icon">📅</text>
<text class="date-placeholder">开始日期 - 结束日期</text>
</view>
</view>
<view class="filter-item">
<text class="filter-label">支付类型:</text>
<view class="select-box">
<text class="select-txt">全部</text>
<text class="arrow-down">▼</text>
</view>
</view>
<view class="filter-item search-wrap">
<text class="filter-label">搜索:</text>
<input class="search-input" placeholder="请输入用户昵称、订单号" />
</view>
<view class="btn-query">
<text class="btn-txt">查询</text>
</view>
</view>
</view>
<!-- 统计网格 -->
<view class="stats-grid">
<view class="stat-card border-shadow" v-for="(item, index) in stats" :key="index">
<view class="icon-circle" :class="item.colorClass">
<text class="stat-icon">{{ item.icon }}</text>
</view>
<view class="stat-info">
<text class="stat-value">{{ item.value }}</text>
<text class="stat-label">{{ item.label }}</text>
</view>
</view>
</view>
<!-- 操作区域 -->
<view class="action-section">
<view class="btn-export">
<text class="btn-export-txt">导出</text>
</view>
</view>
<!-- 数据表格 (Flex 模拟) -->
<view class="table-container border-shadow">
<view class="table-header">
<view class="th col-id"><text class="th-txt">ID</text></view>
<view class="th col-avatar"><text class="th-txt">头像</text></view>
<view class="th col-nickname"><text class="th-txt">用户昵称</text></view>
<view class="th col-orderno"><text class="th-txt">订单号</text></view>
<view class="th col-amount"><text class="th-txt">支付金额</text></view>
<view class="th col-paid"><text class="th-txt">是否支付</text></view>
<view class="th col-type"><text class="th-txt">充值类型</text></view>
<view class="th col-time"><text class="th-txt">支付时间</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view class="table-row" v-for="item in pagedList" :key="item.id">
<view class="td col-id"><text class="td-txt">{{ item.id }}</text></view>
<view class="td col-avatar">
<view class="avatar-box">
<text class="avatar-placeholder" v-if="!item.hasAvatar">🖼️</text>
<view class="avatar-img-mock" v-else></view>
</view>
</view>
<view class="td col-nickname"><text class="td-txt">{{ item.nickname }}</text></view>
<view class="td col-orderno"><text class="td-txt">{{ item.orderNo }}</text></view>
<view class="td col-amount"><text class="td-txt">{{ item.amount }}</text></view>
<view class="td col-paid"><text class="td-txt">{{ item.isPaid }}</text></view>
<view class="td col-type"><text class="td-txt">{{ item.type }}</text></view>
<view class="td col-time"><text class="td-txt">{{ item.time }}</text></view>
<view class="td col-ops">
<text class="op-link">删除</text>
</view>
</view>
</view>
</view>
<CommonPagination
v-if="true"
:total="total"
:loading="false"
:currentPage="currentPage"
:pageSize="pageSize"
:pageSizeOptionLabels="pageSizeOptionLabels"
:pageSizeIndex="pageSizeIndex"
:visiblePages="visiblePages"
:totalPage="totalPage"
:jumpPageInput="jumpPageInput"
@page-size-change="handlePageSizeChange"
@page-change="handlePageChange"
@update:jumpPageInput="(val: string) => { jumpPageInput.value = val }"
@jump-page="handleJumpPage"
/>
</view>
</template>
<script setup lang="uts">
import { ref, computed } from 'vue'
import CommonPagination from '@/components/CommonPagination/CommonPagination.uvue'
const stats = ref([
{ label: '充值总金额', value: '446747490.72', icon: '¥', colorClass: 'blue' },
{ label: '充值退款金额', value: '1.19', icon: '¥', colorClass: 'orange' },
{ label: '支付宝充值金额', value: '78812.24', icon: '支', colorClass: 'green' },
{ label: '微信充值金额', value: '8518075.11', icon: '✔', colorClass: 'pink' }
])
interface RechargeRecord {
id: number
hasAvatar: boolean
nickname: string
orderNo: string
amount: string
isPaid: string
type: string
time: string
}
const tableData = ref<RechargeRecord[]>([
{
id: 4522,
hasAvatar: true,
nickname: 'TTA NW',
orderNo: 'cz540603403592531968',
amount: '10.00',
isPaid: '未支付',
type: '微信充值',
time: '暂无'
},
{
id: 4521,
hasAvatar: true,
nickname: 'TTA NW',
orderNo: 'cz540592008763277312',
amount: '3343.00',
isPaid: '未支付',
type: '微信充值',
time: '暂无'
},
{
id: 4520,
hasAvatar: true,
nickname: '绯',
orderNo: 'cz538561368400330752',
amount: '500.00',
isPaid: '未支付',
type: '支付宝充值',
time: '暂无'
},
{
id: 4519,
hasAvatar: false,
nickname: '六六狗',
orderNo: 'cz538368229429477376',
amount: '50.00',
isPaid: '未支付',
type: '微信充值',
time: '暂无'
},
{
id: 4518,
hasAvatar: false,
nickname: 'aabbc',
orderNo: 'cz538165303901683712',
amount: '10.00',
isPaid: '未支付',
type: '其他充值',
time: '暂无'
},
{ id: 4517, hasAvatar: true, nickname: '张小红', orderNo: 'cz518000000001234567', amount: '100.00', isPaid: '已支付', type: '微信充值', time: '2025-06-20 10:22' },
{ id: 4516, hasAvatar: false, nickname: '李大明', orderNo: 'cz517900000001234567', amount: '50.00', isPaid: '已支付', type: '支付宝充值', time: '2025-06-15 09:30' },
{ id: 4515, hasAvatar: true, nickname: '王建国', orderNo: 'cz517800000001234567', amount: '200.00', isPaid: '已支付', type: '微信充值', time: '2025-06-10 14:55' },
{ id: 4514, hasAvatar: false, nickname: '刘晓燕', orderNo: 'cz517700000001234567', amount: '30.00', isPaid: '已支付', type: '支付宝充值', time: '2025-06-05 11:22' },
{ id: 4513, hasAvatar: true, nickname: 'BoBo', orderNo: 'cz517600000001234567', amount: '1000.00', isPaid: '已支付', type: '微信充值', time: '2025-05-28 08:00' },
{ id: 4512, hasAvatar: false, nickname: '陈小华', orderNo: 'cz517500000001234567', amount: '20.00', isPaid: '未支付', type: '其他充值', time: '暂无' },
{ id: 4511, hasAvatar: true, nickname: '周伟', orderNo: 'cz517400000001234567', amount: '500.00', isPaid: '已支付', type: '支付宝充值', time: '2025-05-20 16:30' },
{ id: 4510, hasAvatar: false, nickname: '吴晓梅', orderNo: 'cz517300000001234567', amount: '150.00', isPaid: '已支付', type: '微信充值', time: '2025-05-15 10:11' },
{ id: 4509, hasAvatar: true, nickname: '郑浩', orderNo: 'cz517200000001234567', amount: '88.00', isPaid: '已支付', type: '微信充值', time: '2025-05-10 09:45' },
{ id: 4508, hasAvatar: false, nickname: '黄丽丽', orderNo: 'cz517100000001234567', amount: '300.00', isPaid: '已支付', type: '支付宝充值', time: '2025-05-05 14:22', hasAvatar: false },
{ id: 4507, hasAvatar: true, nickname: 'Super User', orderNo: 'cz517000000001234567', amount: '999.00', isPaid: '已支付', type: '微信充值', time: '2025-04-28 11:30' },
{ id: 4506, hasAvatar: false, nickname: '孙国强', orderNo: 'cz516900000001234567', amount: '45.00', isPaid: '未支付', type: '其他充值', time: '暂无' },
{ id: 4505, hasAvatar: true, nickname: '赵小燕', orderNo: 'cz516800000001234567', amount: '600.00', isPaid: '已支付', type: '支付宝充值', time: '2025-04-20 09:00' },
{ id: 4504, hasAvatar: false, nickname: '钱大虎', orderNo: 'cz516700000001234567', amount: '75.00', isPaid: '已支付', type: '微信充值', time: '2025-04-15 15:40' },
{ id: 4503, hasAvatar: true, nickname: '李明明', orderNo: 'cz516600000001234567', amount: '250.00', isPaid: '已支付', type: '微信充值', time: '2025-04-10 13:25' }
])
// ========== PAGINATION STATE ==========
const currentPage = ref(1)
const pageSize = ref(15)
const jumpPageInput = ref('')
const pageSizeOptions = [10, 15, 20, 30, 50]
const pageSizeOptionLabels = computed(() => pageSizeOptions.map((n: number) => `${n}条/页`))
const pageSizeIndex = computed(() => { const idx = pageSizeOptions.indexOf(pageSize.value); return idx >= 0 ? idx : 0 })
const total = computed(() => tableData.value.length)
const totalPage = computed(() => Math.max(1, Math.ceil(total.value / pageSize.value)))
const pagedList = computed(() => {
const start = (currentPage.value - 1) * pageSize.value
return tableData.value.slice(start, start + pageSize.value)
})
const visiblePages = computed((): number[] => {
const t = totalPage.value; const cur = currentPage.value
if (t <= 7) return Array.from({ length: t }, (_: any, i: number) => i + 1)
if (cur <= 4) return [1, 2, 3, 4, 5, -1, t]
if (cur >= t - 3) return [1, -1, t - 4, t - 3, t - 2, t - 1, t]
return [1, -1, cur - 1, cur, cur + 1, -1, t]
})
const handlePageChange = (p: number) => { currentPage.value = p }
const handlePageSizeChange = (e: any) => {
const idx = Number(e.detail.value)
pageSize.value = pageSizeOptions[idx] ?? pageSizeOptions[0]
currentPage.value = 1
}
const handleJumpPage = () => {
const p = parseInt(jumpPageInput.value)
if (!isNaN(p) && p >= 1 && p <= totalPage.value) currentPage.value = p
}
// ========== END PAGINATION STATE ==========
</script>
<style scoped lang="scss">
.finance-recharge {
padding: 0;
background-color: transparent;
min-height: auto;
}
.border-shadow {
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 筛选卡片 */
.filter-card {
padding: 20px 24px;
margin-bottom: 20px;
}
.filter-row {
display: flex;
flex-direction: row;
align-items: center;
}
.filter-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 28px;
}
.filter-label {
font-size: 14px;
color: #333;
margin-right: 10px;
white-space: nowrap;
}
.date-picker-wrap {
width: 220px;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 12px;
}
.calendar-icon {
font-size: 12px;
margin-right: 8px;
}
.date-placeholder {
font-size: 13px;
color: #c0c4cc;
}
.select-box {
width: 160px;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 12px;
}
.select-txt {
font-size: 13px;
color: #606266;
}
.arrow-down {
font-size: 8px;
color: #c0c4cc;
}
.search-wrap {
flex: 1;
}
.search-input {
flex: 1;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 0 12px;
font-size: 13px;
}
.btn-query {
background-color: #1890ff;
border-radius: 4px;
height: 32px;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: center;
margin-left: 10px;
}
.btn-txt {
color: #fff;
font-size: 14px;
}
/* 统计网格 */
.stats-grid {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20px;
}
.stat-card {
width: 24%;
padding: 24px 20px;
display: flex;
flex-direction: row;
align-items: center;
}
.icon-circle {
width: 52px;
height: 52px;
border-radius: 26px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16px;
}
.blue { background-color: #e6f7ff; color: #1890ff; }
.orange { background-color: #fff7e1; color: #fa8c16; }
.green { background-color: #f6ffed; color: #52c41a; }
.pink { background-color: #fff0f6; color: #eb2f96; }
.stat-icon { font-size: 22px; font-weight: bold; }
.stat-info {
display: flex;
flex-direction: column;
}
.stat-value {
font-size: 22px;
font-weight: 700;
color: #303133;
line-height: 1.1;
}
.stat-label {
font-size: 12px;
color: #909399;
margin-top: 6px;
}
/* 操作区 */
.action-section {
margin-bottom: 15px;
}
.btn-export {
width: 60px;
height: 30px;
border: 1px solid #dcdfe6;
border-radius: 4px;
background-color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.btn-export-txt {
font-size: 13px;
color: #606266;
}
/* 表格 */
.table-container {
display: flex;
flex-direction: column;
}
.table-header {
background-color: #f8f9fb;
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.th {
padding: 12px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.th-txt {
font-size: 14px;
font-weight: 600;
color: #909399;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.td {
padding: 12px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.td-txt {
font-size: 13px;
color: #606266;
}
.col-id { width: 80px; }
.col-avatar { width: 80px; }
.col-nickname { width: 150px; }
.col-orderno { width: 220px; }
.col-amount { width: 120px; }
.col-paid { width: 120px; }
.col-type { width: 150px; }
.col-time { width: 150px; }
.col-ops { flex: 1; min-width: 100px; }
.avatar-box {
width: 40px;
height: 40px;
background-color: #f0f2f5;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.avatar-img-mock {
width: 100%;
height: 100%;
background-color: #ccc;
}
.avatar-placeholder {
font-size: 16px;
}
.op-link {
font-size: 13px;
color: #1890ff;
}
</style>

View File

@@ -1,326 +0,0 @@
<template>
<view class="finance-invoice">
<!-- 头部筛选区 -->
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">创建时间:</text>
<view class="date-picker-wrap">
<text class="calendar-icon">📅</text>
<text class="date-placeholder">最近30天</text>
</view>
</view>
<view class="filter-item search-wrap">
<text class="filter-label">搜索:</text>
<input class="search-input" v-model="searchKeyword" placeholder="订单号/抬头/用户名" @confirm="handleQuery" />
</view>
<view class="btn-query" @click="handleQuery">
<text class="btn-txt">查询</text>
</view>
</view>
</view>
<!-- 状态切换选项卡 -->
<view class="tab-section">
<view
v-for="(tab, index) in tabs"
:key="index"
class="tab-item"
:class="{ active: activeTab === index }"
@click="handleTabChange(index)"
>
<text class="tab-title">{{ tab.name }}</text>
<view class="active-line" v-if="activeTab === index"></view>
</view>
</view>
<!-- 数据表格 -->
<view class="table-container border-shadow">
<view class="table-header">
<view class="th col-order"><text class="th-txt">订单号</text></view>
<view class="th col-amount"><text class="th-txt">订单金额</text></view>
<view class="th col-type"><text class="th-txt">发票类型</text></view>
<view class="th col-header"><text class="th-txt">抬头信息</text></view>
<view class="th col-time"><text class="th-txt">申请时间</text></view>
<view class="th col-status-inv"><text class="th-txt">开票状态</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view v-if="loading" class="table-loading" style="padding: 40px; text-align: center;">
<text>加载中...</text>
</view>
<view v-else-if="tableData.length === 0" class="table-empty" style="padding: 40px; text-align: center;">
<text>暂无发票申请</text>
</view>
<view v-else class="table-row" v-for="(item, index) in tableData" :key="item.id">
<view class="td col-order text-left"><text class="td-txt">{{ item.order_no }}</text></view>
<view class="td col-amount"><text class="td-txt">¥ {{ item.order_amount.toFixed(2) }}</text></view>
<view class="td col-type"><text class="td-txt">{{ item.invoice_type == 1 ? '普通发票' : '专用发票' }}</text></view>
<view class="td col-header">
<view class="header-box">
<text class="td-txt">{{ item.header_name }}</text>
<text class="sub-txt" v-if="item.tax_id">税号: {{ item.tax_id }}</text>
</view>
</view>
<view class="td col-time"><text class="td-txt">{{ item.created_at.substring(0, 16).replace('T', ' ') }}</text></view>
<view class="td col-status-inv">
<text class="status-tag" :class="getStatusClass(item.status)">
{{ getStatusText(item.status) }}
</text>
</view>
<view class="td col-ops">
<view class="ops-box" v-if="item.status === 0">
<text class="op-link" @click="handleProcess(item.id, 1)">开票</text>
<text class="sep">|</text>
<text class="op-link red-txt" @click="handleProcess(item.id, -1)">驳回</text>
</view>
<text v-else class="td-txt">-</text>
</view>
</view>
</view>
</view>
<!-- 分页区域 -->
<view class="pagination-footer">
<view class="page-total">
<text class="total-txt">共 {{ total }} 条</text>
</view>
<view class="page-btns">
<view class="p-btn" :class="{ disabled: page <= 1 }" @click="prevPage">
<text><</text>
</view>
<view class="p-btn active">
<text>{{ page }}</text>
</view>
<view class="p-btn" :class="{ disabled: page >= totalPages }" @click="nextPage">
<text>></text>
</view>
</view>
<view class="page-jump">
<text class="jump-txt">前往</text>
<input class="jump-input" v-model="jumpPage" type="number" @confirm="goToJumpPage" />
<text class="jump-txt">页</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { ref, onMounted, computed } from 'vue'
import { fetchInvoiceList, processInvoice } from '@/services/admin/financeService.uts'
const activeTab = ref(0)
const searchKeyword = ref('')
const page = ref(1)
const pageSize = ref(15)
const total = ref(0)
const loading = ref(false)
const jumpPage = ref('')
const tabs = [
{ name: '全部发票', value: null as number | null },
{ name: '待开发票', value: 0 as number | null },
{ name: '已开发票', value: 1 as number | null },
{ name: '已拒绝', value: -1 as number | null }
]
const tableData = ref<any[]>([])
const totalPages = computed(() : number => {
if (pageSize.value <= 0) return 1
return Math.ceil(total.value / pageSize.value)
})
async function loadInvoices() {
loading.value = true
try {
const status = tabs[activeTab.value].value
const res = await fetchInvoiceList(
page.value,
pageSize.value,
status,
null,
null,
searchKeyword.value || null
)
tableData.value = res.items
total.value = res.total
} catch (e) {
uni.showToast({ title: '加载发票列表失败', icon: 'none' })
} finally {
loading.value = false
}
}
onMounted(() => {
loadInvoices()
})
function handleTabChange(index : number) {
activeTab.value = index
page.value = 1
loadInvoices()
}
function handleQuery() {
page.value = 1
loadInvoices()
}
function prevPage() {
if (page.value > 1) {
page.value--
loadInvoices()
}
}
function nextPage() {
if (page.value < totalPages.value) {
page.value++
loadInvoices()
}
}
function goToJumpPage() {
const targetPage = parseInt(jumpPage.value)
if (!isNaN(targetPage) && targetPage >= 1 && targetPage <= totalPages.value) {
page.value = targetPage
loadInvoices()
jumpPage.value = ''
} else {
uni.showToast({ title: '页码无效', icon: 'none' })
}
}
async function handleProcess(id : string, status : number) {
const action = status === 1 ? '确认已完成开票' : '确认驳回该申请'
uni.showModal({
title: '开票处理',
content: action,
editable: status === -1,
placeholderText: '请输入驳回原因',
success: async (res) => {
if (res.confirm) {
const ok = await processInvoice(id, status, null, res.content || null)
if (ok) {
uni.showToast({ title: '处理成功' })
loadInvoices()
} else {
uni.showToast({ title: '处理失败', icon: 'none' })
}
}
}
})
}
function getStatusText(status : number) : string {
if (status === 0) return '待开票'
if (status === 1) return '已开票'
if (status === -1) return '已拒绝'
return '未知'
}
function getStatusClass(status : number) : string {
if (status === 0) return 'status-pending'
if (status === 1) return 'status-success'
if (status === -1) return 'status-error'
return ''
}
</script>
<style scoped lang="scss">
.finance-invoice {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
}
.border-shadow {
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
.filter-card { padding: 20px 24px; margin-bottom: 20px; }
.filter-row { display: flex; flex-direction: row; align-items: center; }
.filter-item { display: flex; flex-direction: row; align-items: center; margin-right: 30px; }
.filter-label { font-size: 14px; color: #333; margin-right: 8px; }
.search-wrap { flex: 1; }
.search-input { flex: 1; height: 32px; border: 1px solid #dcdfe6; border-radius: 4px; padding: 0 12px; font-size: 13px; }
.btn-query {
background-color: #1890ff;
border-radius: 4px;
padding: 0 20px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
margin-left: 10px;
cursor: pointer;
}
.btn-txt { color: #fff; font-size: 14px; }
/* 选项卡 */
.tab-section { display: flex; flex-direction: row; margin-bottom: 20px; border-bottom: 1px solid #e4e7ed; padding: 0 10px; }
.tab-item { padding: 12px 20px; position: relative; cursor: pointer; }
.tab-title { font-size: 14px; color: #606266; transition: all 0.3s; }
.tab-item.active .tab-title { color: #1890ff; font-weight: 600; }
.active-line { position: absolute; bottom: 0; left: 20px; right: 20px; height: 2px; background-color: #1890ff; }
/* 表格 */
.table-container { display: flex; flex-direction: column; }
.table-header { background-color: #f8f9fb; display: flex; flex-direction: row; border-bottom: 1px solid #ebeef5; }
.th { padding: 15px 10px; display: flex; align-items: center; justify-content: center; }
.th-txt { font-size: 14px; font-weight: 600; color: #909399; }
.table-row { display: flex; flex-direction: row; border-bottom: 1px solid #ebeef5; }
.td { padding: 15px 10px; display: flex; align-items: center; justify-content: center; }
.td-txt { font-size: 13px; color: #606266; }
.header-box { display: flex; flex-direction: column; align-items: flex-start; .sub-txt { font-size: 11px; color: #999; margin-top: 2px; } }
.status-tag { font-size: 12px; padding: 2px 8px; border-radius: 2px; }
.status-pending { color: #fa8c16; background: #fff7e6; border: 1px solid #ffd591; }
.status-success { color: #52c41a; background: #f6ffed; border: 1px solid #b7eb8f; }
.status-error { color: #f5222d; background: #fff1f0; border: 1px solid #ffa39e; }
/* 列宽分配 */
.col-order { width: 200px; justify-content: flex-start; padding-left: 20px; }
.col-amount { width: 100px; }
.col-type { width: 120px; }
.col-header { flex: 1; min-width: 180px; justify-content: flex-start; }
.col-time { width: 160px; }
.col-status-inv { width: 100px; }
.col-ops { width: 140px; }
.text-left { justify-content: flex-start; }
.ops-box { display: flex; flex-direction: row; align-items: center; }
.op-link { font-size: 13px; color: #1890ff; cursor: pointer; }
.red-txt { color: #f5222d; }
.sep { font-size: 12px; color: #ebeef5; margin: 0 8px; }
/* 分页 */
.pagination-footer {
padding: 24px 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
gap: 12px;
}
.total-txt { font-size: 14px; color: #606266; }
.page-btns { display: flex; flex-direction: row; gap: 8px; }
.p-btn {
width: 32px; height: 32px; border: 1px solid #dcdfe6; border-radius: 4px;
display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer;
}
.p-btn.active { background-color: #2d8cf0; border-color: #2d8cf0; color: #fff; }
.p-btn.disabled { color: #c0c4cc; background-color: #f5f7fa; cursor: not-allowed; }
.page-jump { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.jump-txt { font-size: 14px; color: #606266; }
.jump-input { width: 40px; height: 32px; border: 1px solid #dcdfe6; text-align: center; border-radius: 4px; font-size: 14px; }
</style>

View File

@@ -1,477 +0,0 @@
<template>
<view class="finance-recharge">
<!-- 头部筛选区 -->
<view class="filter-card border-shadow">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">支付状态:</text>
<uni-data-select v-model="paidValue" :localdata="paidOptions" class="data-select" @change="handleQuery" />
</view>
<view class="filter-item search-wrap">
<text class="filter-label">搜索:</text>
<input class="search-input" v-model="searchKeyword" placeholder="请输入用户昵称、订单号" @confirm="handleQuery" />
</view>
<view class="btn-query" @click="handleQuery">
<text class="btn-txt">查询</text>
</view>
</view>
</view>
<!-- 统计网格 -->
<view class="stats-grid">
<view class="stat-card border-shadow" v-for="(item, index) in statsItems" :key="index">
<view class="icon-circle" :class="item.colorClass">
<text class="stat-icon">{{ item.icon }}</text>
</view>
<view class="stat-info">
<text class="stat-value">{{ item.value }}</text>
<text class="stat-label">{{ item.label }}</text>
</view>
</view>
</view>
<!-- 操作区域 -->
<view class="action-section">
<view class="btn-export">
<text class="btn-export-txt">导出</text>
</view>
</view>
<!-- 数据表格 (Flex 模拟) -->
<view class="table-container border-shadow">
<view class="table-header">
<view class="th col-id"><text class="th-txt">ID</text></view>
<view class="th col-nickname"><text class="th-txt">用户信息</text></view>
<view class="th col-orderno"><text class="th-txt">订单号</text></view>
<view class="th col-amount"><text class="th-txt">支付金额</text></view>
<view class="th col-paid"><text class="th-txt">是否支付</text></view>
<view class="th col-type"><text class="th-txt">充值类型</text></view>
<view class="th col-time"><text class="th-txt">支付时间</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view v-if="loading" class="table-loading" style="padding: 40px; text-align: center;">
<text>加载中...</text>
</view>
<view v-else-if="tableData.length === 0" class="table-empty" style="padding: 40px; text-align: center;">
<text>暂无充值记录</text>
</view>
<view v-else class="table-row" v-for="(item, index) in tableData" :key="item.id">
<view class="td col-id"><text class="td-txt">{{ (page - 1) * pageSize + index + 1 }}</text></view>
<view class="td col-nickname">
<view class="u-info-box">
<text class="u-name">{{ item.user_name || '未知' }}</text>
<text class="u-email">{{ item.user_email || '-' }}</text>
</view>
</view>
<view class="td col-orderno"><text class="td-txt">{{ item.order_no }}</text></view>
<view class="td col-amount">
<view class="amount-box">
<text class="price">¥{{ item.price.toFixed(2) }}</text>
<text class="give" v-if="item.give_price > 0">赠:¥{{ item.give_price.toFixed(2) }}</text>
</view>
</view>
<view class="td col-paid">
<text class="status-tag" :class="item.paid == 1 ? 'paid' : 'unpaid'">
{{ item.paid == 1 ? '已支付' : '未支付' }}
</text>
</view>
<view class="td col-type"><text class="td-txt">{{ getRechargeTypeText(item.recharge_type) }}</text></view>
<view class="td col-time"><text class="td-txt">{{ item.pay_time ? item.pay_time.substring(0, 16).replace('T', ' ') : '-' }}</text></view>
<view class="td col-ops">
<text class="op-link">详情</text>
</view>
</view>
</view>
</view>
<!-- 分页区域 -->
<view class="pagination-footer">
<view class="page-total">
<text class="total-txt">共 {{ total }} 条</text>
</view>
<view class="page-btns">
<view class="p-btn" :class="{ disabled: page <= 1 }" @click="prevPage">
<text><</text>
</view>
<view class="p-btn active">
<text>{{ page }}</text>
</view>
<view class="p-btn" :class="{ disabled: page >= totalPages }" @click="nextPage">
<text>></text>
</view>
</view>
<view class="page-jump">
<text class="jump-txt">前往</text>
<input class="jump-input" v-model="jumpPage" type="number" @confirm="goToJumpPage" />
<text class="jump-txt">页</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { ref, onMounted, computed } from 'vue'
import { fetchRechargeList, fetchFinanceOverview } from '@/services/admin/financeService.uts'
const paidValue = ref<string>('all')
const searchKeyword = ref('')
const page = ref(1)
const pageSize = ref(15)
const total = ref(0)
const loading = ref(false)
const jumpPage = ref('')
const paidOptions = [
{ value: 'all', text: '全部状态' },
{ value: '1', text: '已支付' },
{ value: '0', text: '未支付' }
]
const statsItems = ref([
{ label: '充值总金额', value: '0.00', icon: '¥', colorClass: 'blue' },
{ label: '充值退款金额', value: '0.00', icon: '¥', colorClass: 'orange' },
{ label: '本月充值金额', value: '0.00', icon: '月', colorClass: 'green' },
{ label: '今日充值金额', value: '0.00', icon: '今', colorClass: 'pink' }
])
const tableData = ref<any[]>([])
const totalPages = computed(() : number => {
if (pageSize.value <= 0) return 1
return Math.ceil(total.value / pageSize.value)
})
async function loadStats() {
const endTime = new Date().toISOString()
const startTime = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString()
const res = await fetchFinanceOverview(startTime, endTime)
if (res != null) {
statsItems.value[0].value = res.recharge_amount.toFixed(2)
}
}
async function loadList() {
loading.value = true
try {
const paid = paidValue.value == 'all' ? null : parseInt(paidValue.value)
const res = await fetchRechargeList(
page.value,
pageSize.value,
paid,
null,
null,
searchKeyword.value || null
)
tableData.value = res.items
total.value = res.total
} catch (e) {
uni.showToast({ title: '加载充值记录失败', icon: 'none' })
} finally {
loading.value = false
}
}
onMounted(() => {
loadStats()
loadList()
})
const handleQuery = () => {
page.value = 1
loadList()
}
const prevPage = () => {
if (page.value > 1) {
page.value--
loadList()
}
}
const nextPage = () => {
if (page.value < totalPages.value) {
page.value++
loadList()
}
}
const goToJumpPage = () => {
const targetPage = parseInt(jumpPage.value)
if (!isNaN(targetPage) && targetPage >= 1 && targetPage <= totalPages.value) {
page.value = targetPage
loadList()
jumpPage.value = ''
} else {
uni.showToast({ title: '页码无效', icon: 'none' })
}
}
function getRechargeTypeText(type : string | null) : string {
if (type == 'wechat') return '微信充值'
if (type == 'alipay') return '支付宝充值'
if (type == 'system') return '后台补单'
return type || '其他充值'
}
</script>
<style scoped lang="scss">
.finance-recharge {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
}
.border-shadow {
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 筛选卡片 */
.filter-card {
padding: 20px 24px;
margin-bottom: 20px;
}
.filter-row {
display: flex;
flex-direction: row;
align-items: center;
}
.filter-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 28px;
}
.filter-label {
font-size: 14px;
color: #333;
margin-right: 10px;
white-space: nowrap;
}
.data-select {
width: 140px;
}
.search-wrap {
flex: 1;
}
.search-input {
flex: 1;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 0 12px;
font-size: 13px;
}
.btn-query {
background-color: #1890ff;
border-radius: 4px;
height: 32px;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: center;
margin-left: 10px;
cursor: pointer;
}
.btn-txt {
color: #fff;
font-size: 14px;
}
/* 统计网格 */
.stats-grid {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20px;
}
.stat-card {
width: 24%;
padding: 24px 20px;
display: flex;
flex-direction: row;
align-items: center;
}
.icon-circle {
width: 52px;
height: 52px;
border-radius: 26px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16px;
}
.blue { background-color: #e6f7ff; color: #1890ff; }
.orange { background-color: #fff7e1; color: #fa8c16; }
.green { background-color: #f6ffed; color: #52c41a; }
.pink { background-color: #fff0f6; color: #eb2f96; }
.stat-icon { font-size: 22px; font-weight: bold; }
.stat-info {
display: flex;
flex-direction: column;
}
.stat-value {
font-size: 22px;
font-weight: 700;
color: #303133;
line-height: 1.1;
}
.stat-label {
font-size: 12px;
color: #909399;
margin-top: 6px;
}
/* 操作区 */
.action-section {
margin-bottom: 15px;
}
.btn-export {
width: 60px;
height: 30px;
border: 1px solid #dcdfe6;
border-radius: 4px;
background-color: #fff;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.btn-export-txt {
font-size: 13px;
color: #606266;
}
/* 表格 */
.table-container {
display: flex;
flex-direction: column;
}
.table-header {
background-color: #f8f9fb;
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.th {
padding: 12px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.th-txt {
font-size: 14px;
font-weight: 600;
color: #909399;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
min-height: 60px;
}
.td {
padding: 12px 10px;
display: flex;
align-items: center;
justify-content: center;
}
.td-txt {
font-size: 13px;
color: #606266;
}
.u-info-box {
display: flex;
flex-direction: column;
align-items: flex-start;
.u-name { font-size: 13px; color: #303133; font-weight: 500; }
.u-email { font-size: 11px; color: #909399; }
}
.amount-box {
display: flex;
flex-direction: column;
align-items: center;
.price { font-size: 14px; color: #303133; font-weight: bold; }
.give { font-size: 11px; color: #f56c6c; }
}
.status-tag {
font-size: 12px;
padding: 2px 8px;
border-radius: 2px;
&.paid { background-color: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
&.unpaid { background-color: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }
}
.col-id { width: 60px; }
.col-nickname { width: 180px; justify-content: flex-start; }
.col-orderno { width: 220px; }
.col-amount { width: 120px; }
.col-paid { width: 100px; }
.col-type { width: 120px; }
.col-time { width: 160px; }
.col-ops { flex: 1; min-width: 100px; }
.op-link {
font-size: 13px;
color: #1890ff;
cursor: pointer;
}
/* 分页 */
.pagination-footer {
padding: 24px 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
gap: 12px;
}
.total-txt { font-size: 14px; color: #606266; }
.page-btns { display: flex; flex-direction: row; gap: 8px; }
.p-btn {
width: 32px;
height: 32px;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
cursor: pointer;
}
.p-btn.active { background-color: #2d8cf0; border-color: #2d8cf0; color: #fff; }
.p-btn.disabled { color: #c0c4cc; background-color: #f5f7fa; cursor: not-allowed; }
.page-jump { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.jump-txt { font-size: 14px; color: #606266; }
.jump-input { width: 40px; height: 32px; border: 1px solid #dcdfe6; text-align: center; border-radius: 4px; font-size: 14px; }
</style>

View File

@@ -1,81 +0,0 @@
<template>
<view class="page-container">
<view class="page-header">
<text class="page-title">财务记录</text>
<text class="page-subtitle">Component: FinanceRecord</text>
</view>
<view class="page-content">
<view class="placeholder-card">
<text class="placeholder-title">页面占位</text>
<text class="placeholder-desc">该功能模块正在开发中</text>
<text class="placeholder-info">当前采用 CRMEB 路由体系 1:1 映射</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { ref } from 'vue'
// TODO: 实现 财务记录 的具体功能
const loading = ref<boolean>(false)
</script>
<style scoped lang="scss">
.page-container {
padding: 20px;
min-height: 100vh;
background: #f5f5f5;
}
.page-header {
margin-bottom: 20px;
}
.page-title {
display: block;
font-size: 24px;
font-weight: 600;
color: #333;
margin-bottom: 8px;
}
.page-subtitle {
display: block;
font-size: 14px;
color: #999;
}
.page-content {
background: #fff;
border-radius: 4px;
padding: 24px;
}
.placeholder-card {
text-align: center;
padding: 60px 20px;
}
.placeholder-title {
display: block;
font-size: 18px;
font-weight: 600;
color: #666;
margin-bottom: 12px;
}
.placeholder-desc {
display: block;
font-size: 14px;
color: #999;
margin-bottom: 8px;
}
.placeholder-info {
display: block;
font-size: 12px;
color: #1890ff;
}
</style>

View File

@@ -314,9 +314,9 @@ function updateChart(data : any[]) {
<style scoped lang="scss">
.finance-transaction-stats {
padding: 16px;
background-color: #f0f2f5;
min-height: 100vh;
padding: 0;
background-color: transparent;
min-height: auto;
}
.header-filters {

View File

@@ -1,550 +0,0 @@
<template>
<view class="finance-withdrawal">
<!-- 头部筛选区 -->
<view class="filter-card">
<view class="filter-row">
<view class="filter-item">
<text class="filter-label">时间选择:</text>
<uni-datetime-picker v-model="timeRange" type="daterange" class="dt-picker" />
</view>
<view class="filter-item">
<text class="filter-label">提现状态:</text>
<uni-data-select v-model="statusValue" :localdata="statusOptions" class="data-select" />
</view>
<view class="filter-item">
<text class="filter-label">提现方式:</text>
<uni-data-select v-model="methodValue" :localdata="methodOptions" class="data-select" />
</view>
<view class="filter-item search-wrap">
<text class="filter-label">搜索:</text>
<uni-easyinput v-model="searchKeyword" placeholder="微信昵称/姓名/支付宝账号/银行卡号" class="search-input" />
</view>
<button class="btn-query" @click="handleQuery">查询</button>
</view>
</view>
<!-- 统计指标网格 -->
<view class="stats-grid">
<view class="stat-card" v-for="(item, index) in statsItems" :key="index">
<view class="icon-circle" :class="item.colorClass">
<text class="stat-icon">{{ item.icon }}</text>
</view>
<view class="stat-info">
<text class="stat-value">{{ item.value }}</text>
<text class="stat-label">{{ item.label }}</text>
</view>
</view>
</view>
<!-- 操作按钮区 -->
<view class="action-section">
<view class="btn-record">
<text class="btn-record-txt">佣金记录</text>
</view>
</view>
<!-- 数据表格 -->
<view class="table-container">
<view class="table-header">
<view class="th col-id"><text class="th-txt">ID</text></view>
<view class="th col-user"><text class="th-txt">用户信息</text></view>
<view class="th col-amount"><text class="th-txt">提现金额</text></view>
<view class="th col-fee"><text class="th-txt">手续费</text></view>
<view class="th col-net"><text class="th-txt">到账金额</text></view>
<view class="th col-method"><text class="th-txt">提现方式</text></view>
<view class="th col-time"><text class="th-txt">申请时间</text></view>
<view class="th col-status"><text class="th-txt">审核状态</text></view>
<view class="th col-ops"><text class="th-txt">操作</text></view>
</view>
<view class="table-body">
<view v-if="loading" class="loading-state" style="padding: 40px; text-align: center;">
<text>加载中...</text>
</view>
<view v-else-if="tableData.length === 0" class="empty-state" style="padding: 40px; text-align: center;">
<text>暂无提现申请</text>
</view>
<view v-else class="table-row" v-for="(item, index) in tableData" :key="item.id">
<view class="td col-id"><text class="td-txt">{{ (page - 1) * pageSize + index + 1 }}</text></view>
<view class="td col-user">
<view class="user-info-box">
<view class="avatar-box">
<text class="avatar-placeholder">U</text>
</view>
<view class="user-detail">
<text class="user-nickname">{{ item.user_name || '未知' }}</text>
<text class="user-id">UID:{{ item.uid.substring(0, 8) }}</text>
</view>
</view>
</view>
<view class="td col-amount"><text class="td-txt">¥{{ item.extract_price.toFixed(2) }}</text></view>
<view class="td col-fee"><text class="td-txt">¥{{ item.service_fee.toFixed(2) }}</text></view>
<view class="td col-net"><text class="td-txt green-txt">¥{{ (item.extract_price - item.service_fee).toFixed(2) }}</text></view>
<view class="td col-method">
<view class="method-box">
<text class="m-line">{{ getMethodText(item.extract_type) }}</text>
<text class="m-line">账号:{{ item.alipay_code || item.wechat_code || item.bank_code || '-' }}</text>
</view>
</view>
<view class="td col-time"><text class="td-txt">{{ item.created_at.substring(0, 16).replace('T', ' ') }}</text></view>
<view class="td col-status">
<text class="td-txt" :class="{ 'red-txt': item.status == -1, 'green-txt': item.status == 1 }">
{{ getStatusText(item.status) }}
</text>
</view>
<view class="td col-ops">
<view class="ops-box" v-if="item.status == 0">
<text class="op-btn blue" @click="handleReview(item.id, 1)">通过</text>
<text class="op-sep">|</text>
<text class="op-btn blue" @click="handleReview(item.id, -1)">驳回</text>
</view>
<text v-else class="td-txt">-</text>
</view>
</view>
</view>
</view>
<!-- 分页区域 -->
<view class="pagination-footer" style="padding: 24px 0; display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 12px;">
<view class="page-total">
<text class="total-txt">共 {{ total }} 条</text>
</view>
<view class="page-btns" style="display: flex; flex-direction: row; gap: 8px;">
<view class="p-btn" :class="{ disabled: page <= 1 }" @click="prevPage" style="width: 32px; height: 32px; border: 1px solid #dcdfe6; display: flex; align-items: center; justify-content: center; cursor: pointer;">
<text><</text>
</view>
<view class="p-btn active" style="width: 32px; height: 32px; background-color: #2d8cf0; color: #fff; display: flex; align-items: center; justify-content: center;">
<text>{{ page }}</text>
</view>
<view class="p-btn" :class="{ disabled: page >= totalPages }" @click="nextPage" style="width: 32px; height: 32px; border: 1px solid #dcdfe6; display: flex; align-items: center; justify-content: center; cursor: pointer;">
<text>></text>
</view>
</view>
<view class="page-jump" style="display: flex; flex-direction: row; align-items: center; gap: 8px;">
<text class="jump-txt">前往</text>
<input class="jump-input" v-model="jumpPage" type="number" @confirm="goToJumpPage" style="width: 40px; height: 32px; border: 1px solid #dcdfe6; text-align: center;" />
<text class="jump-txt">页</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { ref, onMounted, reactive } from 'vue'
import { fetchExtractList, fetchFinanceOverview, reviewExtract } from '@/services/admin/financeService.uts'
import { ExtractRecord } from '@/types/admin/finance.uts'
const timeRange = ref<string[]>([])
const statusValue = ref('all')
const methodValue = ref('all')
const searchKeyword = ref('')
const statusOptions = ref([
{ value: 'all', text: '全部' },
{ value: '0', text: '待审核' },
{ value: '1', text: '已通过' },
{ value: '-1', text: '已驳回' }
])
const methodOptions = ref([
{ value: 'all', text: '全部' },
{ value: 'alipay', text: '支付宝' },
{ value: 'bank', text: '银行卡' },
{ value: 'weixin', text: '微信' }
])
const statsItems = ref([
{ label: '佣金总金额', value: '0.00', icon: '¥', colorClass: 'blue' },
{ label: '待提现金额', value: '0.00', icon: '¥', colorClass: 'orange' },
{ label: '已提现金额', value: '0.00', icon: '¥', colorClass: 'green' },
{ label: '未提现金额', value: '0.00', icon: '¥', colorClass: 'pink' }
])
const tableData = ref<ExtractRecord[]>([])
const total = ref(0)
const page = ref(1)
const pageSize = ref(15)
const loading = ref(false)
async function loadStats() {
const endTime = new Date().toISOString()
const startTime = new Date(Date.now() - 365 * 24 * 60 * 60 * 1000).toISOString()
const res = await fetchFinanceOverview(startTime, endTime)
if (res != null) {
statsItems.value[0].value = res.total_user_brokerage.toFixed(2)
statsItems.value[1].value = res.extract_amount.toFixed(2) // 示例逻辑,根据实际汇总调整
statsItems.value[2].value = res.extract_amount.toFixed(2)
statsItems.value[3].value = (res.total_user_brokerage - res.extract_amount).toFixed(2)
}
}
async function loadList() {
loading.value = true
try {
const status = statusValue.value == 'all' ? null : parseInt(statusValue.value)
let startTime : string | null = null
let endTime : string | null = null
if (timeRange.value.length == 2) {
startTime = timeRange.value[0]
endTime = timeRange.value[1]
}
const res = await fetchExtractList(
page.value,
pageSize.value,
status,
startTime,
endTime,
searchKeyword.value || null
)
tableData.value = res.items
total.value = res.total
} catch (e) {
uni.showToast({ title: '加载失败', icon: 'none' })
} finally {
loading.value = false
}
}
onMounted(() => {
loadStats()
loadList()
})
const handleQuery = () => {
page.value = 1
loadList()
}
async function handleReview(id : string, status : number) {
const action = status == 1 ? '通过' : '驳回'
uni.showModal({
title: '提示',
content: `确认要${action}该提现申请吗?`,
success: async (res) => {
if (res.confirm) {
const ok = await reviewExtract(id, status)
if (ok) {
uni.showToast({ title: '操作成功' })
loadList()
loadStats()
} else {
uni.showToast({ title: '操作失败', icon: 'none' })
}
}
}
})
}
function getStatusText(status : number) : string {
if (status == 0) return '待审核'
if (status == 1) return '已通过'
if (status == -1) return '已驳回'
return '未知'
}
function getMethodText(type : string) : string {
if (type == 'alipay') return '支付宝'
if (type == 'bank') return '银行卡'
if (type == 'wechat') return '微信'
return type
}
</script>
<style scoped lang="scss">
.finance-withdrawal {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
}
/* 筛选样式更新 */
.filter-card {
background-color: #fff;
padding: 24px;
border-radius: 4px;
margin-bottom: 20px;
}
.filter-row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
}
.filter-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 24px;
margin-bottom: 16px;
}
.filter-label {
font-size: 14px;
color: #606266;
margin-right: 12px;
white-space: nowrap;
}
.dt-picker {
width: 260px;
}
.data-select {
width: 140px;
}
.search-wrap {
flex: 1;
min-width: 320px;
}
.search-input {
flex: 1;
}
.btn-query {
background-color: #1890ff;
color: #fff;
font-size: 14px;
height: 36px;
line-height: 36px;
padding: 0 24px;
border-radius: 4px;
border: none;
margin-bottom: 16px;
}
/* 统计卡片样式 */
.stats-grid {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20px;
}
.stat-card {
width: 24%;
background-color: #fff;
padding: 24px 20px;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
box-shadow: 0 2px 12px 0 rgba(0,0,0,0.05);
}
.icon-circle {
width: 52px;
height: 52px;
border-radius: 26px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16px;
}
.blue { background-color: #e6f7ff; color: #1890ff; }
.orange { background-color: #fff7e1; color: #fa8c16; }
.green { background-color: #f6ffed; color: #52c41a; }
.pink { background-color: #fff0f6; color: #eb2f96; }
.stat-icon { font-size: 24px; font-weight: bold; }
.stat-info {
display: flex;
flex-direction: column;
}
.stat-value {
font-size: 22px;
font-weight: 700;
color: #303133;
line-height: 1.1;
}
.stat-label {
font-size: 13px;
color: #909399;
margin-top: 6px;
}
/* 操作区域 */
.action-section {
margin-bottom: 12px;
display: flex;
flex-direction: row;
}
.btn-record {
background-color: #1890ff;
border-radius: 4px;
padding: 6px 16px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-record-txt {
color: #fff;
font-size: 13px;
}
/* 表格容器样式 (Flex 模拟) */
.table-container {
background-color: #fff;
border-radius: 4px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.table-header {
background-color: #f8f9fb;
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.th {
padding: 12px 8px;
display: flex;
align-items: center;
justify-content: center;
}
.th-txt {
font-size: 14px;
font-weight: 600;
color: #909399;
}
.table-body {
display: flex;
flex-direction: column;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #ebeef5;
}
.td {
padding: 12px 8px;
display: flex;
align-items: center;
justify-content: center;
}
.td-txt {
font-size: 13px;
color: #606266;
}
/* 列宽定义 (与截图匹配) */
.col-id { width: 60px; }
.col-user { width: 180px; justify-content: flex-start; }
.col-amount { width: 100px; }
.col-fee { width: 100px; }
.col-net { width: 100px; }
.col-method { flex: 1; min-width: 220px; justify-content: flex-start; }
.col-qr { width: 80px; }
.col-time { width: 150px; }
.col-remark { width: 80px; }
.col-status { width: 100px; }
.col-ops { width: 160px; }
/* 用户信息单元格 */
.user-info-box {
display: flex;
flex-direction: row;
align-items: center;
}
.avatar-box {
width: 32px;
height: 32px;
border-radius: 16px;
background-color: #f0f2f5;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.avatar-placeholder {
font-size: 14px;
color: #999;
}
.user-detail {
display: flex;
flex-direction: column;
}
.user-nickname {
font-size: 13px;
color: #303133;
margin-bottom: 2px;
}
.user-id {
font-size: 11px;
color: #909399;
}
/* 提现方式单元格 */
.method-box {
display: flex;
flex-direction: column;
}
.m-line {
font-size: 12px;
color: #666;
margin-bottom: 2px;
}
.green-txt {
color: #52c41a;
font-weight: 600;
}
/* 收款码 */
.qr-box {
width: 40px;
height: 40px;
background-color: #1a1a1a;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.qr-icon-txt {
color: #fff;
font-size: 16px;
}
/* 操作项 */
.ops-box {
display: flex;
flex-direction: row;
align-items: center;
}
.op-btn {
font-size: 13px;
margin: 0 4px;
}
.blue { color: #1890ff; }
.op-sep {
color: #ebeef5;
font-size: 12px;
}
</style>