<template>
    <van-sticky>
        <van-nav-bar title="消息" left-arrow
                     @click-left="handleNavLeftClick">
        </van-nav-bar>
    </van-sticky>
    <div class="message-content">
        <h3 class="font-size-16">{{message_info.name}}</h3>
        <h4 class="mt5 font-size-13">{{message_info.create_dateline_format}}</h4>
        <div class="mt10 font-size-13 text-normal" v-html="message_info.content" style="width: 100%;word-break: break-all"></div>
    </div>
</template>

<script>
import {message_detail} from "@/pages/_chat/detail/api.js";

export default {
    name: "index",
    data() {
        return {
            ni_id: '',
            message_info: {}
        }
    },
    methods: {
        getMessageInfo() {
            let data = {
                ni_id: this.ni_id,
            };

            message_detail(data).then((res) => {
                if (res.code == 1) {
                    this.message_info = res.data.one_info;
                    console.log(this.message_info, 88)
                }
            });
        },
        handleNavLeftClick() {
            this.$router.push({name:'chat'});
        },
    },
    mounted() {
        if (this.$route.params.id != "") {
            this.ni_id = this.$route.params.id;
            this.getMessageInfo();
        }
    }
}
</script>

<style lang="scss" scoped>
@import "@/styles/mixin.scss";

.message-content {
    width: 100%;
    background: #fff;
    padding: 15px;
}
</style>
