|
@@ -0,0 +1,140 @@
|
|
|
+<template>
|
|
|
+ <div id="detail">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="detail">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow" @onClickLeft="back"> </NavBar>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <span v-if="type == '4'">
|
|
|
+ <pantentDeatil :info="info"></pantentDeatil>
|
|
|
+ </span>
|
|
|
+ <span v-else-if="type == '1'">
|
|
|
+ <tecDetail :info="info"></tecDetail>
|
|
|
+ </span>
|
|
|
+ <span v-else-if="type == '0'">
|
|
|
+ <demandDetail :info="info"></demandDetail>
|
|
|
+ </span>
|
|
|
+ <span v-else-if="type == '2'">
|
|
|
+ <serveDetail :info="info"></serveDetail>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <expertDetail></expertDetail>
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+import NavBar from '@/layout/common/topInfo.vue';
|
|
|
+//e专利详情
|
|
|
+import pantentDeatil from './detailParts/pantentDeatil.vue';
|
|
|
+//科技成果详情
|
|
|
+import tecDetail from './detailParts/tecDetail.vue';
|
|
|
+//科技需求详情
|
|
|
+import demandDetail from './detailParts/demandDetail.vue';
|
|
|
+//在线服务详情
|
|
|
+import serveDetail from './detailParts/serveDetail.vue';
|
|
|
+//专家智库详情
|
|
|
+import expertDetail from './detailParts/expertDetail.vue';
|
|
|
+const { mapActions: product } = createNamespacedHelpers('product');
|
|
|
+export default {
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ name: 'detail',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ //顶部
|
|
|
+ NavBar,
|
|
|
+ //e专利详情
|
|
|
+ pantentDeatil,
|
|
|
+ //科技成果详情
|
|
|
+ tecDetail,
|
|
|
+ //科技需求详情
|
|
|
+ demandDetail,
|
|
|
+ //在线服务详情
|
|
|
+ serveDetail,
|
|
|
+ //专家智库详情
|
|
|
+ expertDetail,
|
|
|
+ },
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ // 头部标题
|
|
|
+ title: '',
|
|
|
+ // meta为true
|
|
|
+ isleftarrow: '',
|
|
|
+ // 返回
|
|
|
+ navShow: true,
|
|
|
+ info: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
+ await this.setTitle();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...product(['fetch']),
|
|
|
+ //查详情
|
|
|
+ async search() {
|
|
|
+ if (this.type == '4') {
|
|
|
+ console.log('专利');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const res = await this.fetch(this.id);
|
|
|
+ // console.log(res.data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `info`, res.data);
|
|
|
+ // console.log(this.info);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //设置标题
|
|
|
+ setTitle() {
|
|
|
+ let type = this.type;
|
|
|
+ if (type == '1') {
|
|
|
+ this.$set(this, `title`, '科技成果');
|
|
|
+ } else if (type === '4') {
|
|
|
+ this.$set(this, `title`, 'e专利');
|
|
|
+ } else if (type == '0') {
|
|
|
+ this.$set(this, `title`, '科技需求');
|
|
|
+ } else if (type == '2') {
|
|
|
+ this.$set(this, `title`, '在线服务');
|
|
|
+ } else {
|
|
|
+ this.$set(this, `title`, '专家智库');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 返回首页
|
|
|
+ back() {
|
|
|
+ this.$router.push({ path: '/market/index' });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ type() {
|
|
|
+ return this.$route.query.type;
|
|
|
+ },
|
|
|
+ id() {
|
|
|
+ return this.$route.query.id;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.detail {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 667px;
|
|
|
+ position: relative;
|
|
|
+ background-color: #f9fafc;
|
|
|
+}
|
|
|
+.top {
|
|
|
+ height: 46px;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.main {
|
|
|
+ min-height: 570px;
|
|
|
+}
|
|
|
+</style>
|