| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <template>
- <div class="detail-wrap">
- <el-breadcrumb separator="/" class="path">
- <el-breadcrumb-item :to="{ path: '/' }" class="path-home">首页</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: '/cms/help/list' }">帮助列表</el-breadcrumb-item>
- <el-breadcrumb-item class="path-help">帮助详情</el-breadcrumb-item>
- </el-breadcrumb>
- <div class="help-detail" v-loading="loading">
- <div class="title">{{ detail.title }}</div>
- <div class="info">
- <div class="time">{{ $util.timeStampTurnTime(detail.create_time) }}</div>
- </div>
- <div class="content" v-html="detail.content"></div>
- </div>
- </div>
- </template>
- <script>
- import {
- mapGetters
- } from 'vuex';
- import {
- helpDetail
- } from '@/api/cms/help';
- export default {
- name: 'help_detail',
- components: {},
- data: () => {
- return {
- detail: [],
- 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() {
- helpDetail({
- id: this.id
- })
- .then(res => {
- if (res.code == 0) {
- if (res.data) {
- this.loading = false;
- this.detail = res.data;
- window.document.title = `${this.detail.title} - ${this.siteInfo.site_name}`;
- } else {
- this.$router.push({
- path: '/cms/help/list'
- });
- }
- }
- })
- .catch(err => {
- this.loading = false;
- this.$message.error(err.message);
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .detail-wrap {
- width: 1210px;
- margin: 20px auto;
- background-color: #fff;
- }
- .path {
- padding: 15px;
- }
- .help-detail {
- background-color: #ffffff;
- padding: 10px;
- border-radius: 5px;
- margin: 10px 0;
- .title {
- text-align: center;
- font-size: 18px;
- margin: 10px 0;
- }
- .info {
- // margin: 0 43px;
- border-bottom: 1px dotted #e9e9e9;
- .time {
- text-align: center;
- color: #838383;
- margin-bottom: 17px;
- }
- }
- .content {
- padding-top: 10px;
- // margin: 0 65px;
- }
- }
- </style>
|