ann0707
2018-08-16 c9bc8ec61cff4076132f6396d99d383a2cdf5a03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
    <div class="message-detail-page">
        <x-header :left-options="{backText: ''}">消息详情</x-header>
        <div style="margin: auto 12px;" v-html="messageContent"></div>
    </div>
</template>
 
<script>
    /**
     * Created by z.x.q on 2018/3/22.
     * 我的--消息详情
     */
    import {XHeader} from 'vux';
    import system from '../../api/api';
    import statusCodeManage from '../../api/statusCodeManage';
 
    export default {
        name: 'f-message-detail',
        components: {
            XHeader
        },
        data(){
            return {
                messageContent: ''
            }
        },
        methods: {
            init (noticeId) {
                let _this = this;
                system.fetchNoticeDetail ({noticeId: noticeId}).then((res) =>{
                    _this.messageContent = res.body.detailContent;
                    system.homeNotice().then(
                        res=>{
                            if(res.body.length){
                                window.sessionStorage.setItem('unRead',JSON.stringify(res.body));
                            }else{
                                window.sessionStorage.setItem('unRead','[]');
                            }
                        },
                        err=>{
                            statusCodeManage.showTipOfStatusCode(err,_this);
                        }
                    )
                }, (error)=>{
 
                });
            }
        },
        activated: function () {
            this.messageContent = '';
            this.$store.commit('UPDATE_DIRECTION', {direction: 'in'});
            // 获取资讯的内容
            let noticeId = this.$route.params.id;
            this.init(noticeId);
        },
        deactivated () {
            this.$store.commit('UPDATE_DIRECTION', {direction: 'none'});
        }
    }
</script>
 
<style lang="less">
    @import "../../style/mixin.less";
 
    .message-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;
                }
 
            }
        }
    }
 
 
</style>