guhongwei 4 年之前
父节点
当前提交
e6f194c4ba
共有 2 个文件被更改,包括 43 次插入25 次删除
  1. 25 19
      src/views/hallList/parts/kjpd.vue
  2. 18 6
      src/views/hallList/parts/kjpdlist.vue

+ 25 - 19
src/views/hallList/parts/kjpd.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="product">
         <!-- 是否支持多开 accordion -->
-        <el-collapse v-model="activeName" accordion>
+        <!-- <el-collapse v-model="activeName" accordion>
           <el-collapse-item title="创新成果" name="1">
             <kjpdlist :list="onelist" @query="searchList"></kjpdlist>
           </el-collapse-item>
@@ -13,7 +13,8 @@
           <el-collapse-item title="专家讲堂" name="3">
             <kjpdlist :list="threelist" @query="searchList"></kjpdlist>
           </el-collapse-item>
-        </el-collapse>
+        </el-collapse> -->
+        <kjpdlist :list="oneList" @query="searchList" :typelist="typelist"></kjpdlist>
       </el-col>
     </el-row>
   </div>
@@ -34,9 +35,10 @@ export default {
   data: function() {
     return {
       activeName: '1',
-      onelist: [],
-      twolist: [],
-      threelist: [],
+      // onelist: [],
+      // twolist: [],
+      // threelist: [],
+      oneList: [],
       // 类型
       typelist: [],
     };
@@ -57,22 +59,26 @@ export default {
     },
     // 查询
     async searchList() {
-      let type = this.typelist;
-      let one = type.find(f => f.code == '040');
-      let res = await this.query({ type: one.id });
+      let res = await this.query();
       if (this.$checkRes(res)) {
-        this.$set(this, `onelist`, res.data);
-      }
-      let two = type.find(f => f.code == '041');
-      res = await this.query({ type: two.id });
-      if (this.$checkRes(res)) {
-        this.$set(this, `twolist`, res.data);
-      }
-      let three = type.find(f => f.code == '042');
-      res = await this.query({ type: three.id });
-      if (this.$checkRes(res)) {
-        this.$set(this, `threelist`, res.data);
+        this.$set(this, `oneList`, res.data);
       }
+      // let type = this.typelist;
+      // let one = type.find(f => f.code == '040');
+      // let res = await this.query({ type: one.id });
+      // if (this.$checkRes(res)) {
+      //   this.$set(this, `onelist`, res.data);
+      // }
+      // let two = type.find(f => f.code == '041');
+      // res = await this.query({ type: two.id });
+      // if (this.$checkRes(res)) {
+      //   this.$set(this, `twolist`, res.data);
+      // }
+      // let three = type.find(f => f.code == '042');
+      // res = await this.query({ type: three.id });
+      // if (this.$checkRes(res)) {
+      //   this.$set(this, `threelist`, res.data);
+      // }
     },
   },
   computed: {

+ 18 - 6
src/views/hallList/parts/kjpdlist.vue

@@ -6,7 +6,9 @@
           <el-image :src="hall" style="width:100%;height:200px;"></el-image>
           <el-col :span="24" class="other">
             <p class="textOver">
-              <span style="color:#ff0000;">[{{ item.room_id }}]</span>{{ item.title }}
+              <span style="color:#ff0000;">[{{ item.room_id }}]</span>
+              <span>{{ geTtype(item.type) }}-</span>
+              {{ item.title }}
             </p>
             <p>
               <span class="textOver">来源:{{ item.orgin }}</span>
@@ -31,6 +33,7 @@ export default {
   name: 'personallist',
   props: {
     list: { type: Array },
+    typelist: { type: Array },
   },
   components: {},
   data: () => {
@@ -52,6 +55,13 @@ export default {
         this.$router.push({ path: '/hallList/kjpdLogin' });
       }
     },
+    // 查找类型
+    geTtype(data) {
+      let type = this.typelist.find(i => i.id == data);
+      if (type) {
+        return type.name;
+      }
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -64,20 +74,22 @@ export default {
   .list {
     position: relative;
     width: 32%;
-    height: 310px;
+    height: 325px;
     border: 1px solid #ccc;
     margin: 0 15px 10px 0;
     .other {
       p:nth-child(1) {
-        padding: 0 10px;
+        padding: 5px 10px;
         font-size: 16px;
         font-weight: bold;
       }
       p:nth-child(2) {
-        padding: 5px;
-        span:nth-child(2) {
+        padding: 0px 10px;
+        span {
           float: left;
-          width: 50%;
+          width: 100%;
+          font-size: 15px;
+          padding: 2px 0;
         }
       }
       p:nth-child(3) {