页面更改

This commit is contained in:
dzl
2025-09-17 14:10:22 +08:00
parent a083dcfbd4
commit 35f62a6b3e
4 changed files with 41 additions and 32 deletions

View File

@@ -161,7 +161,7 @@
</div>
<div v-else>
<div v-for="user in recentUsers" :key="user.id" class="activity-item">
<el-avatar :size="40" :src="user.avatar">
<el-avatar :size="40" :src="getImageUrl(user.avatar)">
<el-icon>
<UserFilled/>
</el-icon>
@@ -183,7 +183,7 @@
<template #header>
<div class="card-header">
<span class="card-title">最新营收</span>
<el-link type="primary" @click="$router.push('/commissions')">查看全部</el-link>
<!-- <el-link type="primary" @click="$router.push('/commissions')">查看全部</el-link> -->
</div>
</template>
<div class="activity-list">
@@ -222,6 +222,7 @@ import {ref, reactive, onMounted, computed, watch} from 'vue'
import {useUserStore} from '@/stores/user'
import {useRouter} from 'vue-router'
import api from '@/utils/api'
import {getImageUrl} from '@/utils/config'
import {ElMessage} from 'element-plus'
import dayjs from 'dayjs'
import {

View File

@@ -90,7 +90,7 @@
</el-card>
</el-col>
<!-- 佣金收入趋势 -->
<!-- 营收收入趋势 -->
<el-col :xs="24" :lg="12">
<el-card class="chart-card" shadow="hover">
<template #header>
@@ -111,12 +111,12 @@
<!-- 业务分析图表 -->
<!-- <el-row :gutter="20" class="business-charts-row">-->
<!-- 佣金类型分布 -->
<!-- 营收类型分布 -->
<!-- <el-col :xs="24" :lg="12">-->
<!-- <el-card class="chart-card" shadow="hover">-->
<!-- <template #header>-->
<!-- <div class="card-header">-->
<!-- <span class="card-title">佣金类型分布</span>-->
<!-- <span class="card-title">营收类型分布</span>-->
<!-- <el-tag type="primary" size="small">总览</el-tag>-->
<!-- </div>-->
<!-- </template>-->
@@ -152,8 +152,7 @@
<el-card class="activity-card" shadow="hover">
<template #header>
<div class="card-header">
<span class="card-title">最新下级</span>
<el-link type="primary" @click="$router.push('/users')">查看全部</el-link>
<span class="card-title">最新下级</span>
</div>
</template>
<div class="activity-list">
@@ -165,7 +164,7 @@
</div>
<div v-else>
<div v-for="user in recentUsers" :key="user.id" class="activity-item">
<el-avatar :size="40" :src="user.avatar">
<el-avatar :size="40" :src="getImageUrl(user.avatar)">
<el-icon>
<UserFilled/>
</el-icon>
@@ -181,13 +180,13 @@
</el-card>
</el-col>
<!-- 最新佣金 -->
<!-- 最新营收 -->
<el-col :xs="24" :lg="12">
<el-card class="activity-card" shadow="hover">
<template #header>
<div class="card-header">
<span class="card-title">最新佣金</span>
<el-link type="primary" @click="$router.push('/commissions')">查看全部</el-link>
<span class="card-title">最新营收</span>
<!-- <el-link type="primary" @click="$router.push('/commissions')">查看全部</el-link> -->
</div>
</template>
<div class="activity-list">
@@ -226,6 +225,7 @@ import {ref, reactive, onMounted, computed, watch} from 'vue'
import {useUserStore} from '@/stores/user'
import {useRouter} from 'vue-router'
import api from '@/utils/api'
import {getImageUrl} from '@/utils/config'
import {ElMessage} from 'element-plus'
import dayjs from 'dayjs'
import {
@@ -332,7 +332,7 @@ const stats = computed(() => [
value: `${statsData.value.users.total_operated}`,
icon: Money,
class: 'stat-users3',
change: `直营佣金${statsData.value.commissions.operated_commission}`,
change: `直营营收${statsData.value.commissions.operated_commission}`,
changeClass: statsData.value.commissions.operated_commission >= 0 ? 'positive' : 'negative',
changeIcon: statsData.value.commissions.operated_commission >= 0 ? 'ArrowUp' : 'ArrowDown'
},
@@ -342,7 +342,7 @@ const stats = computed(() => [
value: `${statsData.value.users.active_users}`,
icon: Watermelon,
class: 'stat-users4',
change: `已提现佣金${statsData.value.commissions.get_commission}`,
change: `已提现营收${statsData.value.commissions.get_commission}`,
changeClass: statsData.value.commissions.get_commission >= 0 ? 'positive' : 'negative',
changeIcon: statsData.value.commissions.get_commission >= 0 ? 'ArrowUp' : 'ArrowDown'
},
@@ -352,7 +352,7 @@ const stats = computed(() => [
value: `${statsData.value.users.operated_share_users}`,
icon: Sell,
class: 'stat-users5',
change: `待提现佣金${statsData.value.commissions.loading_commission}`,
change: `待提现营收${statsData.value.commissions.loading_commission}`,
changeClass: statsData.value.commissions.loading_commission >= 0 ? 'positive' : 'negative',
changeIcon: statsData.value.commissions.loading_commission >= 0 ? 'ArrowUp' : 'ArrowDown'
}
@@ -404,7 +404,7 @@ const userChartOption = computed(() => ({
}]
}))
// 佣金收入图表配置
// 营收收入图表配置
const commissionChartOption = computed(() => ({
tooltip: {
trigger: 'axis',
@@ -426,7 +426,7 @@ const commissionChartOption = computed(() => ({
type: 'value'
},
series: [{
name: '佣金收入',
name: '营收收入',
type: 'bar',
data: commissionChartData.value.map(item => item.amount),
itemStyle: {
@@ -435,18 +435,18 @@ const commissionChartOption = computed(() => ({
}]
}))
// 佣金类型分布图表配置
// 营收类型分布图表配置
const commissionTypeOption = computed(() => ({
tooltip: {
trigger: 'item',
formatter: '{a}{b}<br/>数量: {c}<br/>占比:{d}%<br/>佣金金额:{e}'
formatter: '{a}{b}<br/>数量: {c}<br/>占比:{d}%<br/>营收金额:{e}'
},
legend: {
orient: 'vertical',
left: 'left'
},
series: [{
name: '佣金类型',
name: '营收类型',
type: 'pie',
radius: '50%',
data: commissionTypeData.value,
@@ -551,7 +551,7 @@ const loadUserChart = async () => {
}
}
// 加载佣金收入趋势数据
// 加载营收收入趋势数据
const loadCommissionTrendData = async () => {
try {
const response = await api.dashboard.getCommissionTrend()
@@ -562,7 +562,7 @@ const loadCommissionTrendData = async () => {
}
}
// 加载佣金类型分布数据
// 加载营收类型分布数据
const loadCommissionDistributionData = async () => {
try {
const response = await api.dashboard.getCommissionDistribution()
@@ -594,7 +594,7 @@ const loadRecentUsersData = async () => {
}
}
// 加载最新佣金
// 加载最新营收
const loadRecentCommissionsData = async () => {
try {
const response = await api.dashboard.getRecentCommissions()

View File

@@ -101,7 +101,7 @@
</div>
<div class="stats-info">
<div class="stats-value">{{ directSaleStats.total_withdrawals || 0 }}</div>
<div class="stats-label">总提现次数</div>
<div class="stats-label">总提现金额</div>
</div>
</div>
</el-card>
@@ -357,15 +357,19 @@ const handleWithdraw = async (row) => {
inputErrorMessage: '请输入正确提现金额',
}
).then(({value}) => {
var params = {
userId: row.id,
amount: value,
if (value > 0){
var params = {
userId: row.id,
amount: value,
}
api.directSale.withdraw(params).then((res) => {
ElMessage.success('提现操作成功')
// 刷新列表和统计数据
getDirectSaleList()
})
} else {
ElMessage.error('请输入正确提现金额')
}
api.directSale.withdraw(params).then((res) => {
ElMessage.success('提现操作成功')
// 刷新列表和统计数据
getDirectSaleList()
})
})
} catch (error) {
if (error !== 'cancel') {

View File

@@ -275,7 +275,11 @@ const getTransferList = async () => {
// 搜索
const handleSearch = () => {
pagination.page = 1
getTransferList()
if (searchForm.min_amount > searchForm.max_amount) {
ElMessage.error('最小金额不能超过最大金额')
} else {
getTransferList()
}
}
// 重置