修复bug
This commit is contained in:
@@ -201,8 +201,10 @@ async function loadData() {
|
||||
const endTime = new Date().toISOString()
|
||||
const startTime = getStartTime()
|
||||
|
||||
// 各区块独立 try-catch,单个接口失败不影响其他数据展示
|
||||
|
||||
// 1. 获取财务概况
|
||||
try {
|
||||
// 1. 获取财务概况
|
||||
const finRes = await fetchFinanceOverview(startTime, endTime)
|
||||
if (finRes != null) {
|
||||
stats.rechargeAmount = finRes.recharge_amount.toFixed(2)
|
||||
@@ -212,8 +214,12 @@ async function loadData() {
|
||||
stats.balancePay = finRes.total_user_balance.toFixed(2)
|
||||
stats.commissionPay = finRes.total_user_brokerage.toFixed(2)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[finance-stats] 财务概况加载失败', e)
|
||||
}
|
||||
|
||||
// 2. 获取订单统计
|
||||
// 2. 获取订单统计(与订单统计页共用同一 RPC,此处独立请求)
|
||||
try {
|
||||
const orderRes = await fetchOrderStats(startTime, endTime)
|
||||
if (orderRes != null) {
|
||||
stats.revenue = orderRes.total_amount.toFixed(2)
|
||||
@@ -221,15 +227,19 @@ async function loadData() {
|
||||
stats.orderCount = String(orderRes.order_count)
|
||||
stats.refundAmount = orderRes.refund_amount.toFixed(2)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[finance-stats] 订单统计加载失败', e)
|
||||
}
|
||||
|
||||
// 3. 获取趋势数据驱动图表
|
||||
// 3. 获取趋势数据驱动图表
|
||||
try {
|
||||
const trendRes = await fetchFinanceBillSummary(startTime, endTime, 'day')
|
||||
updateChart(trendRes)
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '加载统计失败', icon: 'none' })
|
||||
} finally {
|
||||
loading.value = false
|
||||
console.error('[finance-stats] 趋势图加载失败', e)
|
||||
}
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
function handleDateTabChange(index : number) {
|
||||
|
||||
Reference in New Issue
Block a user