wxy 4 年之前
父節點
當前提交
eca8c48c62
共有 3 個文件被更改,包括 57 次插入50 次删除
  1. 16 4
      src/views/live/index.vue
  2. 15 35
      src/views/live/parts/liveList.vue
  3. 26 11
      src/views/live/parts/videoDetail.vue

+ 16 - 4
src/views/live/index.vue

@@ -9,13 +9,13 @@
           <!-- <liveList></liveList> -->
           <el-tabs v-model="activeName" stretch>
             <el-tab-pane label="正在直播" name="first">
-              <liveList :list="listNow" :total="nowTotal" status="1" @query="searchList"></liveList>
+              <liveList :list="listNow" :total="nowTotal" status="1" @query="searchList" :province="province" :place="place"></liveList>
             </el-tab-pane>
             <el-tab-pane label="下期预告" name="second">
-              <liveList :list="listPre" :total="nowTotal" status="0" @query="searchList"></liveList>
+              <liveList :list="listPre" :total="nowTotal" status="0" @query="searchList" :province="province" :place="place"></liveList>
             </el-tab-pane>
             <el-tab-pane label="往期直播" name="third">
-              <liveList :list="listPast" :total="nowTotal" status="2" @query="searchList"></liveList>
+              <liveList :list="listPast" :total="nowTotal" status="2" @query="searchList" :province="province" :place="place"></liveList>
             </el-tab-pane>
           </el-tabs>
         </el-col>
@@ -33,13 +33,14 @@ import NavBar from '@/layout/common/topInfo.vue';
 import footInfo from '@/layout/common/footInfo.vue';
 import liveList from './parts/liveList.vue';
 const { mapActions: dock } = createNamespacedHelpers('dock');
