浏览代码

首页统计接口定义

guanglong 3 年之前
父节点
当前提交
547b43c216
共有 2 个文件被更改,包括 57 次插入8 次删除
  1. 26 1
      src/api/admin/index.js
  2. 31 7
      src/views/index.vue

+ 26 - 1
src/api/admin/index.js

@@ -1,6 +1,13 @@
 import request from '@/utils/request'
 
-
+// 统计今日实时交易金额、交易用户、盲票销售张数、新增经销商数量
+export function getDailyData(data) {
+  return request({
+    url: '/api/v1/mp/admin/index/daily',
+    method: 'post',
+    data: data
+  })
+}
 
 // 分粒度统计时间范围内的交易金额列表
 export function getPayAmtList(data) {
@@ -29,3 +36,21 @@ export function getSiteIncreaseList(data) {
     data: data
   })
 }
+
+// 统计票组销售TOP10
+export function getTicketBoxTop(data) {
+  return request({
+    url: '/api/v1/mp/admin/index/ticket/box/top',
+    method: 'post',
+    data: data
+  })
+}
+
+// 统计经销商交易额TOP10
+export function getTicketSiteTop(data) {
+  return request({
+    url: '/api/v1/mp/admin/index/ticket/site/top',
+    method: 'post',
+    data: data
+  })
+}

+ 31 - 7
src/views/index.vue

@@ -5,7 +5,7 @@
 </template>
 
 <script>
-import { getPayAmtList, getPayUserCntList, getSiteIncreaseList} from "@/api/admin/index";
+import { getDailyData,getPayAmtList, getPayUserCntList, getTicketBoxTop, getTicketSiteTop} from "@/api/admin/index";
 import echarts from "echarts"
 import moment from 'moment'
 import { mapGetters } from 'vuex'
@@ -27,11 +27,24 @@ export default {
   },
 
   created() {
-    this.getPayAmtList()
-    this.getPayUserCntList()
-    this.getSiteIncreaseList()
+    this.getDailyData()
+    //this.getPayAmtList()
+   //this.getPayUserCntList()
+    this.getTicketBoxTop()
+    this.getTicketSiteTop()
   },
   methods: {
+
+    // 统计今日实时交易金额、交易用户、盲票销售张数、新增经销商数量
+    getDailyData() {
+      getDailyData({}).then(res => {
+          console.log("getDailyData == "+JSON.stringify(res));
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+
+    // 统计交易金额(带粒度)
     getPayAmtList() {
       getPayAmtList({level:"days",days:30}).then(res => {
           console.log("getPayAmtList == "+JSON.stringify(res));
@@ -40,6 +53,7 @@ export default {
       })
     },
 
+    //统计交易用户数(带粒度)
     getPayUserCntList() {
       getPayUserCntList({level:"week",days:30}).then(res => {
           console.log("getPayUserCntList == "+JSON.stringify(res));
@@ -48,9 +62,19 @@ export default {
       })
     },
 
-    getSiteIncreaseList() {
-      getSiteIncreaseList({level:"month",days:30}).then(res => {
-          console.log("getSiteIncreaseList == "+JSON.stringify(res));
+    // 统计票组销售TOP10
+    getTicketBoxTop() {
+      getTicketBoxTop({days:30}).then(res => {
+          console.log("getTicketBoxTop == "+JSON.stringify(res));
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+
+    // 统计经销商交易额TOP10
+    getTicketSiteTop() {
+      getTicketSiteTop({days:30}).then(res => {
+          console.log("getTicketSiteTop == "+JSON.stringify(res));
       }).catch(() => {
         this.loading = false
       })