This commit is contained in:
@@ -4,6 +4,11 @@ import { getFundSummary, getCommissionRecords, getCommissionStats } from '@/api/
|
||||
import type { FundSummary, CommissionRecord, CommissionStats } from '@/api/commission'
|
||||
import SimplePicker from '@/components/SimplePicker.vue'
|
||||
|
||||
type LoginUserInfo = {
|
||||
shop_id?: number
|
||||
username?: string
|
||||
}
|
||||
|
||||
const commissionSummary = ref<FundSummary | null>(null)
|
||||
const shopId = ref<number>(0)
|
||||
const commissionRecords = ref<CommissionRecord[]>([])
|
||||
@@ -64,8 +69,12 @@ function formatTime(time: string) {
|
||||
return `${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
|
||||
}
|
||||
|
||||
function getLoginUserInfo() {
|
||||
return uni.getStorageSync('user_info') as LoginUserInfo | undefined
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const userInfo = uni.getStorageSync('user_info')
|
||||
const userInfo = getLoginUserInfo()
|
||||
if (userInfo?.shop_id) {
|
||||
shopId.value = userInfo.shop_id
|
||||
}
|
||||
@@ -76,7 +85,8 @@ onMounted(() => {
|
||||
|
||||
async function loadCommissionSummary() {
|
||||
try {
|
||||
commissionSummary.value = await getFundSummary()
|
||||
const userInfo = getLoginUserInfo()
|
||||
commissionSummary.value = await getFundSummary(userInfo?.username ? { shop_name: userInfo.username } : undefined)
|
||||
} catch (error) {
|
||||
console.error('加载佣金概览失败:', error)
|
||||
}
|
||||
@@ -330,4 +340,4 @@ function onScroll(e: any) {
|
||||
.space-y-3 > view:not(:last-child) {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user