<template>
|
<div class="news-detail-page">
|
<x-header
|
:left-options.showBack="{backText: ''}"
|
:title="'资讯'"
|
></x-header>
|
<div style="margin: auto 12px">
|
<div v-text="newsTitle" class="article_title"></div>
|
<div class="newsInformation_List">
|
<span class="new-style-test-article-publish-time" v-text="newsAuthor"></span>
|
<span class="new-style-test-article-publish-time" style="margin-left: 20px" v-text="formatTime(newsCreateTime)">asdasdasd</span>
|
</div>
|
<div class="newsContent" style="font-size:130%;width: 100%;word-break: break-all;word-wrap: break-word;" v-html="newsContent"></div>
|
</div>
|
</div>
|
</template>
|
<script>
|
/**
|
* Created by c.y on 2018/3/31.
|
* 资讯内容
|
*/
|
import {XHeader,dateFormat} from 'vux';
|
import sysApi from '../../api/api';
|
import statusCodeManage from '../../api/statusCodeManage';
|
|
export default {
|
name: 'f-news-detail',
|
components: {
|
XHeader
|
},
|
data() {
|
return {
|
newsContent: '', // 资讯内容
|
newsTitle: '', // 资讯标题
|
newsAuthor: '', // 资讯作者
|
newsCreateTime: '', // 资讯时间
|
}
|
},
|
methods: {
|
init(newsId) {
|
let _this = this;
|
sysApi.fetchNewsDetail({noticeId: newsId}).then((res) => {
|
_this.newsContent = res.body.detailContent;
|
_this.newsTitle = res.body.title;
|
_this.newsAuthor = res.body.writer;
|
_this.newsCreateTime = res.body.pushTime;
|
}, (error) => {
|
statusCodeManage.showTipOfStatusCode(error, _this);
|
});
|
},
|
formatTime(dt){
|
return dateFormat(dt,'YYYY-MM-DD');
|
}
|
},
|
activated: function () {
|
this.newsContent = '';
|
this.newsTitle = '';
|
this.newsAuthor = '';
|
this.newsCreateTime = '';
|
this.$store.commit('UPDATE_DIRECTION', {direction: 'in'});
|
// 获取资讯的内容
|
let newsId = this.$route.query.id;
|
this.init(newsId);
|
},
|
deactivated: function () {
|
this.$store.commit('UPDATE_DIRECTION', {direction: 'none'});
|
}
|
}
|
</script>
|
<style lang="less">
|
@import '../../style/mixin.less';
|
.news-detail-page{
|
.vux-header {
|
.color-linear-gradient(@color-primary-light, @color-primary, 90deg);
|
.vux-header-title {
|
font-size: 18px;
|
}
|
.vux-header-left {
|
.left-arrow:before {
|
border: solid 1px @color-white;
|
border-width: 2px 0 0 2px;
|
}
|
}
|
}
|
.newsContent *{
|
margin: auto;
|
}
|
.article_title {
|
margin-top: 12px;
|
color: #000;
|
font-size: 22px;
|
line-height: 1.45;
|
font-weight: 500;
|
}
|
.newsInformation_List{
|
margin: 8px 0;
|
}
|
.new-style-test-article-publish-time {
|
|
font-size: 11px;
|
color: #999;
|
vertical-align: top;
|
display: inline-block;
|
}
|
.newsContent ul li,.newsContent ol li{
|
list-style-position:inside;
|
}
|
|
}
|
</style>
|