panhui 4 жил өмнө
parent
commit
6b2e7f0cc7
1 өөрчлөгдсөн 6 нэмэгдсэн , 14 устгасан
  1. 6 14
      src/views/Home.vue

+ 6 - 14
src/views/Home.vue

@@ -78,19 +78,7 @@ export default {
         NewsInfo
     },
     computed: {
-        ...mapState(['userInfo']),
-        bgImg() {
-            let img = '';
-            if (this.active === 0 && this.products.length > 0) {
-                img = this.getImg(this.changeImgs(this.products[0].pic));
-            }
-
-            if (this.active === 1 && this.news.length > 0) {
-                img = this.getImg(this.news[0].pic);
-            }
-
-            return img;
-        }
+        ...mapState(['userInfo'])
     },
     data() {
         return {
@@ -101,7 +89,8 @@ export default {
             loading: false,
             finished: false,
             page: 0,
-            empty: false
+            empty: false,
+            bgImg: ''
         };
     },
     mounted() {
@@ -110,6 +99,9 @@ export default {
             StatusBar.styleDefault();
         }
         this.getInit();
+        this.$http.get('sysConfig/get/home_bg').then(res => {
+            this.bgImg = res.value;
+        });
     },
     methods: {
         getInit() {