123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <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({ newsguidancefetch: 'fetch' }),
- ...newsroadshow({ newsroadshowfetch: 'fetch' }),
- async search() {
- if (this.type === '1') {
- let res = await this.newsguidancefetch(this.id);
- if (this.$checkRes(res)) {
- this.$set(this, `detailinfo`, res.data);
- }
- } else {
- let res = await this.newsroadshowfetch(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;
- height: 250px;
- }
- }
- .content {
- margin-top: 10px;
- padding: 0px 10px;
- }
- }
- </style>
|