Browse Source

代理商增加各类广告收益

marxjaw 2 tuần trước cách đây
mục cha
commit
0de35d6449
2 tập tin đã thay đổi với 47 bổ sung3 xóa
  1. 9 0
      src/api/userModule.js
  2. 38 3
      src/views/main/userModule/components/ecpmDialog.vue

+ 9 - 0
src/api/userModule.js

@@ -54,6 +54,15 @@ export function appUserEcpm(data) {
     })
 }
 
+//查询各类广告数据统计值
+export function getEcpmStatics(data) {
+    return request({
+        url: '/agent-service/appUser/ecpm/statistic',
+        method: 'post',
+        data
+    })
+}
+
 // 根据时间获取收益
 export function getRevenueByTime(data) {
     return request({

+ 38 - 3
src/views/main/userModule/components/ecpmDialog.vue

@@ -37,6 +37,14 @@
                     </template>
                 </el-table-column>
             </Table>
+            <div class="pagination-footer">
+              <div class="footer-left">
+              </div>
+              <div class="footer-right">
+                <span class="total-revenue-label">合计收益:</span>
+                <span class="total-revenue-value">{{ totalRevenue }}</span>
+              </div>
+            </div>
         </div>
     </div>
 </template>
@@ -45,7 +53,7 @@
 import { onBeforeMount, ref, reactive, watch } from "vue";
 import { useGetDictList } from '@/hooks/useGetDictList.js'
 import { roundPrice } from '@/utils/index.js'
-import { appUserEcpm } from '@/api/userModule.js'
+import {appUserEcpm, getEcpmStatics} from '@/api/userModule.js'
 import From from "@/components/from/index.vue";
 import Table from "@/components/table/index.vue";
 
@@ -66,6 +74,7 @@ const { loadDictData, getOptions, getDictionaryName } = useGetDictList();
 const table = ref(null)
 const loading = ref(false)
 const tableData = ref([]);
+const totalRevenue = ref(0)
 
 const dynamicFormItems = ref([
     {
@@ -111,6 +120,11 @@ const getList = async () => {
     page.total = res.pageMeta.total;
 };
 
+// 查询统计数据
+const getStatics = async () => {
+  let res = await getEcpmStatics({...formSearch.value});
+  totalRevenue.value = res.data? res.data.totalRevenue: 0.00
+}
 
 // 分页切换
 const changeTableData = (type) => {
@@ -127,6 +141,7 @@ const handleFormSubmitted = (formData) => {
     formSearch.value.loginStatus = formData.loginStatus || undefined;
 
     getList();
+    getStatics();
 };
 
 // 表单重置
@@ -142,9 +157,9 @@ const handleFormReset = async() => {
     page.pageNum = 1
     page.pageSize = 20
     page.total = 0
-
     await getFormOptions()
     await getList();
+    await getStatics();
 };
 
 const getFormOptions = async() => {
@@ -162,6 +177,7 @@ watch(() => props.ecpmData, (newVal) => {
     formSearch.value.userId = props.ecpmData.userId
 
     getList()
+    getStatics()
 }, { immediate: true, deep: true })
 
 onBeforeMount(() => {
@@ -170,4 +186,23 @@ onBeforeMount(() => {
 
 </script>
 
-<style lang='scss' scoped></style>
+<style lang='scss' scoped>
+.pagination-footer {
+  display: flex;
+  justify-content: space-between; /* 左右分布 */
+  align-items: center;
+  margin-top: 15px;
+  padding: 0 10px;
+}
+
+.footer-right {
+  font-size: 14px;
+  color: #606266;
+}
+
+.total-revenue-value {
+  font-weight: bold;
+  color: #f56c6c; /* 使用红色或主题色强调金额 */
+  font-size: 16px;
+}
+</style>