| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <template>
- <div class="notice-wrap">
- <el-breadcrumb separator="/" class="path">
- <el-breadcrumb-item :to="{ path: '/' }" class="path-home">首页</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: '/cms/notice/list' }">公告列表</el-breadcrumb-item>
- <el-breadcrumb-item class="path-help">公告详情</el-breadcrumb-item>
- </el-breadcrumb>
- <div class="notice-detil" v-loading="loading">
- <div class="notice-info">
- <div class="title">{{ info.title }}</div>
- <div class="time">{{ $util.timeStampTurnTime(info.create_time) }}</div>
- </div>
- <div class="content" v-html="info.content"></div>
- </div>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex';
- import { noticeDetail } from '@/api/cms/notice';
- export default {
- name: 'notice_detail',
- components: {},
- data: () => {
- return {
- info: {},
- loading: true
- };
- },
- created() {
- this.id = this.$route.query.id;
- this.getDetail();
- },
- computed: {
- ...mapGetters(['siteInfo'])
- },
- watch: {
- $route(curr) {
- this.id = curr.query.id;
- this.getDetail();
- }
- },
- methods: {
- getDetail() {
- noticeDetail({
- id: this.id
- })
- .then(res => {
- if (res.data) {
- this.info = res.data;
- this.loading = false;
- window.document.title = `${this.info.title} - ${this.siteInfo.site_name}`;
- } else {
- this.$router.push({
- path: '/cms/notice/list'
- });
- }
- })
- .catch(err => {
- this.loading = false;
- this.$message.error(err.message);
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .notice-wrap {
- width: $width;
- margin: 0 auto 45px;
- }
- .notice-detil {
- background-color: #ffffff;
- min-height: 300px;
- margin: 10px 0;
- padding: 10px;
- .title {
- text-align: center;
- font-size: 18px;
- margin: 10px 0;
- }
- .time {
- text-align: center;
- color: #838383;
- margin-bottom: 17px;
- }
- .notice-info {
- margin: 0 43px;
- border-bottom: 1px dotted #e9e9e9;
- }
- .content {
- padding-top: 10px;
- margin: 0 65px;
- }
- }
- .path {
- padding: 15px 0;
- }
- </style>
|