|
@@ -0,0 +1,135 @@
|
|
|
+<template>
|
|
|
+ <div id="detail2">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="title">{{ detailinfo.title }}</el-col>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <span>时间:{{ detailinfo.publish_time }}</span>
|
|
|
+ <span>来源:{{ detailinfo.orgin }}</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="img">
|
|
|
+ <el-image :src="detailinfo.picture" style="width:100%; height: 100%"></el-image>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="video">
|
|
|
+ <video :src="detailinfo.filepath" controls="controls">
|
|
|
+ 您的浏览器不支持 video 标签。
|
|
|
+ </video>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="content">
|
|
|
+ <p v-html="detailinfo.content"></p>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+import NavBar from '@/layout/common/topInfo.vue';
|
|
|
+const { mapActions: newsguidance } = createNamespacedHelpers('newsguidance');
|
|
|
+const { mapActions: newsroadshow } = createNamespacedHelpers('newsroadshow');
|
|
|
+export default {
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ name: 'detail2',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ NavBar,
|
|
|
+ },
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ // 头部标题
|
|
|
+ title: '',
|
|
|
+ // meta为true
|
|
|
+ isleftarrow: '',
|
|
|
+ // 返回
|
|
|
+ navShow: true,
|
|
|
+ //详情
|
|
|
+ detailinfo: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ if (this.id) {
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...newsguidance(['fetch']),
|
|
|
+ ...newsroadshow(['fetch']),
|
|
|
+ async search() {
|
|
|
+ if (this.type === '1') {
|
|
|
+ let res = await this.fetch(this.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `detailinfo`, res.data);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let res = await this.fetch(this.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `detailinfo`, res.data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ id() {
|
|
|
+ return this.$route.query.id;
|
|
|
+ },
|
|
|
+ type() {
|
|
|
+ return this.$route.query.type;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.title = this.$route.meta.title;
|
|
|
+ this.isleftarrow = this.$route.meta.isleftarrow;
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.top {
|
|
|
+ height: 46px;
|
|
|
+ overflow: hidden;
|
|
|
+ position: relative;
|
|
|
+ z-index: 999;
|
|
|
+}
|
|
|
+.main {
|
|
|
+ .title {
|
|
|
+ color: #409eff;
|
|
|
+ font-size: 18px;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+ .info {
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 10px;
|
|
|
+ border-bottom: 1px solid gray;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ span:nth-child(2) {
|
|
|
+ margin-left: 15px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .img {
|
|
|
+ padding: 0px 10px;
|
|
|
+ height: 200px;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .video {
|
|
|
+ video {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ margin-top: 10px;
|
|
|
+ padding: 0px 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|