浏览代码

页面更新

guhongwei 5 年之前
父节点
当前提交
ac5cd25ab4

+ 2 - 1
src/components/corp.vue

@@ -55,8 +55,9 @@ export default {
   margin: 0 auto;
 }
 .top {
-  height: 120px;
+  height: 40px;
   overflow: hidden;
+  background: #f5f5f5;
 }
 .menu {
   height: 40px;

+ 1 - 0
src/components/detail.vue

@@ -61,6 +61,7 @@ export default {
 .top {
   height: 40px;
   overflow: hidden;
+  background: #f5f5f5;
 }
 .banner {
   height: 300px;

+ 2 - 1
src/components/jobfair.vue

@@ -61,8 +61,9 @@ export default {
   margin: 0 auto;
 }
 .top {
-  height: 120px;
+  height: 40px;
   overflow: hidden;
+  background: #f5f5f5;
 }
 .banner {
   height: 300px;

+ 2 - 1
src/components/jobinfo.vue

@@ -60,8 +60,9 @@ export default {
   margin: 0 auto;
 }
 .top {
-  height: 120px;
+  height: 40px;
   overflow: hidden;
+  background: #f5f5f5;
 }
 .banner {
   height: 300px;

+ 2 - 1
src/components/jobs.vue

@@ -67,8 +67,9 @@ export default {
   margin: 0 auto;
 }
 .top {
-  height: 120px;
+  height: 40px;
   overflow: hidden;
+  background: #f5f5f5;
 }
 .banner {
   height: 300px;

+ 2 - 1
src/components/list.vue

@@ -67,8 +67,9 @@ export default {
   margin: 0 auto;
 }
 .top {
-  height: 120px;
+  height: 40px;
   overflow: hidden;
+  background: #f5f5f5;
 }
 .banner {
   height: 300px;

+ 2 - 1
src/components/talk.vue

@@ -60,8 +60,9 @@ export default {
   margin: 0 auto;
 }
 .top {
-  height: 120px;
+  height: 40px;
   overflow: hidden;
+  background: #f5f5f5;
 }
 .banner {
   height: 300px;

+ 2 - 8
src/layout/index/top.vue

@@ -2,9 +2,8 @@
   <div id="top">
     <el-row>
       <el-col :span="24" class="top">
-        <div class="w_1270">
-          <el-col :span="19" class="title"> 您好,欢迎访问{{ info.name }}! </el-col>
-          <!-- <el-col :span="4" class="fenxiang">
+        <el-col :span="19" class="title"> 您好,欢迎访问{{ info.name }}! </el-col>
+        <!-- <el-col :span="4" class="fenxiang">
             <el-col :span="12" class="weibo">
               <el-link :underline="false">
                 <el-image :src="weibo"></el-image>
@@ -18,7 +17,6 @@
               </el-link>
             </el-col>
           </el-col> -->
-        </div>
       </el-col>
     </el-row>
   </div>
@@ -42,10 +40,6 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.w_1270 {
-  width: 1270px;
-  margin: 0 auto;
-}
 .top {
   height: 40px;
   overflow: hidden;

+ 11 - 1
src/router/index.js

@@ -6,10 +6,20 @@ Vue.use(Router);
 export default new Router({
   routes: [
     {
-      path: '/',
+      path: '/index',
       name: 'index',
       component: () => import('../views/index.vue'),
     },
+    {
+      path: '/',
+      name: 'loading',
+      component: () => import('../views/loading.vue'),
+    },
+    {
+      path: '/fail',
+      name: 'fail',
+      component: () => import('../views/fail.vue'),
+    },
     {
       path: '/list/:jobs/:type',
       name: 'list',

+ 4 - 8
src/views/detail.vue

@@ -71,7 +71,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -81,13 +84,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 28 - 0
src/views/fail.vue

@@ -0,0 +1,28 @@
+<template>
+  <div id="fail">
+    <el-row>
+      <el-col :span="24" class="info">
+        页面加载失败
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'fail',
+  props: {},
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+.info {
+  text-align: center;
+  font-size: 30px;
+}
+</style>

+ 4 - 8
src/views/index.vue

@@ -76,7 +76,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -86,13 +89,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/list.vue

@@ -80,7 +80,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -90,13 +93,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 240 - 0
src/views/loading.vue

@@ -0,0 +1,240 @@
+<template>
+  <div id="loading">
+    <el-row>
+      <el-col :span="24" class="info">
+        <div class="page">
+          <div class="circle-loader">
+            <div class="circle-line">
+              <div class="circle circle-blue"></div>
+              <div class="circle circle-blue"></div>
+              <div class="circle circle-blue"></div>
+            </div>
+            <div class="circle-line">
+              <div class="circle circle-yellow"></div>
+              <div class="circle circle-yellow"></div>
+              <div class="circle circle-yellow"></div>
+            </div>
+            <div class="circle-line">
+              <div class="circle circle-red"></div>
+              <div class="circle circle-red"></div>
+              <div class="circle circle-red"></div>
+            </div>
+            <div class="circle-line">
+              <div class="circle circle-green"></div>
+              <div class="circle circle-green"></div>
+              <div class="circle circle-green"></div>
+            </div>
+          </div>
+          <div class="title">
+            站点信息加载中,请稍等!
+          </div>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapActions, mapState } from 'vuex';
+import _ from 'lodash';
+export default {
+  metaInfo() {
+    return {
+      title: this.siteTitle ? this.siteTitle : '加载中',
+    };
+  },
+  name: 'loading',
+  props: {},
+  components: {},
+  data: () => ({}),
+  async created() {
+    await this.toGetSite(); //获取主站信息
+  },
+  computed: {},
+  methods: {
+    ...mapActions(['getSite']),
+    //站点信息
+    async toGetSite() {
+      let site = sessionStorage.getItem('site');
+      if (!site) {
+        let result = await this.getSite({ type: 'search' });
+        if (result.data === null) {
+          this.$router.push('/fail');
+        }
+      } else {
+        this.$router.push('/index');
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.info {
+  width: 100%;
+  height: 100vh;
+}
+.title {
+  position: absolute;
+  top: 50%;
+  text-align: center;
+  font-size: 20px;
+  width: 100%;
+}
+.circle-loader {
+  display: block;
+  width: 64px;
+  height: 64px;
+  margin-left: -32px;
+  margin-top: -32px;
+  position: absolute;
+  left: 50%;
+  top: 40%;
+  -webkit-transform-origin: 16px 16px;
+  transform-origin: 16px 16px;
+  -webkit-animation: rotate-animation 5s infinite;
+  animation: rotate-animation 5s infinite;
+  -webkit-animation-timing-function: linear;
+  animation-timing-function: linear;
+}
+.circle-loader .circle {
+  -webkit-animation: move-animation 2.5s infinite;
+  animation: move-animation 2.5s infinite;
+  -webkit-animation-timing-function: linear;
+  animation-timing-function: linear;
+  position: absolute;
+  left: 50%;
+  top: 50%;
+}
+.circle-loader .circle-line {
+  width: 64px;
+  height: 24px;
+  position: absolute;
+  top: 4px;
+  left: 0;
+  -webkit-transform-origin: 4px 4px;
+  transform-origin: 4px 4px;
+}
+.circle-loader .circle-line:nth-child(0) {
+  -webkit-transform: rotate(0deg);
+  transform: rotate(0deg);
+}
+.circle-loader .circle-line:nth-child(1) {
+  -webkit-transform: rotate(90deg);
+  transform: rotate(90deg);
+}
+.circle-loader .circle-line:nth-child(2) {
+  -webkit-transform: rotate(180deg);
+  transform: rotate(180deg);
+}
+.circle-loader .circle-line:nth-child(3) {
+  -webkit-transform: rotate(270deg);
+  transform: rotate(270deg);
+}
+.circle-loader .circle-line .circle:nth-child(1) {
+  width: 8px;
+  height: 8px;
+  top: 50%;
+  left: 50%;
+  margin-top: -4px;
+  margin-left: -4px;
+  border-radius: 4px;
+  -webkit-animation-delay: -0.3s;
+  animation-delay: -0.3s;
+}
+.circle-loader .circle-line .circle:nth-child(2) {
+  width: 16px;
+  height: 16px;
+  top: 50%;
+  left: 50%;
+  margin-top: -8px;
+  margin-left: -8px;
+  border-radius: 8px;
+  -webkit-animation-delay: -0.6s;
+  animation-delay: -0.6s;
+}
+.circle-loader .circle-line .circle:nth-child(3) {
+  width: 24px;
+  height: 24px;
+  top: 50%;
+  left: 50%;
+  margin-top: -12px;
+  margin-left: -12px;
+  border-radius: 12px;
+  -webkit-animation-delay: -0.9s;
+  animation-delay: -0.9s;
+}
+.circle-loader .circle-blue {
+  background-color: #1f4e5a;
+}
+.circle-loader .circle-red {
+  background-color: #ff5955;
+}
+.circle-loader .circle-yellow {
+  background-color: #ffb265;
+}
+.circle-loader .circle-green {
+  background-color: #00a691;
+}
+@-webkit-keyframes rotate-animation {
+  0% {
+    -webkit-transform: rotate(0deg);
+    transform: rotate(0deg);
+  }
+  100% {
+    -webkit-transform: rotate(360deg);
+    transform: rotate(360deg);
+  }
+}
+@keyframes rotate-animation {
+  0% {
+    -webkit-transform: rotate(0deg);
+    transform: rotate(0deg);
+  }
+  100% {
+    -webkit-transform: rotate(360deg);
+    transform: rotate(360deg);
+  }
+}
+@-webkit-keyframes move-animation {
+  0% {
+    -webkit-transform: translate(0, 0);
+    transform: translate(0, 0);
+  }
+  25% {
+    -webkit-transform: translate(-64px, 0);
+    transform: translate(-64px, 0);
+  }
+  75% {
+    -webkit-transform: translate(32px, 0);
+    transform: translate(32px, 0);
+  }
+  100% {
+    -webkit-transform: translate(0, 0);
+    transform: translate(0, 0);
+  }
+}
+@-webkit-keyframes move-animation {
+  0% {
+    -webkit-transform: translate(0, 0);
+  }
+}
+@keyframes move-animation {
+  0% {
+    -webkit-transform: translate(0, 0);
+    transform: translate(0, 0);
+  }
+  25% {
+    -webkit-transform: translate(-64px, 0);
+    transform: translate(-64px, 0);
+  }
+  75% {
+    -webkit-transform: translate(32px, 0);
+    transform: translate(32px, 0);
+  }
+  100% {
+    -webkit-transform: translate(0, 0);
+    transform: translate(0, 0);
+  }
+}
+</style>

+ 4 - 8
src/views/member.vue

@@ -75,7 +75,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -85,13 +88,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/memberDetail.vue

@@ -69,7 +69,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -79,13 +82,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/memberList.vue

@@ -63,7 +63,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -73,13 +76,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/newsList.vue

@@ -80,7 +80,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -90,13 +93,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/recruit/corp.vue

@@ -56,7 +56,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -66,13 +69,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/recruit/jobfair.vue

@@ -91,7 +91,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -101,13 +104,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/recruit/jobinfo.vue

@@ -62,7 +62,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -72,13 +75,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/recruit/jobs.vue

@@ -77,7 +77,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -87,13 +90,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单

+ 4 - 8
src/views/recruit/talk.vue

@@ -72,7 +72,10 @@ export default {
     //站点信息
     async toGetSite() {
       let site = sessionStorage.getItem('site');
-      if (!site) {
+      if (site) {
+        this.$set(this, `site`, JSON.parse(site));
+        this.$set(this, `siteTitle`, this.site.name);
+      } else {
         let result = await this.getSite({ type: 'search' });
         if (result.errcode === 0) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
@@ -82,13 +85,6 @@ export default {
           this.$set(this, `site`, result.data);
           this.$set(this, `siteTitle`, this.site.name);
         }
-      } else {
-        this.$set(this, `site`, JSON.parse(site));
-        this.$set(this, `siteTitle`, this.site.name);
-        let arr = this.site;
-        if (arr.custom) {
-          let item = arr.custom;
-        }
       }
     },
     //菜单