guhongwei 4 rokov pred
rodič
commit
3106efdfff

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

@@ -14,7 +14,7 @@
               <exports :province="province" :place="place"></exports>
             </el-tab-pane>
             <el-tab-pane label="科技在线频道">
-              <kjpd :province="province" :place="place"></kjpd>
+              <kjpd></kjpd>
             </el-tab-pane>
           </el-tabs>
         </div>

+ 39 - 36
src/views/hallList/parts/kjpd.vue

@@ -5,13 +5,13 @@
         <!-- 是否支持多开 accordion -->
         <el-collapse v-model="activeName" accordion>
           <el-collapse-item title="创新成果" name="1">
-            <kjpdlist :list="listNow" :total="nowTotal" status="1" @query="searchList" :province="province" :place="place"></kjpdlist>
+            <kjpdlist :list="onelist" @query="searchList"></kjpdlist>
           </el-collapse-item>
           <el-collapse-item title="科技普及" name="2">
-            <kjpdlist :list="listPre" :total="preTotal" status="0" @query="searchList" :province="province" :place="place"></kjpdlist>
+            <kjpdlist :list="twolist" @query="searchList"></kjpdlist>
           </el-collapse-item>
           <el-collapse-item title="专家讲堂" name="3">
-            <kjpdlist :list="listPast" :total="pastTotal" status="2" @query="searchList" :province="province" :place="place"></kjpdlist>
+            <kjpdlist :list="threelist" @query="searchList"></kjpdlist>
           </el-collapse-item>
         </el-collapse>
       </el-col>
@@ -23,52 +23,55 @@
 import _ from 'lodash';
 import kjpdlist from './kjpdlist.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: dock } = createNamespacedHelpers('dock');
+const { mapActions: channel } = createNamespacedHelpers('channel');
+const { mapActions: markettype } = createNamespacedHelpers('markettype');
 export default {
   name: 'product',
-  props: {
-    // 省
-    province: { type: Array, default: () => [] },
-    // 市
-    place: { type: Array, default: () => [] },
-  },
+  props: {},
   components: {
     kjpdlist,
   },
   data: function() {
     return {
       activeName: '1',
-      // 下期预告
-      listPre: [],
-      preTotal: 0,
-      // 正在直播
-      listNow: [],
-      nowTotal: 0,
-      // 往期直播
-      listPast: [],
-      pastTotal: 0,
+      onelist: [],
+      twolist: [],
+      threelist: [],
+      // 类型
+      typelist: [],
     };
   },
   async created() {
-    await this.searchList({ status: '0' });
-    await this.searchList({ status: '1' });
-    await this.searchList({ status: '2' });
+    await this.searchType();
+    await this.searchList();
   },
   methods: {
-    ...dock({ dockQuery: 'query' }),
-    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, `preTotal`, res.total);
-          this.$set(this, `listPre`, res.data);
-        } else if (status == '1') {
-          this.$set(this, `nowTotal`, res.total);
-          this.$set(this, `listNow`, res.data);
-        } else if (status == '2') {
-          this.$set(this, `pastTotal`, res.total);
-          this.$set(this, `listPast`, res.data);
-        }
+    ...markettype({ typequery: 'query' }),
+    ...channel(['query']),
+    //查询类型
+    async searchType() {
+      let res = await this.typequery({ category: '04' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `typelist`, res.data);
+      }
+    },
+    // 查询
+    async searchList() {
+      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);
       }
     },
   },

+ 14 - 48
src/views/hallList/parts/kjpdlist.vue

@@ -6,13 +6,13 @@
           <el-image :src="hall" style="width:100%;height:200px;"></el-image>
           <el-col :span="24" class="other">
             <p class="textOver">{{ item.title }}</p>
-            <p class="textOver">
-              <span class="orgin textOver">来源:{{ item.orgin }}</span>
-              <span><i class="el-icon-time"></i>{{ item.create_time }}</span>
+            <p>
+              <span class="textOver">来源:{{ item.orgin }}</span>
+              <span class="textOver">更新时间:{{ item.create_time }}</span>
             </p>
             <p>
-              <el-button type="warning" size="mini" @click="linkBtn(item)">进入频道</el-button>
-              <el-button type="warning" size="mini" @click="linkBtn1(item)">管理进入</el-button>
+              <el-button type="warning" size="mini" @click="adminBtn(item)">管理进入</el-button>
+              <el-button type="primary" size="mini" @click="jrpdBtn(item)">进入频道</el-button>
             </p>
           </el-col>
         </el-col>
@@ -24,28 +24,22 @@
 <script>
 import page from '@/components/pagination.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: channel } = createNamespacedHelpers('channel');
-const { mapActions: markettype } = createNamespacedHelpers('markettype');
+
 export default {
   name: 'personallist',
-  props: {},
+  props: {
+    list: { type: Array },
+  },
   components: {},
   data: () => {
     return {
       hall: require('@a/kjzx.jpg'),
-      list: [],
-      typelist: [],
     };
   },
-  async created() {
-    await this.searchType();
-    await this.search();
-  },
+  async created() {},
   methods: {
-    ...channel(['query']),
-    ...markettype({ typequery: 'query', typefetch: 'fetch' }),
     // 进入对接会
-    async linkBtn(item) {
+    async jrpdBtn(item) {
       if (this.user.uid || this.user.suid) {
         if (
           this.user.role == '0' ||
@@ -67,7 +61,7 @@ export default {
       }
     },
     //管理进入
-    async linkBtn1(item) {
+    async adminBtn(item) {
       if (this.user.uid || this.user.suid) {
         if (
           this.user.role == '0' ||
@@ -88,31 +82,6 @@ export default {
         this.$router.push({ path: '/webLogin' });
       }
     },
-    //查询类型
-    async searchType() {
-      let res = await this.typequery({ category: '04' });
-      if (this.$checkRes(res)) {
-        this.$set(this, `typelist`, res.data);
-      }
-    },
-    // 查询
-    async search() {
-      let type = this.typelist;
-      let one = type.find(i.code == '040');
-      let res = await this.query({ type: one.id });
-      if (this.$checkRes(res)) {
-        console.log(res.data);
-        this.$set(this, `list`, res.data);
-      }
-      //
-      // for (const val of type) {
-      //   let res = await this.query({ type: val.id });
-      //   if (this.$checkRes(res)) {
-      //     console.log(res.data);
-      //     // this.$set(this, `list`, res.data);
-      //   }
-      // }
-    },
   },
   computed: {
     ...mapState(['user']),
@@ -137,11 +106,8 @@ export default {
       p:nth-child(2) {
         padding: 5px;
         span:nth-child(2) {
-          float: right;
-        }
-        .orgin {
-          display: inline-block;
-          width: 247px;
+          float: left;
+          width: 50%;
         }
       }
       p:nth-child(3) {