Просмотр исходного кода

幼儿园认证、摄影师认证、摄影师上传照片统计、总/月/周

梁展鹏 3 лет назад
Родитель
Сommit
eada427e03

+ 2 - 0
src/api/photoWarehouse/index.js

@@ -2,6 +2,8 @@ import api from '@/utils/request';
 
 export const getPage = params =>
 	api.post(`/yxl-back-end/admin/photo-warehouse/page`, params);
+export const getCount = params =>
+	api.post(`/yxl-back-end/admin/photo-warehouse/count`, params);
 export const getItem = ({ id, ...params }) =>
 	api.get(`/yxl-back-end/admin/photo-warehouse/${id}`, params);
 export const saveItem = params =>

+ 2 - 0
src/api/photoer/index.js

@@ -2,6 +2,8 @@ import api from '@/utils/request';
 
 export const getPage = params =>
 	api.post(`/yxl-back-end/admin/photoer/page`, params);
+export const getCount = params =>
+	api.post(`/yxl-back-end/admin/photoer/count`, params);
 export const getItem = ({ id, ...params }) =>
 	api.get(`/yxl-back-end/admin/photoer/${id}`, params);
 export const auditItem = ({ id, ...params }) =>

+ 2 - 0
src/api/scene/index.js

@@ -2,6 +2,8 @@ import api from '@/utils/request';
 
 export const getPage = params =>
 	api.post(`/yxl-back-end/admin/kindergarten/page`, params);
+export const getCount = params =>
+	api.post(`/yxl-back-end/admin/kindergarten/count`, params);
 export const getList = params =>
 	api.post(`/yxl-back-end/admin/kindergarten/list`, params);
 export const getItem = ({ id, ...params }) =>

+ 52 - 1
src/views/photographerManagement/photoVerify/index.vue

@@ -1,5 +1,28 @@
 <template>
   <div class="">
+    <div class="m-10 bg-w p-20 br-10">
+      <div class="f-sa-s">
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">总下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.all }}
+          </div>
+        </div>
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">月下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.month }}
+          </div>
+        </div>
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">周下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.week }}
+          </div>
+        </div>
+      </div>
+    </div>
+
     <toolbar @on-filter="filterData" @on-reset="filterData" />
 
     <div class="m-10 bg-w p-20 br-10">
@@ -23,7 +46,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getPage, delItem } from '@/api/photoWarehouse';
+import { getPage, getCount, delItem } from '@/api/photoWarehouse';
 
 export default {
   name: 'PhotoVerify',
@@ -38,6 +61,7 @@ export default {
 
   data() {
     return {
+      statistics: {},
       columns: [
         {
           key: 'id',
@@ -165,6 +189,33 @@ export default {
         this.$success('删除成功!');
         this.$g_emit('photo_reload');
       }
+    },
+    async pageChange(page) {
+      this.pagination.page = page;
+      const inParams = {
+        ...this.filter,
+        ...this.internalFilterObj,
+        page: this.pagination.page,
+        size: this.pagination.pageSize
+      };
+
+      const { data, msg } = await this.apiList(inParams, {
+        limit: this.pagination.pageSize,
+        start: this.pagination.page
+      });
+
+      const res2 = await getCount(inParams)
+      this.statistics = res2.data
+      if ('data' in data) {
+        const items = data.data;
+        if (items.length === 0 && this.pagination.page > 1) {
+          this.pageChange(1);
+        } else {
+          this.items = items;
+          this.pagination.total = data.total;
+        }
+        this.loadCallBack(data);
+      }
     }
   }
 };

+ 55 - 1
src/views/photographerManagement/photographerVerify/index.vue

@@ -1,5 +1,28 @@
 <template>
   <div class="">
+    <div class="m-10 bg-w p-20 br-10">
+      <div class="f-sa-s">
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">总下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.all }}
+          </div>
+        </div>
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">月下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.month }}
+          </div>
+        </div>
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">周下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.week }}
+          </div>
+        </div>
+      </div>
+    </div>
+
     <toolbar @on-filter="filterData" @on-reset="filterData" />
 
     <base-table
@@ -15,7 +38,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getPage } from '@/api/photoer';
+import { getPage, getCount } from '@/api/photoer';
 
 export default {
   name: 'PhotographerVerify',
@@ -30,6 +53,7 @@ export default {
 
   data() {
     return {
+      statistics: {},
       columns: [
         {
           key: 'realName',
@@ -140,6 +164,36 @@ export default {
 
   beforeDestroy() {
     this.$g_off('photoer_reload', this.reload);
+  },
+
+  methods: {
+    async pageChange(page) {
+      this.pagination.page = page;
+      const inParams = {
+        ...this.filter,
+        ...this.internalFilterObj,
+        page: this.pagination.page,
+        size: this.pagination.pageSize
+      };
+
+      const { data, msg } = await this.apiList(inParams, {
+        limit: this.pagination.pageSize,
+        start: this.pagination.page
+      });
+
+      const res2 = await getCount(inParams)
+      this.statistics = res2.data
+      if ('data' in data) {
+        const items = data.data;
+        if (items.length === 0 && this.pagination.page > 1) {
+          this.pageChange(1);
+        } else {
+          this.items = items;
+          this.pagination.total = data.total;
+        }
+        this.loadCallBack(data);
+      }
+    }
   }
 };
 </script>

+ 52 - 1
src/views/sceneManagement/sceneList/index.vue

@@ -1,5 +1,28 @@
 <template>
   <div class="">
+    <div class="m-10 bg-w p-20 br-10">
+      <div class="f-sa-s">
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">总下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.all }}
+          </div>
+        </div>
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">月下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.month }}
+          </div>
+        </div>
+        <div class="f-fs-c f-col">
+          <div style="font-size: 16px;">周下载量</div>
+          <div class="mt-4" style="font-weight: bold; font-size: 18px;">
+            {{ statistics.week }}
+          </div>
+        </div>
+      </div>
+    </div>
+
     <toolbar @on-filter="filterData" @on-reset="filterData" />
 
     <div class="m-10 bg-w p-20 br-10">
@@ -17,7 +40,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getPage, delItem, sendCode } from '@/api/scene';
+import { getPage, getCount, delItem, sendCode } from '@/api/scene';
 
 export default {
   name: 'SceneList',
@@ -36,6 +59,7 @@ export default {
 
   data() {
     return {
+      statistics: {},
       columns: [
         {
           key: 'name',
@@ -187,6 +211,33 @@ export default {
         this.$success('删除成功!');
         this.$g_emit('scene_reload');
       }
+    },
+    async pageChange(page) {
+      this.pagination.page = page;
+      const inParams = {
+        ...this.filter,
+        ...this.internalFilterObj,
+        page: this.pagination.page,
+        size: this.pagination.pageSize
+      };
+
+      const { data, msg } = await this.apiList(inParams, {
+        limit: this.pagination.pageSize,
+        start: this.pagination.page
+      });
+
+      const res2 = await getCount(inParams)
+      this.statistics = res2.data
+      if ('data' in data) {
+        const items = data.data;
+        if (items.length === 0 && this.pagination.page > 1) {
+          this.pageChange(1);
+        } else {
+          this.items = items;
+          this.pagination.total = data.total;
+        }
+        this.loadCallBack(data);
+      }
     }
   }
 };