Forráskód Böngészése

首页修改 / 用户管理详情调整

hjr 2 napja
szülő
commit
5418b3a32f

+ 1 - 0
.gitignore

@@ -9,6 +9,7 @@ lerna-debug.log*
 
 node_modules
 dist
+agency-dist
 dist-ssr
 *.local
 mock

+ 46 - 2
src/api/dashboard.js

@@ -1,8 +1,52 @@
 import request from '@/utils/system/request'
 
+// 首页统计新
+export function statisticsHomePart1(data) {
+    return request({
+        url: '/statistics/homePart1',
+        method: 'post',
+        data,
+        timeout: 180 * 1000
+    })
+}
+// 首页统计新 用户增长数量报表
+export function statisticsHomePart2(data) {
+    return request({
+        url: '/statistics/homePart2',
+        method: 'post',
+        data,
+        timeout: 180 * 1000
+    })
+}
+// 首页统计新 收益金额报表
+export function statisticsHomePart3(data) {
+    return request({
+        url: '/statistics/homePart3',
+        method: 'post',
+        data,
+        timeout: 180 * 1000
+    })
+}
+// 首页统计新 付费收益
+export function statisticsHomePart4(data) {
+    return request({
+        url: '/statistics/homePart4',
+        method: 'post',
+        data,
+        timeout: 180 * 1000
+    })
+}
+// 首页统计新 任务收益
+export function statisticsHomePart5(data) {
+    return request({
+        url: '/statistics/homePart5',
+        method: 'post',
+        data,
+        timeout: 180 * 1000
+    })
+}
 
