Browse Source

Merge branch 'dev' into 'master'

Dev

See merge request motive-power/yxl/yxl-web-admin-frontend!23
梁展鹏 3 years ago
parent
commit
0e154b3174

+ 8 - 0
src/api/statistics/index.js

@@ -0,0 +1,8 @@
+import api from '@/utils/request';
+
+export const getDownloadCount = params =>
+  api.post(`/yxl-back-end/admin/data/statistics/download/count`, params);
+export const getDownloadPage = params =>
+  api.post(`/yxl-back-end/admin/data/statistics/download/page`, params);
+export const getUploadPage = params =>
+  api.post(`/yxl-back-end​/admin​/data​/statistics​/upload​/page`, params);

+ 3 - 1
src/api/statistics/withdrawalRecord.js

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

+ 1 - 1
src/components/BaseTable.vue

@@ -73,7 +73,7 @@
       <el-pagination
       <el-pagination
         v-if="showPage"
         v-if="showPage"
         background
         background
-        layout="prev, pager, next"
+        layout="prev, pager, next, total"
         :current-page="pagination.page"
         :current-page="pagination.page"
         :page-size="pagination.pageSize"
         :page-size="pagination.pageSize"
         :total="pagination.total"
         :total="pagination.total"

+ 42 - 4
src/views/login/index.vue

@@ -28,10 +28,10 @@
             slot="suffix"
             slot="suffix"
             class="inline-btn"
             class="inline-btn"
             type="primary"
             type="primary"
-            :disabled="!validPhone(loginForm.phone)"
-            @click="dialogVisible = true"
+            :disabled="!canBtn"
+            @click="handlerGetCode"
           >
           >
-            获取验证码
+            {{btnTxt}}
           </el-button>
           </el-button>
         </el-input>
         </el-input>
       </el-form-item>
       </el-form-item>
@@ -88,6 +88,7 @@
 import { validPhone } from '@/utils/validate';
 import { validPhone } from '@/utils/validate';
 import { getImgCode, getSMSCode } from '@/api/user';
 import { getImgCode, getSMSCode } from '@/api/user';
 
 
