<template>
    <div class="el-twinfo_show_detail_mobile_1">
        <!--4.3.1.	图文详情展示组件1开始-->
        <div class="twinfo_show_detail_mobile_1">
            <span class="title1">{{news.title}}</span>
            <span class="info1">
                <span class="sp1"><i class="tip1">新闻</i>发布于<i class="time1">{{news.newsPubDate | formatDate}}</i></span>
                <span class="sp2">
<!--                    <i class="faving">(760)</i>-->
<!--                    <i class="dianzan">(345)</i>-->
                </span>
            </span>
            <span class="mainbody" v-html="news.content"></span>
            <span class="mainbody-more">
<!--                <a href="">展开全部内容</a>-->
            </span>
        </div>
        <!--4.3.1.	图文详情展示组件1结束-->
    </div>
</template>

<script>
    import {httpPost} from '../../../src/utils/utils';
    import formMixin from '../../../src/mixins/formMixin';
    import lenye_base from 'lenye_base';
    import $ from "fy-kit";

    export default {
        name: 'ElTwinfoShowDetailMobile1',
        mixins: [formMixin],
        model: {},
        filters: {
            formatDate: function (value) {
                if (value == '' || value == 'undefined') {
                    return '';
                }
                var datavalue = value.replace(/\-/g, '/');
                let date = new Date(datavalue);
                let y = date.getFullYear();
                let MM = date.getMonth() + 1;
                MM = MM < 10 ? ('0' + MM) : MM;
                let d = date.getDate();
                d = d < 10 ? ('0' + d) : d;
                let h = date.getHours();
                h = h < 10 ? ('0' + h) : h;
                let m = date.getMinutes();
                m = m < 10 ? ('0' + m) : m;
                let s = date.getSeconds();
                s = s < 10 ? ('0' + s) : s;
                return y + '年' + MM + '月' + d + '日 ' + h + ":" + m + ":" + s;
            },
        },
        data() {
            return {
                articleId:'',
                news:{}
            }
        },
        created() {
            this.articleId = $.util.urlParams('id')
        },
        mounted() {
            console.log(httpPost);
            this.getOne();
            console.log(lenye_base);
        },
        computed: {},
        methods: {
            getOne(){
                let that = this;
                httpPost(lenye_base.base_data.getapiUrl() + '/news-service/common/newsArticle/queryById.do',
                    lenye_base.base_data.getformatting({
                        articleId: this.articleId,
                    }),
                    function (data) {
                        that.news = data.data;

                    }
                );
            }
        },
    };
</script>
