guhongwei 4 gadi atpakaļ
vecāks
revīzija
d8e8ab6e7c

+ 1 - 1
src/router/index.js

@@ -17,7 +17,7 @@ const routes = [
   {
     path: '/live/index',
     name: 'live_index',
-    meta: { title: '直播大厅', isleftarrow: true },
+    meta: { title: '直播大厅', isleftarrow: false },
     component: () => import('../views/live/index.vue'),
   },
   // {

+ 75 - 82
src/views/live/index.vue

@@ -1,28 +1,27 @@
 <template>
   <div id="index">
     <el-row>
-      <el-col :span="24" class="con">
+      <el-col :span="24" class="main">
         <el-col :span="24" class="top">
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
-        <el-col :span="24" class="main">
+        <el-col :span="24" class="info">
           <span v-if="itemIndex == 0">
             <onlineEx :province="province" :place="place"></onlineEx>
           </span>
-          <span v-if="itemIndex == 1">
-            <channel :province="province" :place="place"></channel>
+          <span v-else-if="itemIndex == 1">
+            <channel></channel>
           </span>
-          <span v-if="itemIndex == 2">
+          <span v-else-if="itemIndex == 2">
             <span v-if="chooseText == '嘉宾访谈'">
               <interview></interview>
             </span>
             <span v-else-if="chooseText == '技能培训'">
               <skill></skill>
             </span>
-            <!-- <training :province="province" :place="place" :chooseText="chooseText"> </training> -->
           </span>
-          <span v-if="itemIndex == 3">
-            <roadshow :province="province" :place="place"></roadshow>
+          <span v-else-if="itemIndex == 3">
+            <roadshow></roadshow>
           </span>
         </el-col>
         <el-col :span="24" class="foot">
@@ -31,7 +30,7 @@
             <van-tabbar-item icon="search">科技频道</van-tabbar-item>
             <van-tabbar-item icon="friends-o" class="train" @click="trainClick"
               >培训访谈
-              <el-col :span="4" class="itemCon" v-if="show">
+              <el-col :span="4" class="itemCon" v-if="trainShow">
                 <el-col :span="24" class="text" @click.native.stop="interviewClick('嘉宾访谈')">嘉宾访谈</el-col>
                 <el-col :span="24" class="text" @click.native.stop="interviewClick('技能培训')">技能培训</el-col>
               </el-col>
@@ -73,12 +72,12 @@ export default {
     onlineEx,
     //科技频道
     channel,
-    //项目路演
-    roadshow,
     //嘉宾访谈
     interview,
     //技能培训
     skill,
+    //项目路演
+    roadshow,
   },
   data: function() {
     return {
@@ -88,16 +87,18 @@ export default {
       isleftarrow: '',
       // 返回
       navShow: true,
-      //底部标签
-      active: 0,
-      //默认显示item的index值
-      itemIndex: 0,
       // 省
       province: [],
       // 市
       place: [],
+      //底部标签
+      active: 0,
+      //默认显示item的index值
+      itemIndex: 0,
+      // 培训访谈菜单显示
+      trainShow: false,
+      // 菜单选择
       chooseText: '',
-      show: false,
     };
   },
   async created() {
@@ -106,54 +107,43 @@ export default {
   methods: {
     ...mapMutations(['setUser']),
     ...place({ palcequery: 'query', transactiondtetle: 'delete' }),
+    // 查询省市
     async searchPlace() {
-      let res1 = await this.palcequery({ level: 1 });
+      let res = await this.palcequery({ level: 1 });
       let arr = await this.palcequery({ level: 2 });
-      if (res1 || arr) {
-        this.$set(this, `province`, res1.data);
+      if (res || arr) {
+        this.$set(this, `province`, res.data);
         this.$set(this, `place`, arr.data);
       }
     },
-    sesstoken() {
-      if (this.token) {
-        sessionStorage.setItem('token', this.token);
-        let user = jwt.decode(this.token);
-        if (user && user.uid) {
-          this.setUser(user);
-        }
-      }
-    },
     //点击底部标签显示对应的组件
     clickItem(index) {
-      // console.log(index);
       this.$set(this, `itemIndex`, index);
-      if (index == 0) {
-        this.$set(this, `show`, false);
-        this.$set(this, `title`, '在线展会');
-      } else if (index == 1) {
-        this.$set(this, `show`, false);
-        this.$set(this, `title`, '科技频道');
-      } else if (index == 2) {
-        this.$set(this, `title`, '培训访谈');
-        // if (this.chooseText == '嘉宾访谈') {
-        //   this.$set(this, `title`, '嘉宾访谈');
-        //   console.log(this.title);
-        // } else if (this.chooseText == '技能培训') {
-        //   this.$set(this, `title`, '技能培训');
-        // }
-      } else if (index == 3) {
-        this.$set(this, `show`, false);
-        this.$set(this, `title`, '项目路演');
-      }
+      this.$set(this, `trainShow`, false);
+      if (index == 0) this.$set(this, `title`, '在线展会');
+      else if (index == 1) this.$set(this, `title`, '科技频道');
+      else if (index == 2) this.$set(this, `title`, '培训访谈');
+      else if (index == 3) this.$set(this, `title`, '项目路演');
+    },
+    // 点击培训访谈
+    trainClick() {
+      this.trainShow = true;
     },
     //嘉宾访谈和技能培训
     interviewClick(name) {
-      this.$set(this, `show`, false);
+      this.$set(this, `trainShow`, false);
       this.$set(this, `chooseText`, name);
       this.$set(this, `title`, name);
     },
-    trainClick() {
-      this.show = true;
+    // 获取用户
+    sesstoken() {
+      if (this.token) {
+        sessionStorage.setItem('token', this.token);
+        let user = jwt.decode(this.token);
+        if (user && user.uid) {
+          this.setUser(user);
+        }
+      }
     },
   },
   computed: {
@@ -178,42 +168,45 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.con {
+.main {
   width: 100%;
   height: 100%;
   position: relative;
   background-color: #f9fafc;
-}
-.top {
-  height: 46px;
-  overflow: hidden;
-  position: relative;
-  z-index: 999;
-}
-.train {
-  position: relative;
-}
-// .itemCon_active {
-//   display: block;
-// }
-.itemCon {
-  width: 100px;
-  height: 87px;
-  padding: 13px;
-  // background-color: gold;
-  position: absolute;
-  left: -6px;
-  bottom: 50px;
-  box-shadow: 0px -1px 5px;
-  z-index: 999;
-  background-color: #fff;
-  .text {
-    color: #646566;
-    font-size: 14px;
-    line-height: 30px;
-    height: 30px;
-    text-align: center;
-    // background: green;
+  .top {
+    height: 46px;
+    overflow: hidden;
+    position: relative;
+    z-index: 999;
+  }
+  .info {
+    position: relative;
+    padding: 0 0 40px 0;
+  }
+  .foot {
+    .train {
+      position: relative;
+    }
+    .itemCon {
+      position: absolute;
+      z-index: 999;
+      width: 93px;
+      padding: 5px;
+      bottom: 50px;
+      left: 0px;
+      border-radius: 5px;
+      box-shadow: 0 0 5px #ccc;
+      .text {
+        font-size: 15px;
+        color: #666;
+        padding: 8px 0;
+        border-bottom: 1px dashed #ccc;
+        text-align: center;
+      }
+      .text:last-child {
+        border-bottom: none;
+      }
+    }
   }
 }
 </style>

+ 0 - 22
src/views/live/parts/channel.vue

@@ -84,31 +84,9 @@ export default {
         this.search();
       }
     },
-    sesstoken() {
-      if (this.token) {
-        sessionStorage.setItem('token', this.token);
-        let user = jwt.decode(this.token);
-        if (user && user.uid) {
-          this.setUser(user);
-        }
-      }
-    },
   },
   computed: {
     ...mapState(['user']),
-    token() {
-      return this.$route.query.token;
-    },
-  },
-  watch: {
-    token: {
-      immediate: true,
-      deep: true,
-      handler(val) {
-        // console.log(val);
-        this.sesstoken();
-      },
-    },
   },
   mounted() {
     this.title = this.$route.meta.title;

+ 2 - 25
src/views/live/parts/interview.vue

@@ -11,8 +11,7 @@
               {{ item.title }}
             </el-col>
             <el-col :span="12" class="date textOver"> 发布时间:{{ item.publish_time }} </el-col>
-            <el-col v-if="item.orgin" :span="12" class="date textOver"> 信息来源:{{ item.orgin }} </el-col>
-            <el-col v-else :span="12" class="date textOver"> 信息来源:暂无 </el-col>
+            <el-col :span="12" class="date textOver"> 信息来源:{{ item.orgin || '暂无' }} </el-col>
           </el-col>
         </el-col>
       </el-col>
@@ -45,7 +44,6 @@ export default {
       const res = await this.danceQuery();
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
-        // console.log(this.list);
       }
     },
     //搜索
@@ -60,32 +58,11 @@ export default {
         this.search();
       }
     },
-    sesstoken() {
-      if (this.token) {
-        sessionStorage.setItem('token', this.token);
-        let user = jwt.decode(this.token);
-        if (user && user.uid) {
-          this.setUser(user);
-        }
-      }
-    },
   },
   computed: {
     ...mapState(['user']),
-    token() {
-      return this.$route.query.token;
-    },
-  },
-  watch: {
-    token: {
-      immediate: true,
-      deep: true,
-      handler(val) {
-        // console.log(val);
-        this.sesstoken();
-      },
-    },
   },
+
   mounted() {
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;

+ 5 - 42
src/views/live/parts/onlineEx.vue

@@ -34,8 +34,6 @@
 import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
 import liveList from './liveList.vue';
 const { mapActions: dock } = createNamespacedHelpers('dock');
-const { mapActions: place } = createNamespacedHelpers('place');
-const jwt = require('jsonwebtoken');
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -77,19 +75,13 @@ export default {
   methods: {
     ...mapMutations(['setUser']),
     ...dock({ dockQuery: 'query' }),
-    ...place({ palcequery: 'query', transactiondtetle: 'delete' }),
     //查询
     async searchList({ skip = 0, limit = 10, status, ...info } = {}) {
       let res = await this.dockQuery({ is_allowed: 1, skip, status, ...info });
       if (res.errcode == 0) {
-        if (status == '0') {
-          this.$set(this, `listPre`, res.data);
-          // console.log(this.listPre);
-        } else if (status == '1') {
-          this.$set(this, `listNow`, res.data);
-        } else if (status == '2') {
-          this.$set(this, `listPast`, res.data);
-        }
+        if (status == '0') this.$set(this, `listPre`, res.data);
+        else if (status == '1') this.$set(this, `listNow`, res.data);
+        else if (status == '2') this.$set(this, `listPast`, res.data);
       }
     },
     //下拉选择
@@ -100,14 +92,6 @@ export default {
           this.$set(this, `active`, index);
         }
       }
-      // if (status) {
-      //   this.active = '';
-      //   this.$set(this, `statusValue`, status);
-      //   let index = this.statuslist.findIndex(i => i.status == status);
-      //   if (index) {
-      //     this.$set(this, `active`, index);
-      //   }
-      // }
     },
     //搜索
     onSearch(data) {
@@ -120,9 +104,9 @@ export default {
         });
       }
     },
+    // 名字查询
     async searchTxt({ ...info } = {}) {
       info.status = this.statusValue == 0 ? 1 : this.statusValue == 1 ? 0 : 2;
-      // console.log(info);
       if (this.name) {
         info.title = this.name;
         let res = await this.dockQuery({ is_allowed: 1, ...info });
@@ -138,31 +122,9 @@ export default {
         this.searchList({ status: '2' });
       }
     },
-    sesstoken() {
-      if (this.token) {
-        sessionStorage.setItem('token', this.token);
-        let user = jwt.decode(this.token);
-        if (user && user.uid) {
-          this.setUser(user);
-        }
-      }
-    },
   },
   computed: {
     ...mapState(['user']),
-    token() {
-      return this.$route.query.token;
-    },
-  },
-  watch: {
-    token: {
-      immediate: true,
-      deep: true,
-      handler(val) {
-        // console.log(val);
-        this.sesstoken();
-      },
-    },
   },
   mounted() {
     this.title = this.$route.meta.title;
@@ -188,6 +150,7 @@ export default {
       }
       .el-select {
         padding: 10px 0px 0px 5px;
+        background: #fff;
       }
       /deep/.el-input__icon {
         line-height: 30px;

+ 0 - 22
src/views/live/parts/roadshow.vue

@@ -59,31 +59,9 @@ export default {
         this.search();
       }
     },
-    sesstoken() {
-      if (this.token) {
-        sessionStorage.setItem('token', this.token);
-        let user = jwt.decode(this.token);
-        if (user && user.uid) {
-          this.setUser(user);
-        }
-      }
-    },
   },
   computed: {
     ...mapState(['user']),
-    token() {
-      return this.$route.query.token;
-    },
-  },
-  watch: {
-    token: {
-      immediate: true,
-      deep: true,
-      handler(val) {
-        // console.log(val);
-        this.sesstoken();
-      },
-    },
   },
   mounted() {
     this.title = this.$route.meta.title;

+ 1 - 25
src/views/live/parts/skill.vue

@@ -11,8 +11,7 @@
               {{ item.title }}
             </el-col>
             <el-col :span="12" class="date textOver"> 发布时间:{{ item.publish_time }} </el-col>
-            <el-col v-if="item.orgin" :span="12" class="date textOver"> 信息来源:{{ item.orgin }} </el-col>
-            <el-col v-else :span="12" class="date textOver"> 信息来源:暂无 </el-col>
+            <el-col :span="12" class="date textOver"> 信息来源:{{ item.orgin || '暂无' }} </el-col>
           </el-col>
         </el-col>
       </el-col>
@@ -22,7 +21,6 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-// const { mapActions: newsguidance } = createNamespacedHelpers('newsguidance');
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -65,31 +63,9 @@ export default {
       //   this.search();
       // }
     },
-    sesstoken() {
-      if (this.token) {
-        sessionStorage.setItem('token', this.token);
-        let user = jwt.decode(this.token);
-        if (user && user.uid) {
-          this.setUser(user);
-        }
-      }
-    },
   },
   computed: {
     ...mapState(['user']),
-    token() {
-      return this.$route.query.token;
-    },
-  },
-  watch: {
-    token: {
-      immediate: true,
-      deep: true,
-      handler(val) {
-        // console.log(val);
-        this.sesstoken();
-      },
-    },
   },
   mounted() {
     this.title = this.$route.meta.title;