yuhao 2 年 前
コミット
8b5fbcf9ee
共有6 個のファイルを変更した140 個の追加16 個の削除を含む
  1. BIN
      public/favicon1.ico
  2. 2 2
      public/index.html
  3. 118 0
      src/views/BprogramAmount/BprogramAmount.vue
  4. 1 1
      src/views/cardExpend/cardExpend.vue
  5. 18 2
      src/views/demo02.vue
  6. 1 11
      src/views/programAmount/programAmount.vue

BIN
public/favicon1.ico


+ 2 - 2
public/index.html

@@ -5,9 +5,9 @@
5 5
   <meta charset="utf-8">
6 6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 7
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
8
-  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
+  <link rel="icon" href="<%= BASE_URL %>favicon1.ico">
9 9
   <title>
10
-    <%= htmlWebpackPlugin.options.title %>
10
+    JOLIJOLI数据
11 11
   </title>
12 12
   <style>
13 13
     body {

+ 118 - 0
src/views/BprogramAmount/BprogramAmount.vue

@@ -0,0 +1,118 @@
1
+<template>
2
+  <div class="chinaMap">
3
+    <div class="map" ref="MapMountNode"></div>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  props: ["listData"],
10
+  data() {
11
+    return {};
12
+  },
13
+  methods: {
14
+    //先定义个方法
15
+    myEcharts() {
16
+      //把echarts绑定到显示元素上
17
+      const myChart = this.$echarts.init(this.$refs.MapMountNode);
18
+      //设置图表属性
19
+      //   经营数据
20
+      const option = {
21
+        color: ["#fc8452"],
22
+        tooltip: {
23
+          trigger: "axis",
24
+          axisPointer: {
25
+            type: "shadow",
26
+          },
27
+        },
28
+        grid: {
29
+          left: "7%",
30
+          right: "4%",
31
+          bottom: "3%",
32
+          top:'1%',
33
+          containLabel: true,
34
+        },
35
+        xAxis: [
36
+          {
37
+            type: "value",
38
+          },
39
+        ],
40
+        yAxis: [
41
+          {
42
+            type: "category",
43
+            axisTick: {
44
+              show: false,
45
+            },
46
+            data: [
47
+              "单次三个项目",
48
+              "单次两个项目",
49
+              "三次到店用户数",
50
+              "两次到店用户数",
51
+              "总用户数",
52
+            ],
53
+          },
54
+        ],
55
+        series: [
56
+          {
57
+            name: "数量",
58
+            type: "bar",
59
+            label: {
60
+              show: true,
61
+              position: "inside",
62
+            },
63
+            emphasis: {
64
+              focus: "series",
65
+            },
66
+            itemStyle: {
67
+              normal: {
68
+                label: {
69
+                  show: true, //开启显示数值
70
+                  position: "right", //数值在上方显示
71
+                  textStyle: {
72
+                    //数值样式
73
+                    color: "#9b9ca2", //字体颜色
74
+                    fontSize: 14, //字体大小
75
+                  },
76
+                },
77
+              },
78
+            },
79
+            data: [
80
+              this.listData.three_project,
81
+              this.listData.two_project,
82
+              this.listData.user_three,
83
+              this.listData.user_two,
84
+              this.listData.total_user,
85
+            ],
86
+          },
87
+        ],
88
+      };
89
+
90
+      //数据绑定到表格
91
+      myChart.setOption(option);
92
+      window.addEventListener("resize", function () {
93
+        myChart.resize(); //myChart指自己定义的echartsDom对象
94
+      });
95
+    },
96
+  },
97
+  // 监听父组件传过来的值的变化
98
+  watch: {
99
+    listData: {
100
+      handler(val) {
101
+        this.myEcharts();
102
+      },
103
+    },
104
+  },
105
+  mounted() {
106
+    this.myEcharts();
107
+  },
108
+};
109
+</script>
110
+
111
+<style scoped>
112
+.map {
113
+  width: 96%;
114
+  /* height: 280px; */
115
+  height: 22vh;
116
+  /* border: 1px solid saddlebrown; */
117
+}
118
+</style>

+ 1 - 1
src/views/cardExpend/cardExpend.vue

@@ -31,7 +31,7 @@ export default {
31 31
         },
