|
@@ -6,22 +6,17 @@
|
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="main">
|
|
|
- <el-col :span="24" class="con">
|
|
|
- <el-col :span="24" class="list" v-for="(item, index) in list" :key="index" @click.native="show(item)">
|
|
|
- <el-col :span="11" class="video">
|
|
|
- <el-image :src="item.image_path">
|
|
|
- <div slot="error" class="image-slot">
|
|
|
- <el-image :src="noimage"> </el-image>
|
|
|
- </div>
|
|
|
- </el-image>
|
|
|
- </el-col>
|
|
|
- <el-col :span="13" class="text">
|
|
|
- <p class="title textOver">{{ item.title }}</p>
|
|
|
- <p class="desc">{{ item.desc }}</p>
|
|
|
- <p class="time textOver">{{ item.create_time }}</p>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
+ <van-tabs v-model="active">
|
|
|
+ <van-tab title="创新成果">
|
|
|
+ <list :channellist="onelist"></list>
|
|
|
+ </van-tab>
|
|
|
+ <van-tab title="科技普及">
|
|
|
+ <list :channellist="twolist"></list>
|
|
|
+ </van-tab>
|
|
|
+ <van-tab title="专家讲堂">
|
|
|
+ <list :channellist="threelist"></list>
|
|
|
+ </van-tab>
|
|
|
+ </van-tabs>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -31,8 +26,9 @@
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
|
+import list from './parts/list.vue';
|
|
|
const { mapActions: channel } = createNamespacedHelpers('channel');
|
|
|
-
|
|
|
+const { mapActions: markettype } = createNamespacedHelpers('markettype');
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -41,6 +37,7 @@ export default {
|
|
|
props: {},
|
|
|
components: {
|
|
|
NavBar,
|
|
|
+ list,
|
|
|
},
|
|
|
data: function() {
|
|
|
return {
|
|
@@ -50,24 +47,47 @@ export default {
|
|
|
isleftarrow: '',
|
|
|
// 返回
|
|
|
navShow: true,
|
|
|
- //列表
|
|
|
- list: [],
|
|
|
- noimage: require('@/assets/kjzx.jpg'),
|
|
|
+ active: 0,
|
|
|
+ onelist: [],
|
|
|
+ twolist: [],
|
|
|
+ threelist: [],
|
|
|
+ // 类型
|
|
|
+ typelist: [],
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.search();
|
|
|
+ async created() {
|
|
|
+ await this.searchtype();
|
|
|
+ await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...channel(['query', 'fetch']),
|
|
|
+ ...markettype({ markettypeList: 'query' }),
|
|
|
+ ...channel(['query', 'delete', 'update', 'create']),
|
|
|
async search() {
|
|
|
- const res = await this.query();
|
|
|
+ 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, `list`, res.data);
|
|
|
+ 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);
|
|
|
}
|
|
|
},
|
|
|
- show(data) {
|
|
|
- this.$router.push({ path: '/channel/detail', query: { id: data.id } });
|
|
|
+
|
|
|
+ // 查询字典表
|
|
|
+ async searchtype() {
|
|
|
+ // 类型
|
|
|
+ let res = await this.markettypeList({ category: '04' });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `typelist`, res.data);
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
@@ -98,57 +118,4 @@ export default {
|
|
|
height: 46px;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
-.main {
|
|
|
- .con {
|
|
|
- padding: 10px;
|
|
|
- // background: #f1f1f1;
|
|
|
- min-height: 620px;
|
|
|
- .list {
|
|
|
- padding: 10px;
|
|
|
- background-color: #fff;
|
|
|
- border-radius: 5px;
|
|
|
- margin: 0 0 10px 0;
|
|
|
- .video {
|
|
|
- height: 100px;
|
|
|
- overflow: hidden;
|
|
|
- .el-image {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- border-radius: 10px;
|
|
|
- /deep/.image-slot {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .text {
|
|
|
- height: 100px;
|
|
|
- overflow: hidden;
|
|
|
- position: relative;
|
|
|
- padding: 0 0 0 10px;
|
|
|
- .title {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
- .desc {
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: -webkit-box;
|
|
|
- -webkit-line-clamp: 3;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- padding: 3px 0;
|
|
|
- font-size: 12px;
|
|
|
- color: #666;
|
|
|
- }
|
|
|
- .time {
|
|
|
- position: absolute;
|
|
|
- bottom: 0px;
|
|
|
- width: 95%;
|
|
|
- font-size: 12px;
|
|
|
- color: #666;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|