+
 export default {
 export default {
   name: 'Login',
   name: 'Login',
   data() {
   data() {
@@ -120,9 +121,27 @@ export default {
 
 
       dialogVisible: false,
       dialogVisible: false,
       info: {},
       info: {},
-      point: ''
+      point: '',
+
+      time: 60,
+      timer: null
     };
     };
   },
   },
+
+  computed: {
+    canBtn() {
+      const { time, loginForm}= this
+      let b = validPhone(loginForm.phone) && this.timer === null
+      return b
+    },
+    btnTxt() {
+      if (this.timer !== null) {
+        return `${this.time}秒`
+      }
+      return '获取验证码'
+    }
+  },
+
   watch: {
   watch: {
     $route: {
     $route: {
       handler: function(route) {
       handler: function(route) {
@@ -152,7 +171,26 @@ export default {
     }
     }
   },
   },
 
 
+  beforeDestroy() {
+      if (this.timer) { clearInterval(this.timer); this.timer= null}
+
+    },
+
   methods: {
   methods: {
+    handlerGetCode() {
+      if (this.timer) { clearInterval(this.timer); this.timer= null}
+      this.timer = setInterval(() => {
+        if (this.time > 0) {
+          this.time -= 1;
+        }
+        if (this.time <= 0) {
+          this.time = 60;
+          clearInterval(this.timer);
+          this.timer = null
+        }
+      }, 1000);
+      this.dialogVisible = true
+    },
     handleLogin() {
     handleLogin() {
       this.$refs.loginForm.validate(valid => {
       this.$refs.loginForm.validate(valid => {
         if (valid) {
         if (valid) {

+ 96 - 11
src/views/statistics/downloadImage/index.vue

@@ -1,5 +1,21 @@
 <template>
 <template>
   <div class="">
   <div class="">
+    <div
+      class="m-10 bg-w p-20 br-10 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.countDownload}}</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.sumPaidPrice}}</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.sumPoints}}</div>
+        </div>
+      </div>
+
     <toolbar @on-filter="filterData" @on-reset="filterData" />
     <toolbar @on-filter="filterData" @on-reset="filterData" />
 
 
     <base-table
     <base-table
@@ -15,6 +31,7 @@
 <script>
 <script>
 import toolbar from './toolbar';
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
 import mxFilterList from '@/mixins/filterList';
+import { getDownloadPage,getDownloadCount } from '@/api/statistics';
 
 
 export default {
 export default {
   name: 'DownloadImage',
   name: 'DownloadImage',
@@ -23,7 +40,7 @@ export default {
 
 
   mixins: [
   mixins: [
     mxFilterList({
     mxFilterList({
-      // fetchList: iGetList // 在下方data再声明一个 fetchList: iGetList 同等效果
+      fetchList: getDownloadPage // 在下方data再声明一个 fetchList: iGetList 同等效果
     })
     })
   ],
   ],
 
 
@@ -31,27 +48,95 @@ export default {
     return {
     return {
       columns: [
       columns: [
         {
         {
-          key: 'photo',
-          name: '用户名称',
+          key: 'orderId',
+          name: '订单编号',
           width: '160'
           width: '160'
         },
         },
         {
         {
-          key: 'region',
-          name: '手机号',
-          width: '180'
+          key: 'listPreview',
+          name: '图片',
+          width: '180',
+          render: (h, { row }) =>
+            h('img', {
+              style: {
+                width: '160px',
+                height: '90px'
+              },
+              class: 'pre-img',
+              attrs: {
+                src: row.listPreview
+              },
+              on: {
+                click: () =>
+                  this.$AdvanceViewImageModal({
+                    items: [{ src: row.listPreview }]
+                  })
+              }
+            })
+        },
+        {
+          key: 'kindergartenName',
+          name: '幼儿园',
+          minWidth: '120'
         },
         },
         {
         {
-          key: 'region',
-          name: '反馈内容',
+          key: 'activityName',
+          name: '活动',
           minWidth: '120'
           minWidth: '120'
         },
         },
         {
         {
-          key: 'region',
-          name: '反馈时间',
+          key: 'nickname',
+          name: '下载用户',
+          width: '140'
+        },
+        {
+          key: 'payablePrice',
+          name: '花费金额',
+          width: '140',
+          render: (h,{row}) => h('span',`¥${row.payablePrice}`)
+        },
+        {
+          key: 'photoTime',
+          name: '拍摄时间',
+          width: '140'
+        },
+        {
+          key: 'createAt',
+          name: '下载时间',
           width: '140'
           width: '140'
         }
         }
-      ]
+      ],
+      statistics: {}
     };
     };
+  },
+
+  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 getDownloadCount(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>
 </script>

+ 16 - 7
src/views/statistics/downloadImage/toolbar.vue

@@ -11,20 +11,29 @@ export default {
       fields: [
       fields: [
         {
         {
           type: 'text',
           type: 'text',
-          name: 'title',
-          label: '用户名称'
+          name: 'orderId',
+          label: '订单编号'
+        },
+        {
+          type: 'SceneSelect',
+          name: 'kindergartenId',
+          label: '幼儿园',
+        },
+        {
+          type: 'ActivitySelect',
+          name: 'activityId',
+          label: '活动',
         },
         },
         {
         {
           type: 'text',
           type: 'text',
-          name: 'status',
-          label: '用户手机号',
-          labelWidth: '100px'
+          name: 'nickname',
+          label: '上传用户',
         },
         },
         {
         {
           type: 'dateArray',
           type: 'dateArray',
           name: 'date',
           name: 'date',
-          label: '反馈日期',
-          apiName: ['start', 'end']
+          label: '选择日期',
+          apiName: ['startTime', 'endTime']
         }
         }
       ]
       ]
     };
     };

+ 32 - 9
src/views/statistics/uploadImage/index.vue

@@ -15,6 +15,8 @@
 <script>
 <script>
 import toolbar from './toolbar';
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
 import mxFilterList from '@/mixins/filterList';
+import { getUploadPage } from '@/api/statistics';
+
 
 
 export default {
 export default {
   name: 'UploadImage',
   name: 'UploadImage',
@@ -23,7 +25,7 @@ export default {
 
 
   mixins: [
   mixins: [
     mxFilterList({
     mxFilterList({
-      // fetchList: iGetList // 在下方data再声明一个 fetchList: iGetList 同等效果
+      fetchList: getUploadPage // 在下方data再声明一个 fetchList: iGetList 同等效果
     })
     })
   ],
   ],
 
 
@@ -31,25 +33,46 @@ export default {
     return {
     return {
       columns: [
       columns: [
         {
         {
-          key: 'photo',
+          key: 'kindergartenName',
+          name: '幼儿园',
+          minWidth: '120'
+        },
+        {
+          key: 'activityName',
+          name: '活动',
+          minWidth: '120'
+        },
+        {
+          key: 'nickname',
           name: '用户名称',
           name: '用户名称',
           width: '160'
           width: '160'
         },
         },
         {
         {
-          key: 'region',
+          key: 'phonenumber',
           name: '手机号',
           name: '手机号',
           width: '180'
           width: '180'
         },
         },
         {
         {
-          key: 'region',
-          name: '反馈内容',
+          key: 'isTakeTrue',
+          name: '手机上传数',
           minWidth: '120'
           minWidth: '120'
         },
         },
         {
         {
-          key: 'region',
-          name: '反馈时间',
-          width: '140'
-        }
+          key: 'isTakeFalse',
+          name: '电脑上传数',
+          minWidth: '120'
+        },
+        {
+          key: 'isTake',
+          name: '总上传数',
+          width: '140',
+          render:(h, {row}) => h('span', `${row.isTakeTrue+row.isTakeFalse}`)
+        },
+        {
+          key: 'createAt',
+          name: '上传时间',
+          minWidth: '120'
+        },
       ]
       ]
     };
     };
   }
   }

+ 17 - 7
src/views/statistics/uploadImage/toolbar.vue

@@ -9,22 +9,32 @@ export default {
   data() {
   data() {
     return {
     return {
       fields: [
       fields: [
+
+        {
+          type: 'SceneSelect',
+          name: 'kindergartenId',
+          label: '幼儿园',
+        },
+        {
+          type: 'ActivitySelect',
+          name: 'activityId',
+          label: '活动',
+        },
         {
         {
           type: 'text',
           type: 'text',
-          name: 'title',
-          label: '用户名称'
+          name: 'phonenumber',
+          label: '手机号码',
         },
         },
         {
         {
           type: 'text',
           type: 'text',
-          name: 'status',
-          label: '用户手机号',
-          labelWidth: '100px'
+          name: 'nickname',
+          label: '用户名',
         },
         },
         {
         {
           type: 'dateArray',
           type: 'dateArray',
           name: 'date',
           name: 'date',
-          label: '反馈日期',
-          apiName: ['start', 'end']
+          label: '选择日期',
+          apiName: ['startTime', 'endTime']
         }
         }
       ]
       ]
     };
     };

+ 48 - 2
src/views/statistics/withdrawalRecord/index.vue

@@ -1,5 +1,21 @@
 <template>
 <template>
   <div class="">
   <div class="">
+    <div
+      class="m-10 bg-w p-20 br-10 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.sumPaidPrice}}</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.undrawnAmount}}</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.withdrawalAmount}}</div>
+        </div>
+      </div>
+
     <toolbar @on-filter="filterData" @on-reset="filterData" />
     <toolbar @on-filter="filterData" @on-reset="filterData" />
 
 
     <base-table
     <base-table
@@ -15,7 +31,7 @@
 <script>
 <script>
 import toolbar from './toolbar';
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
 import mxFilterList from '@/mixins/filterList';
-import { getPage } from '@/api/statistics/withdrawalRecord';
+import { getPage,getCount } from '@/api/statistics/withdrawalRecord';
 
 
 export default {
 export default {
   name: 'WithdrawalRecord',
   name: 'WithdrawalRecord',
@@ -131,7 +147,8 @@ export default {
             return h('div', action);
             return h('div', action);
           }
           }
         }
         }
-      ]
+      ],
+      statistics: {}
     };
     };
   },
   },
   created() {
   created() {
@@ -140,6 +157,35 @@ export default {
 
 
   beforeDestroy() {
   beforeDestroy() {
     this.$g_off('withdrawal_record_reload', this.reload);
     this.$g_off('withdrawal_record_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>
 </script>