guhongwei 5 gadi atpakaļ
vecāks
revīzija
329a276cf5
1 mainītis faili ar 22 papildinājumiem un 1 dzēšanām
  1. 22 1
      src/views/index/index.vue

+ 22 - 1
src/views/index/index.vue

@@ -14,6 +14,7 @@
         :infoList="jobinfoList"
         :linkImgList="linkList"
         :lunboList="coopList"
+        :floating="floating"
       >
         <template #native>
           <top-menu></top-menu>
@@ -47,6 +48,7 @@
         :unittop="master.unittop"
         :unitlist="coopList"
         :footinfo="site"
+        :floating="floating"
         :rilitop="master.rilitop"
         :rightInfo="master.rightInfo"
       >
@@ -94,6 +96,7 @@ export default {
     talksOutList: [],
     jobinfoList: [],
     site: {},
+    floating: {},
     news: [],
     notice: [],
     self1List: [],
@@ -131,7 +134,7 @@ export default {
     //检查用户身份
     checkUser() {
       let schId = sessionStorage.getItem('schId');
-      if (schId === 'master') {
+      if (schId !== 'master') {
         this.$set(this, `user`, schId);
       }
     },
@@ -142,12 +145,30 @@ export default {
         let result = await this.siteOperation({ type: 'search', data: { site: this.$site } });
         if (`${result.errcode}` === `0`) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
+          if (result.data.custom) {
+            let item = result.data.custom;
+            this.getfloating(item);
+          }
           this.$set(this, `site`, result.data);
         }
       } else {
+        console.log(JSON.parse(site));
         this.$set(this, `site`, JSON.parse(site));
+        let arr = this.site;
+        if (arr.custom) {
+          let item = arr.custom;
+          this.getfloating(item);
+        }
       }
     },
+    getfloating(item) {
+      let arr = JSON.parse(item);
+      arr.forEach(val => {
+        if (val.item == '浮窗') {
+          this.$set(this, `floating`, val);
+        }
+      });
+    },
     //查询招聘类信息
     async search() {
       // 1直接拿着参数发送请求