+const { mapActions: place } = createNamespacedHelpers('place');
 export default {
   name: 'index',
   props: {},
   components: {
     NavBar,
     footInfo,
-    // liveList, //直播列表
+    liveList, //直播列表
   },
   data: function() {
     return {
@@ -59,6 +60,10 @@ export default {
       // 往期直播
       listPast: [],
       pastTotal: 0,
+      // 省
+      province: [],
+      // 市
+      place: [],
     };
   },
   async created() {
@@ -68,6 +73,7 @@ export default {
   },
   methods: {
     ...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) {
@@ -82,6 +88,12 @@ export default {
           this.$set(this, `listPast`, res.data);
         }
       }
+      let res1 = await this.palcequery({ level: 1 });
+      let arr = await this.palcequery({ level: 2 });
+      if (res1 || arr) {
+        this.$set(this, `province`, res1.data);
+        this.$set(this, `place`, arr.data);
+      }
     },
   },
   computed: {

+ 15 - 35
src/views/live/parts/liveList.vue

@@ -6,7 +6,7 @@
           <el-col :span="18" class="left">
             <p class="textOver">{{ item.title }}</p>
             <p>
-              举办城市:<span>{{ item.province }}{{ item.places }}</span>
+              举办城市:<span>{{ getprovince(item.province) }}-{{ getplace(item.place) }}</span>
             </p>
             <p>
               直播时间:<span>{{ item.start_time }}</span>
@@ -27,51 +27,31 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: dock } = createNamespacedHelpers('dock');
-const { mapActions: place } = createNamespacedHelpers('place');
 export default {
   name: 'liveList',
   props: {
     list: { type: Array },
     status: { type: String, default: '0' },
+    // 省
+    province: { type: Array, default: () => [] },
+    // 市
+    place: { type: Array, default: () => [] },
   },
   components: {},
   data: function() {
-    return {
-      // list: [],
-    };
-  },
-  created() {
-    this.searchInfo();
+    return {};
   },
+  created() {},
   methods: {
-    ...dock({ dockQuery: 'query', palcefetch: 'fetch' }),
-    ...place({ palcequery: 'query', transactiondtetle: 'delete' }),
-    async searchInfo() {
-      let res = await this.dockQuery();
-      if (this.$checkRes(res)) {
-        for (const val of res.data) {
-          val.province = await this.provinceSearch(val.province);
-          val.places = await this.placeSearch(val.place);
-        }
-        // this.$set(this, `list`, res.data);
-      }
+    // 过滤省
+    getprovince(item) {
+      let res = this.province.find(i => i.code == item);
+      if (res) return res.name;
     },
-    // 省份
-    async provinceSearch(parent) {
-      let provinceInfo = await this.palcequery({ level: 1, parent });
-      var arr = provinceInfo.data.filter(item => item.code === parent);
-      for (const province of arr) {
-        return province.name;
-      }
-    },
-    // 市区
-    async placeSearch(places) {
-      let placesInfo = await this.palcequery({ level: 2, places });
-      var arr = placesInfo.data.filter(item => item.code === places);
-      for (const places of arr) {
-        return places.name;
-      }
+    // 过滤市
+    getplace(item) {
+      let res = this.place.find(i => i.code == item);
+      if (res) return res.name;
     },
   },
   computed: {

+ 26 - 11
src/views/live/parts/videoDetail.vue

@@ -41,9 +41,18 @@
             </el-tab-pane>
             <el-tab-pane label="专家智库" name="third">
               <el-col :span="24" class="two">
-                <el-col :span="24" class="twoList" v-for="(item, index) in twoList" :key="index">
-                  <el-col :span="24" class="name">{{ item.name }}</el-col>
-                  <el-col :span="24" class="field">所属领域:{{ item.field }}</el-col>
+                <el-col :span="24" class="twoList" v-for="(item, index) in expertList" :key="index">
+                  <el-col :span="5" class="image">
+                    <el-image :src="item.expertimage" style="width:70px;height: 70px;border: 1px solid #f1f1f1;" v-if="item.expertimage != ''"></el-image>
+                    <el-image :src="expertimage" style="width:70px;height: 70px;border: 1px solid #f1f1f1;" v-else></el-image>
+                  </el-col>
+                  <el-col :span="19" class="info1">
+                    <el-col :span="24" class="name textOver">
+                      {{ item.name }}
+                    </el-col>
+                    <el-col :span="24" class="txt textOver"> {{ item.zwzc || '暂无' }} </el-col>
+                    <el-col :span="24" class="txt textOver"> {{ item.company || '暂无' }} </el-col>
+                  </el-col>
                 </el-col>
               </el-col>
             </el-tab-pane>
@@ -58,7 +67,7 @@
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: dock } = createNamespacedHelpers('dock');
 import chat from '@/components/parts/chat.vue';
-// const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
+const { mapActions: exportuser } = createNamespacedHelpers('exportuser');
 
 export default {
   name: 'videoDetail',
@@ -84,10 +93,9 @@ export default {
   },
   methods: {
     ...dock({ dockQuery: 'query', palcefetch: 'fetch' }),
-    // ...expertsuser({ expertQuery: 'query' }),
+    ...exportuser({ expertQuery: 'query' }),
     async seachInfo({ skip = 0, limit = 5, ...info } = {}) {
       let res = await this.palcefetch(this.id);
-      console.log(res);
       if (this.$checkRes(res)) {
         this.$set(this, `file_path`, res.data.file_path);
       }
@@ -97,15 +105,13 @@ export default {
       //科技需求
       var jishuData = czxmNew.filter(item => item.type === '0');
       this.$set(this, `twoList`, jishuData);
-      // console.log(jishuData);
       //技术成果
       var chanpinData = czxmNew.filter(item => item.type === '1');
       if (chanpinData) this.$set(this, `demandList`, chanpinData);
-      // console.log(chanpinData);
       // 专家智库
-      // let exportdata = await this.expertQuery({ role: 6, limit: 8 });
-      // if (this.$checkRes(exportdata)) this.$set(this, `expertList`, exportdata.data);
-      // console.log(this.expertList);
+      let exportdata = await this.expertQuery({ role: 6, limit: 6 });
+      if (this.$checkRes(exportdata)) this.$set(this, `expertList`, exportdata.data);
+      console.log(this.expertList);
     },
     onSubmit() {
       console.log(this.input);
@@ -170,6 +176,15 @@ export default {
         color: #666;
       }
     }
+    .image {
+      margin-top: 5px;
+      .el-image {
+        border-radius: 90%;
+      }
+    }
+    .info1 {
+      padding: 6px 0px 1px 20px;
+    }
   }
 }
 /deep/.video-js {