소스 검색

Merge branch 'dev' into 'test'

Dev

See merge request quanshu/mp-ui-pc!121
hunagwb 3 년 전
부모
커밋
70833e2dee
3개의 변경된 파일63개의 추가작업 그리고 10개의 파일을 삭제
  1. 26 1
      src/api/admin/index.js
  2. 6 2
      src/views/business/ticket/detail.vue
  3. 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
+  })
+}

+ 6 - 2
src/views/business/ticket/detail.vue

@@ -67,7 +67,12 @@
                 </el-image>
               </template>
             </el-table-column>
-            <el-table-column label="奖品名称" prop="title" />
+            <el-table-column label="奖品名称" prop="title">
+              <template slot-scope="{ row }">
+                <div v-if="row.prizeType.value == 'coin'">盲豆x {{ row.value }}</div>
+                <div v-else>{{ row.title }}</div>
+              </template>
+            </el-table-column>
             <el-table-column label="奖品类型" align="center">
               <template slot-scope="{ row }">
                 <div v-if="row.prizeType.value == 'goods'">商品</div>
@@ -108,7 +113,6 @@ export default {
       ticketBoxDetail({ boxId: this.boxId })
         .then((res) => {
           this.loading = false;
-          console.log("res", res);
           if (res.code == 0) {
             let data = res.data;
             this.info = {

+ 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
       })