32 32
         xAxis: {
33 33
           type: "category",
34
-          data: ["次卡购买总次数", "次卡剩余人数", "卡剩余总数"],
34
+          data: ["次卡购买总次数", "次卡剩余人数", "卡剩余总数"],
35 35
           axisLabel: { interval: 0, rotate: 30 },
36 36
         },
37 37
         yAxis: {

+ 18 - 2
src/views/demo02.vue

@@ -99,6 +99,14 @@
99 99
               ></programAmount
100 100
             ></el-card>
101 101
           </div>
102
+          <div class="center-center">
103
+            <el-card
104
+              ><BprogramAmount
105
+                v-if="listData"
106
+                :listData="listData"
107
+              ></BprogramAmount
108
+            ></el-card>
109
+          </div>
102 110
           <div class="center-bottom">
103 111
             <el-card
104 112
               ><div>
@@ -150,6 +158,7 @@ import productRatio from "./productRatio/productRatio.vue";
150 158
 import rechargeData from "./rechargeData/rechargeData.vue";
151 159
 import cardExpend from "./cardExpend/cardExpend.vue";
152 160
 import productData from "./productData/productData.vue";
161
+import BprogramAmount from "./BprogramAmount/BprogramAmount.vue";
153 162
 import { getStoreList, getData } from "../api/index"; //获取店铺列表和数据大屏数据
154 163
 export default {
155 164
   components: {
@@ -162,6 +171,7 @@ export default {
162 171
     rechargeData,
163 172
     cardExpend,
164 173
     productData,
174
+    BprogramAmount
165 175
   },
166 176
   data() {
167 177
     return {
@@ -291,11 +301,12 @@ export default {
291 301
     // 选择时间
292 302
     selectTime(e) {
293 303
       var startTime = this.getDateStr(e[0]) + " 00:00:00";
294
-      var endTime = this.getDateStr(e[1]) + " 00:00:00";
304
+      var endTime = this.getDateStr(e[1]) + " 23:59:59";
295 305
       var start_time = Date.parse(startTime) / 1000;
296 306
       var end_time = Date.parse(endTime) / 1000;
297 307
       this.start_time = start_time;
298 308
       this.end_time = end_time;
309
+      console.log(start_time, end_time);
299 310
       this.getListData();
300 311
     },
301 312
     // 刷新页面
@@ -409,7 +420,12 @@ export default {
409 420
       height: 100%;
410 421
       margin-right: 15px;
411 422
       .center-top {
412
-        height: 73%;
423
+        height: 41%;
424
+        width: 100%;
425
+      }
426
+      .center-center {
427
+        margin-top: 15px;
428
+        height: 30%;
413 429
         width: 100%;
414 430
       }
415 431
       .center-bottom {

+ 1 - 11
src/views/programAmount/programAmount.vue

@@ -49,7 +49,6 @@ export default {
49 49
               show: false,
50 50
             },
51 51
             data: [
52
-              "总用户数",
53 52
               "总测肤用户数",
54 53
               "付费总用户数",
55 54
               "充值总用户数",
@@ -57,10 +56,6 @@ export default {
57 56
               "美妆购买总用户数",
58 57
               "新注册用户数",
59 58
               "新测肤用户数",
60
-              "单次两个项目",
61
-              "3次到店用户数",
62
-              "单次三个项目",
63
-              "2次到店用户数",
64 59
             ],
65 60
           },
66 61
         ],
@@ -89,7 +84,6 @@ export default {
89 84
               },
90 85
             },
91 86
             data: [
92
-              this.listData.total_user,
93 87
               this.listData.total_skin,
94 88
               this.listData.total_consumer_user,
95 89
               this.listData.total_recharge_user,
@@ -97,10 +91,6 @@ export default {
97 91
               this.listData.beauty_products,
98 92
               this.listData.new_user,
99 93
               this.listData.new_skin,
100
-              this.listData.two_project,
101
-              this.listData.user_three,
102
-              this.listData.three_project,
103
-              this.listData.user_two,
104 94
             ],
105 95
           },
106 96
         ],
@@ -131,7 +121,7 @@ export default {
131 121
 .map {
132 122
   width: 96%;
133 123
   /* height: 280px; */
134
-  height: 56vh;
124
+  height: 31vh;
135 125
   /* border: 1px solid saddlebrown; */
136 126
 }
137 127
 </style>