Sfoglia il codice sorgente

首页统计接口增加

guanglong 3 anni fa
parent
commit
c5df8012cc
2 ha cambiato i file con 61 aggiunte e 5 eliminazioni
  1. 31 0
      src/api/admin/index.js
  2. 30 5
      src/views/index.vue

+ 31 - 0
src/api/admin/index.js

@@ -0,0 +1,31 @@
+import request from '@/utils/request'
+
+
+
+// 分粒度统计时间范围内的交易金额列表
+export function getPayAmtList(data) {
+  return request({
+    url: '/api/v1/mp/admin/index/pay/amt',
+    method: 'post',
+    data: data
+  })
+}
+
+// 分粒度统计时间范围内的交易人员数量列表
+export function getPayUserCntList(data) {
+  return request({
+    url: '/api/v1/mp/admin/index/pay/user',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 分粒度统计时间范围内的新增经销商数列表
+export function getSiteIncreaseList(data) {
+  return request({
+    url: '/api/v1/mp/admin/index/site/increase',
+    method: 'post',
+    data: data
+  })
+}

+ 30 - 5
src/views/index.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="coontent">
-    
+
   </div>
 </template>
 
 <script>
-
+import { getPayAmtList, getPayUserCntList, getSiteIncreaseList} from "@/api/admin/index";
 import echarts from "echarts"
 import moment from 'moment'
 import { mapGetters } from 'vuex'
@@ -13,12 +13,12 @@ import { numberFormat, getTimeResult } from "@/utils/util";
 export default {
   data() {
     return {
-      
+
     };
   },
   mounted: function () {
     this.$nextTick(function () {
-      
+
     });
   },
 
@@ -27,9 +27,34 @@ export default {
   },
 
   created() {
-    
+    //this.getPayAmtList()
+    // this.getPayUserCntList()
+    this.getSiteIncreaseList()
   },
   methods: {
+    getPayAmtList() {
+      getPayAmtList({level:"days",days:30}).then(res => {
+          console.log("getPayAmtList == "+JSON.stringify(res));
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+
+    getPayUserCntList() {
+      getPayUserCntList({level:"week",days:30}).then(res => {
+          console.log("getPayUserCntList == "+JSON.stringify(res));
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+
+    getSiteIncreaseList() {
+      getSiteIncreaseList({level:"month",days:30}).then(res => {
+          console.log("getSiteIncreaseList == "+JSON.stringify(res));
+      }).catch(() => {
+        this.loading = false
+      })
+    },
 
   },
 };