-
-// 首页统计
+// 首页统计 (旧 子雄 已废弃)
 export function statisticsHome(params) {
     return request({
         url: '/statistics/home',

+ 3 - 3
src/utils/system/request.js

@@ -114,9 +114,9 @@ function showError(error) {
       duration: 1000
     })
     // to re-login
-    // setTimeout(() => {
-    //   store.dispatch("user/loginOut");
-    // }, 1000);
+    setTimeout(() => {
+      store.dispatch("user/loginOut");
+    }, 1000);
   }
   else if (error.code === 1024 || error.code == 401 ) {
     ElMessage({

+ 10 - 10
src/views/main/dashboard/components/card/index.vue

@@ -7,24 +7,24 @@
 <script lang="js" setup>
 import { ref, onBeforeMount } from 'vue'
 import Row from './row.vue'
-import { statisticsHome } from '@/api/dashboard.js'
+import { statisticsHome,statisticsHomePart1 } from '@/api/dashboard.js'
 
 const list = ref([
   { id: 1, name: '用户总数', data: '31258', color: '#4e73df', icon: 'sfont system-yonghu' },
-  // { id: 2, name: '当日增长用户数', data: '5542', color: '#1cc88a', icon: 'sfont system-xiaoxi' },
-  { id: 3, name: '消费总额(元)', data: '108827', color: '#36b9cc', icon: 'sfont system-shuliang_mianxing' },
-  { id: 4, name: '预估收益(元)', data: '64581.04', color: '#f6c23e', icon: 'sfont system-jindutiaoshouyidaozhang' }
+  { id: 2, name: '当日增长用户数', data: '5542', color: '#1cc88a', icon: 'sfont system-xiaoxi' },
+  { id: 3, name: '总收益金额(元)', data: '108827', color: '#36b9cc', icon: 'sfont system-shuliang_mianxing' },
+  { id: 4, name: '当日收益金额(元)', data: '64581.04', color: '#f6c23e', icon: 'sfont system-jindutiaoshouyidaozhang' }
 ])
 
 const getTopCountData = async () => {
   try {
-    const res = await statisticsHome()
-    const { consumeTotal, incomeEstimate, userCount } = res.data
+    const res = await statisticsHomePart1()
+    const { totalAmount, todayAmount, userCount,todayUserCount } = res.data
     list.value = [
-      { id: 1, name: '用户数', data: userCount || 0, color: '#4e73df', icon: 'sfont system-yonghu' },
-      // { id: 2, name: '封禁人数', data: riskCount || 0, color: '#1cc88a', icon: 'sfont system-xiaoxi' },
-      { id: 3, name: '消费总额', data: consumeTotal || 0, color: '#36b9cc', icon: 'sfont system-shuliang_mianxing' },
-      { id: 4, name: '预估收益', data: parseFloat(incomeEstimate || 0).toFixed(2), color: '#f6c23e', icon: 'sfont system-jindutiaoshouyidaozhang' }
+      { id: 1, name: '用户数', data: userCount || 0, color: '#4e73df', icon: 'sfont system-yonghu' },
+      { id: 2, name: '当日增长用户数', data: todayUserCount || 0, color: '#1cc88a', icon: 'sfont system-xiaoxi' },
+      { id: 3, name: '总收益金额(元)', data: totalAmount || 0, color: '#36b9cc', icon: 'sfont system-shuliang_mianxing' },
+      { id: 4, name: '当日收益金额(元)', data: parseFloat(todayAmount || 0).toFixed(2), color: '#f6c23e', icon: 'sfont system-jindutiaoshouyidaozhang' }
     ]
   } catch (e) {
     console.log('错误', e)

+ 10 - 5
src/views/main/dashboard/components/card/row.vue

@@ -2,11 +2,11 @@
   <div class="card" :style="{ 'borderColor': row.color }">
     <div class="card-left">
       <div class="name">{{ row.name }}</div>
-      <div class="detail">{{ row.data }}</div>
+	  <div class="detail">{{ row.data }}</div>
     </div>
-    <div class="card-right">
+    <!-- <div class="card-right">
       <i :class="row.icon"></i>
-    </div>
+    </div> -->
   </div>
 </template>
 
@@ -43,21 +43,26 @@ export default defineComponent({
     margin: 10px;
     box-shadow: 3px 3px 10px 0 rgba(58, 59, 69, 0.15);
     &-left{
+	  width: 100%;
       display: flex;
       flex-direction: column;
       justify-content: center;
       align-items: flex-start;
       padding-left: 20px;
+	  padding-right: 20px;
       .name {
         line-height: 18px;
-        color: var(--system-page-tip-color);
+        // color: var(--system-page-tip-color);
+		color: #333;
         font-size: 16px;
         margin-bottom: 14px;
       }
       .detail {
-        font-size: 20px;
+        font-size: 24px;
         font-weight: bold;
         color: var(--system-page-color);
+		width: 100%;
+		text-align: right;
       }
     }
     &-right {

+ 202 - 99
src/views/main/dashboard/components/chartsModule/index.vue

@@ -8,10 +8,13 @@
           <span class="table-header">用户增长数量</span>
           <el-date-picker
             v-model="userDateRange"
+			@change="userDateRangeChange"
             type="daterange"
             range-separator="至"
             start-placeholder="开始日期"
             end-placeholder="结束日期"
+			format="YYYY-MM-DD"
+			value-format="YYYY-MM-DD"
             size="small"
             style="font-size: 12px;max-width: 220px;"
           />
@@ -25,10 +28,13 @@
           <span class="table-header">收益金额</span>
           <el-date-picker
             v-model="incomeDateRange"
+			@change="incomeDateRangeChange"
             type="daterange"
             range-separator="至"
             start-placeholder="开始日期"
             end-placeholder="结束日期"
+			format="YYYY-MM-DD"
+			value-format="YYYY-MM-DD"
             size="small"
             style="font-size: 12px;max-width: 220px;"
           />
@@ -42,14 +48,14 @@
       <!-- 付费收益表格 -->
       <div class="table-card">
         <div class="table-header">付费收益</div>
-        <el-table :data="payIncomeList" border style="width: 100%; font-size: 12px;">
+        <el-table ref="payIncomeTable" :data="payIncomeList" v-model:page="payIncomePage"  @getTableData="getPayIncome"  border style="width: 100%; font-size: 12px;">
           <el-table-column prop="name" label="名称" >
 			  <template #default="scope">
 				  <div style="display: flex;">
-					  <el-image style="width: 60px;height: 60px;border-radius: 50%;"></el-image>
+					  <el-image :src="scope.row.headImage" :preview-src-list="[scope.row.headImage]" fit="cover" preview-teleported="true"  style="min-width: 50px;height: 50px;border-radius: 50%;"></el-image>
 					  <div style="margin-left: 10px;">
 						  <div>
-							  昵称:{{ scope.row.userName }}
+							  昵称:{{ scope.row.nickName }}
 						  </div>
 						  <div>
 							  ID:{{ scope.row.userId }}
@@ -58,23 +64,31 @@
 				  </div>
 			  </template>
 		  </el-table-column>
-          <el-table-column prop="orderName" label="订单名称" />
-          <el-table-column prop="time" width="160" label="时间" />
-          <el-table-column prop="amount" width="100" label="收益金额(元)" />
+          <el-table-column prop="orderInfo" width="180" label="订单名称" />
+          <el-table-column prop="createTime" width="140" label="时间" >
+	          <template #default="scope">
+	            {{ formatDateFull(scope.row.createTime) || '--' }}
+	          </template>
+	        </el-table-column>
+          <el-table-column prop="channelEarningSum" width="100" label="收益金额(元)" />
         </el-table>
+		<el-pagination style="margin-top: 10px;" v-model:current-page="payIncomePage.pageNum" class="system-page" background
+		  layout="total, sizes, prev, pager, next, jumper" :total="payIncomePage.total" :page-size="payIncomePage.pageSize"
+		  @current-change="($event)=>handleCurrentChange($event,1)" @size-change="($event)=>handleSizeChange($event,1)">
+		</el-pagination>
       </div>
 
       <!-- 任务收益表格 -->
       <div class="table-card">
         <div class="table-header">任务收益</div>
-        <el-table :data="taskIncomeList" border style="width: 100%; font-size: 12px;">
+        <el-table ref="taskIncomeTable" :data="taskIncomeList" v-model:page="taskIncomePage"  @getTableData="getTaskIncome" border style="width: 100%; font-size: 12px;">
 		  <el-table-column prop="name" label="名称" >
 			  <template #default="scope">
 				  <div style="display: flex;">
-					  <el-image style="width: 60px;height: 60px;border-radius: 50%;"></el-image>
+					  <el-image :src="scope.row.headImage" :preview-src-list="[scope.row.headImage]" fit="cover" preview-teleported="true"  style="min-width: 50px;height: 50px;border-radius: 50%;"></el-image>
 					  <div style="margin-left: 10px;">
 						  <div>
-							  昵称:{{ scope.row.userName }}
+							  昵称:{{ scope.row.nickName }}
 						  </div>
 						  <div>
 							  ID:{{ scope.row.userId }}
@@ -83,11 +97,19 @@
 				  </div>
 			  </template>
 		  </el-table-column>
-          <el-table-column prop="type" width="100" label="类型" />
-          <el-table-column prop="taskName" label="任务名称" />
-          <el-table-column prop="time" width="160" label="时间" />
-          <el-table-column prop="amount" width="100" label="收益金额(元)" />
+          <el-table-column prop="consumptionType" width="100" label="类型" />
+          <el-table-column prop="taskTitle" label="任务名称" />
+          <el-table-column prop="createTime" width="140" label="时间" >
+	          <template #default="scope">
+	            {{ formatDateFull(scope.row.createTime) || '--' }}
+	          </template>
+	        </el-table-column>
+          <el-table-column prop="channelEarningSum" width="100" label="收益金额(元)" />
         </el-table>
+		<el-pagination style="margin-top: 10px;" v-model:current-page="taskIncomePage.pageNum" class="system-page" background
+		  layout="total, sizes, prev, pager, next, jumper" :total="taskIncomePage.total" :page-size="taskIncomePage.pageSize"
+		  @current-change="($event)=>handleCurrentChange($event,2)" @size-change="($event)=>handleSizeChange($event,2)">
+		</el-pagination>
       </div>
     </div>
   </div>
@@ -97,115 +119,188 @@
 import { ref, onMounted } from 'vue';
 import * as echarts from 'echarts';
 import { ElDatePicker, ElTable, ElTableColumn } from 'element-plus';
+import { statisticsHomePart2,statisticsHomePart3,statisticsHomePart4,statisticsHomePart5 } from '@/api/dashboard.js'
+import Table from "@/components/table/index.vue";
+import { formatDateFull } from '@/utils/index.js'
+// userId  beginTime   endTime
+// 工具函数:格式化日期为 YYYY-MM-DD 格式
+const formatDate = (date) => {
+  const year = date.getFullYear();
+  const month = String(date.getMonth() + 1).padStart(2, '0');
+  const day = String(date.getDate()).padStart(2, '0');
+  return `${year}-${month}-${day}`;
+};
+
+// 计算近7天的日期范围(当前日期的前6天 至 当前日期)
+const getRecent7Days = () => {
+  const endDate = new Date(); // 当前日期
+  const startDate = new Date();
+  startDate.setDate(endDate.getDate() - 6); // 前6天,合计7天
 
-// 日期范围数据
-const userDateRange = ref(['2026-01-08', '2026-01-08']);
-const incomeDateRange = ref(['2026-01-08', '2026-01-08']);
+  return [formatDate(startDate), formatDate(endDate)];
+};
+
+// 日期范围数据 - 默认值改为近7天
+const userDateRange = ref(getRecent7Days());
+const incomeDateRange = ref(getRecent7Days());
 
 // 图表容器ref
 const userChartRef = ref(null);
 const incomeChartRef = ref(null);
 
 // 付费收益表格数据
-const payIncomeList = ref([
-  {
-	userName: '用户名001',
-	userId: 'a123456',
-    orderName: '购买会员',
-    time: '2026.1.22 16:16',
-    amount: 99.32
-  },
-  {
-	userName: '用户名001',
-	userId: 'a123456',
-    orderName: '购买工具-刷新',
-    time: '2026.1.22 16:16',
-    amount: 99.32
-  },
-  {
-	userName: '用户名001',
-	userId: 'a123456',
-    orderName: '购买工具-置顶',
-    time: '2026.1.22 16:16',
-    amount: 99.32
-  }
-]);
+const payIncomeList = ref([]);
 
 // 任务收益表格数据
-const taskIncomeList = ref([
-  {
-	userName: '用户名001',
-	userId: 'a123456',
-    type: '悬赏',
-    taskName: '拼多多砍一刀...',
-    time: '2026.1.22 16:16',
-    amount: 1.00
-  },
-  {
-	userName: '用户名001',
-	userId: 'a123456',
-    type: '提现',
-    taskName: '-',
-    time: '2026.1.22 16:16',
-    amount: 1.20
-  }
-]);
-
+const taskIncomeList = ref([]);
+const userDateRangeChange = ()=>{
+	initUserChart()
+}
 // 初始化用户增长柱状图
 const initUserChart = () => {
   const chart = echarts.init(userChartRef.value);
-  chart.setOption({
-    tooltip: { trigger: 'axis' },
-    grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-    xAxis: {
-      type: 'category',
-      data: ['1号', '2号', '3号', '4号', '5号', '6号', '7号']
-    },
-    yAxis: { type: 'value', min: 0 },
-    series: [
-      {
-        data: [100, 150, 230, 100, 130, 160, 200],
-        type: 'bar',
-        itemStyle: { color: '#3370FF' }
-      }
-    ]
-  });
-  // 自适应窗口变化
-  window.addEventListener('resize', () => chart.resize());
+  var dateXArr = []
+  var userYArr = []
+  // 获取用户增长数量数据
+  statisticsHomePart2({
+	  beginTime:userDateRange.value[0]+'T00:00:00',
+	  endTime:userDateRange.value[1]+'T00:00:00',//+'T23:59:59',
+  }).then(res=>{
+	  if (res.data) {
+	        // 动态提取键值对到数组
+	        dateXArr = Object.keys(res.data);
+	        userYArr = Object.values(res.data);
+			chart.setOption({
+			  tooltip: { trigger: 'axis' },
+			  grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
+			  xAxis: {
+			    type: 'category',
+			    data: dateXArr || [],
+				axisLabel: {
+				   rotate: dateXArr.length > 7 ? -45 : 0, // 旋转标签
+				   fontSize: 10
+				 },
+			  },
+			  yAxis: { type: 'value', min: 0 },
+			  series: [
+			    {
+			      data: userYArr || [],
+			      type: 'bar',
+			      itemStyle: { color: '#3370FF' }
+			    }
+			  ]
+			});
+			// 自适应窗口变化
+			window.addEventListener('resize', () => chart.resize());
+	    }
+  })
 };
-
+const incomeDateRangeChange = ()=>{
+	initIncomeChart()
+}
 // 初始化收益金额折线图
 const initIncomeChart = () => {
   const chart = echarts.init(incomeChartRef.value);
-  chart.setOption({
-    tooltip: { trigger: 'axis' },
-    grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-    xAxis: {
-      type: 'category',
-      data: ['1号', '2号', '3号', '4号', '5号', '6号', '7号']
-    },
-    yAxis: { type: 'value', min: 0 },
-    series: [
-      {
-        data: [0, 230, 100, 130, 150, 170, 200],
-        type: 'line',
-        itemStyle: { color: '#3370FF' },
-        lineStyle: { color: '#3370FF' },
-        areaStyle: { color: 'rgba(51, 112, 255, 0.2)' }
-      }
-    ]
-  });
-  window.addEventListener('resize', () => chart.resize());
+  var XArr = []
+  var YArr = []
+  statisticsHomePart3({
+	  beginTime:incomeDateRange.value[0]+'T00:00:00',
+	  endTime:incomeDateRange.value[1]+'T00:00:00',//+'T23:59:59',
+  }).then(res=>{
+	  if (res.data) {
+	        // 动态提取键值对到数组
+	        XArr = Object.keys(res.data);
+	        YArr = Object.values(res.data);
+			chart.setOption({
+			  tooltip: { trigger: 'axis' },
+			  grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
+			  xAxis: {
+			    type: 'category',
+			    data: XArr || [],
+				axisLabel: {
+				   rotate: XArr.length > 7 ? -45 : 0, // 旋转标签
+				   fontSize: 10
+				 },
+			  },
+			  yAxis: { type: 'value', min: 0 },
+			  series: [
+			    {
+			      data: YArr || [],
+			      type: 'bar',
+			      itemStyle: { color: '#3370FF' }
+			    }
+			  ]
+			});
+			// 自适应窗口变化
+			window.addEventListener('resize', () => chart.resize());
+	    }
+  })
 };
-
+const payIncomePage = ref({
+	pageNum:1,
+	pageSize:10,
+	total:0,
+})
+const taskIncomePage = ref({
+	pageNum:1,
+	pageSize:10,
+	total:0,
+})
+// 获取付费收益
+const getPayIncome = ()=>{
+	statisticsHomePart4({
+		userId:null,
+		...payIncomePage.value
+	}).then(res=>{
+		payIncomeList.value = res.data.page.records
+		payIncomePage.value.total = res.data.page.total
+		
+	})
+}
+// 获取任务收益
+const getTaskIncome = ()=>{
+	statisticsHomePart5({
+		userId:null,
+		...taskIncomePage.value
+	}).then(res=>{
+		taskIncomeList.value = res.data.page.records
+		taskIncomePage.value.total = res.data.page.total
+	})
+}
+const handleCurrentChange = (val,type)=>{
+	console.log(val,type)
+	if(type == 1){
+		payIncomePage.value.pageNum = val
+		getPayIncome()
+	}else{
+		taskIncomePage.value.pageNum = val
+		getTaskIncome()
+	}
+}
+const handleSizeChange = (val,type)=>{
+	console.log(val,type)
+	if(type == 1){
+		payIncomePage.value.pageSize = val
+		getPayIncome()
+	}else{
+		taskIncomePage.value.pageSize = val
+		getTaskIncome()
+	}
+}
 // 页面挂载后初始化图表
 onMounted(() => {
+  // 获取用户增长数量统计图
   initUserChart();
+  // 获取收益金额统计图
   initIncomeChart();
+  // 获取付费收益列表
+  getPayIncome()
+  // 获取任务收益列表
+  getTaskIncome()
 });
 </script>
 
-<style scoped>
+<style scoped lang="scss">
 .dashboard-container {
   /* padding: 20px; */
   /* background: #F5F7FA; */
@@ -225,7 +320,9 @@ onMounted(() => {
   padding: 16px;
   box-shadow: 0 2px 8px rgba(0,0,0,0.05);
 }
-
+.table-card{
+	padding: 16px 16px 50px;
+}
 .chart-header {
   display: flex;
   justify-content: space-between;
@@ -240,4 +337,10 @@ onMounted(() => {
   margin-bottom: 12px;
   text-align: left;
 }
+.system-page {
+
+    &::before {
+      content: '';
+    }
+  }
 </style>

+ 38 - 25
src/views/main/userModule/userList.vue

@@ -65,13 +65,13 @@
 	      <el-button-group class="revenue-type-btn">
 	        <el-button
 	          :type="activeRevenueType === 'pay' ? 'primary' : 'default'"
-	          @click="activeRevenueType = 'pay'"
+	          @click="activeRevenueType = 'pay';changeTableDetail()"
 	        >
 	          付费收益
 	        </el-button>
 	        <el-button
 	          :type="activeRevenueType === 'task' ? 'primary' : 'default'"
-	          @click="activeRevenueType = 'task'"
+	          @click="activeRevenueType = 'task';changeTableDetail()"
 	        >
 	          任务收益
 	        </el-button>
@@ -107,7 +107,9 @@
 	          start-placeholder="开始日期"
 	          end-placeholder="结束日期"
 	          style="width: 240px; margin-left: 12px;"
-	          @change="fetchRevenueData"
+			  format="YYYY-MM-DD"
+			  value-format="YYYY-MM-DD"
+	          @change="fetchRevenueData();activeQuickDate=null"
 	        />
 	      </div>
 	    </div>
@@ -121,20 +123,20 @@
 	        border
 	        class="revenue-table"
 	        empty-text="暂无付费收益记录"
-			@getTableData="changeTableDetailData"
+			@getTableData="changeTableDetail"
 			v-model:page="pageDetail"
 			ref="table1"
 	        :header-cell-style="{ background: '#f5f7fa', color: '#606266', fontWeight: 500 }"
 	      >
-	        <el-table-column prop="orderName" label="订单名称" min-width="160" align="center" />
+	        <el-table-column prop="orderInfo" label="订单名称" min-width="160" align="center" />
 	        <el-table-column prop="createTime" label="时间" min-width="180" align="center">
 	          <template #default="scope">
 	            {{ formatDateFull(scope.row.createTime) || '--' }}
 	          </template>
 	        </el-table-column>
-	        <el-table-column prop="amount" label="收益金额(元)" min-width="140" align="center">
+	        <el-table-column prop="channelEarningSum" label="收益金额(元)" min-width="140" align="center">
 	          <template #default="scope">
-	            {{ scope.row.amount ? scope.row.amount.toFixed(2) : '0.00' }}
+	            {{ scope.row.channelEarningSum ? scope.row.channelEarningSum.toFixed(2) : '0.00' }}
 	          </template>
 	        </el-table-column>
 	      </Table>
@@ -146,24 +148,20 @@
 	        border
 	        class="revenue-table"
 	        empty-text="暂无任务收益记录"
-			@getTableData="changeTableDetailData"
+			@getTableData="changeTableDetail"
 			v-model:page="pageDetail"
 			ref="table2"
 	        :header-cell-style="{ background: '#f5f7fa', color: '#606266', fontWeight: 500 }"
 	      >
-	        <el-table-column prop="orderName" label="订单名称" min-width="160" align="center">
-	          <template #default="scope">
-	            {{ scope.row.taskType === 'reward' ? '悬赏' : '提现' }}
-	          </template>
-	        </el-table-column>
+	        <el-table-column prop="taskTitle" label="订单名称" min-width="160" align="center"></el-table-column>
 	        <el-table-column prop="createTime" label="时间" min-width="180" align="center">
 	          <template #default="scope">
 	            {{ formatDateFull(scope.row.createTime) || '--' }}
 	          </template>
 	        </el-table-column>
-	        <el-table-column prop="amount" label="收益金额(元)" min-width="140" align="center">
+	        <el-table-column prop="channelEarningSum" label="收益金额(元)" min-width="140" align="center">
 	          <template #default="scope">
-	            {{ scope.row.amount ? scope.row.amount.toFixed(2) : '0.00' }}
+	            {{ scope.row.channelEarningSum ? scope.row.channelEarningSum.toFixed(2) : '0.00' }}
 	          </template>
 	        </el-table-column>
 	      </Table>
@@ -189,6 +187,7 @@ import { ElMessage, ElLoading } from 'element-plus'
 import { View } from "@element-plus/icons-vue";
 import { invitationCodeUser,getUserList,orderPageList } from '@/api/userModule.js'
 import { convertUTCToBeijing, getTodayRangeLocal,formatDateFull } from '@/utils/index.js'
+import { statisticsHomePart4,statisticsHomePart5 } from '@/api/dashboard.js'
 import { useStore } from 'vuex'
 
 const store = useStore()
@@ -334,7 +333,6 @@ const handleQuickDate = (type) => {
   // 重新拉取收益数据
   fetchRevenueData();
 };
-
 // 3. 拉取收益数据(复用 orderPageList API,区分付费/任务类型)
 const fetchRevenueData = async () => {
   if (!currentViewUserId.value || !revenueDateRange.value.length) return;
@@ -343,15 +341,29 @@ const fetchRevenueData = async () => {
   const [startDate, endDate] = revenueDateRange.value;
   const params = {
     userId: currentViewUserId.value,
-    startTime: `${startDate} 00:00:00`,
-    endTime: `${endDate} 23:59:59`,
+    beginTime: `${startDate}T00:00:00`,
+    endTime: `${endDate}T00:00:00`,
     pageNum: pageDetail.pageNum,
     pageSize: pageDetail.pageSize
   };
 
   try {
-   
-
+	  // 付费收益
+	  if(activeRevenueType.value == 'pay'){
+		  // 获取付费收益
+		  	statisticsHomePart4(params).then(res=>{
+		  		payRevenueList.value = res.data.page.records
+		  		pageDetail.total = res.data.page.total
+				payTotalAmount.value = res.data.totalChannelEarningSum
+		  	})
+	  }else{
+		  // 获取任务收益
+		  	statisticsHomePart5(params).then(res=>{
+		  		taskRevenueList.value = res.data.page.records
+		  		pageDetail.total = res.data.page.total
+				taskTotalAmount.value = res.data.totalChannelEarningSum
+		  	})
+	  }
   } catch (error) {
     ElMessage.error('获取收益数据失败');
     console.error('收益数据请求错误:', error);
@@ -372,11 +384,12 @@ const handleView = async (row) => {
 };
 
 // 5. 重写 changeTableDetailData 方法(表格分页适配)
-// const changeTableDetailData = () => {
-//   pageDetail.pageNum = pageDetail.pageNum;
-//   pageDetail.pageSize = pageDetail.pageSize;
-//   fetchRevenueData(); // 分页时重新拉取收益数据
-// };
+const changeTableDetail = () => {
+  pageDetail.pageNum = pageDetail.pageNum;
+  pageDetail.pageSize = pageDetail.pageSize;
+  
+  fetchRevenueData(); // 分页时重新拉取收益数据
+};
 
 
 // 搜索

+ 1 - 0
vite.config.js

@@ -83,6 +83,7 @@ export default ({ command }) => {
       },
     },
     build: {
+	  outDir:'agency-dist',
       rollupOptions: {
         output: {
           manualChunks: {