yuhao пре 2 година
родитељ
комит
090ad56aa0

+ 4 - 2
src/views/BprogramAmount/BprogramAmount.vue

@@ -44,11 +44,12 @@ export default {
44 44
               show: false,
45 45
             },
46 46
             data: [
47
+              "美妆购买总用户数",
47 48
               "单次三个项目",
48 49
               "单次两个项目",
49 50
               "三次到店用户数",
50 51
               "两次到店用户数",
51
-              "美妆购买总用户数",
52
+              '总付费用户数',
52 53
               "总用户数",
53 54
             ],
54 55
           },
@@ -78,11 +79,12 @@ export default {
78 79
               },
79 80
             },
80 81
             data: [
82
+              this.listData.beauty_products,
81 83
               this.listData.three_project,
82 84
               this.listData.two_project,
83 85
               this.listData.user_three,
84 86
               this.listData.user_two,
85
-              this.listData.beauty_products,
87
+              this.listData.total_consumer_users,
86 88
               this.listData.total_user,
87 89
             ],
88 90
           },

+ 6 - 0
src/views/productRatio/productRatio.vue

@@ -15,6 +15,10 @@ export default {
15 15
   methods: {
16 16
     // 保存项目top10信息
17 17
     getTopList() {
18
+      this.topList = [];
19
+            if (this.listData == "") {
20
+        return;
21
+      }
18 22
       this.listData.forEach((item) => {
19 23
         let arr = {};
20 24
         arr.value = item.num;
@@ -66,8 +70,10 @@ export default {
66 70
   watch: {
67 71
     listData: {
68 72
       handler(val) {
73
+        this.getTopList();
69 74
         this.myEcharts();
70 75
       },
76
+      deep: true, // 深度监听父组件传过来对象变化
71 77
     },
72 78
   },
73 79
   mounted() {

+ 3 - 3
src/views/programAmount/programAmount.vue

@@ -50,9 +50,9 @@ export default {
50 50
             },
51 51
             data: [
52 52
               "总测肤用户数",
53
-              "付费用户数",
54
-              "充值用户数",
55
-              "多次卡购买用户数",
53
+              "付费用户数",
54
+              "充值用户数",
55
+              "多次卡购买用户数",
56 56
               "新注册用户数",
57 57
               "新测肤用户数",
58 58
             ],

+ 13 - 7
src/views/projectRatio/projectRatio.vue

@@ -15,12 +15,16 @@ export default {
15 15
   methods: {
16 16
     // 保存项目top10信息
17 17
     getTopList() {
18
-      this.listData.forEach(item=>{
19
-        let arr = {}
20
-        arr.value = item.num
21
-        arr.name = item.project_name
22
-        this.topList.push(arr)
23
-      })
18
+      this.topList = [];
19
+      if (this.listData == "") {
20
+        return;
21
+      }
22
+      this.listData.forEach((item) => {
23
+        let arr = {};
24
+        arr.value = item.num;
25
+        arr.name = item.project_name;
26
+        this.topList.push(arr);
27
+      });
24 28
     },
25 29
     //先定义个方法
26 30
     myEcharts() {
@@ -44,7 +48,7 @@ export default {
44 48
             // name: "Access From",
45 49
             type: "pie",
46 50
             radius: "50%",
47
-            data:this.topList,
51
+            data: this.topList,
48 52
             // data: [
49 53
             //   {
50 54
             //     name: this.listData[0].project_name,
@@ -80,8 +84,10 @@ export default {
80 84
   watch: {
81 85
     listData: {
82 86
       handler(val) {
87
+        this.getTopList();
83 88
         this.myEcharts();
84 89
       },
90
+      deep: true, // 深度监听父组件传过来对象变化
85 91
     },
86 92
   },
87 93
   mounted() {