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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<template>
    <div class="message-list-component">
        <div class="scroller-box">
            <div class="message-body"
                 @click="handleNewsJump(i)"
                 v-for="(i,index) in list"
                 :key="index">
                <div class="message-body-header" :class="{'unRead':i.unRead}">{{i.title}}</div>
                <div class="message-body-con">{{i.content}}</div>
                <div class="message-body-foot" :class="{'unRead':i.unRead}">
                    {{ dateFormat(i.noticeTime, 'YYYY-MM-DD HH:mm:ss')}}
                </div>
            </div>
        </div>
        <div class="nothing" v-if="showNone">
            <img src="../assets/img/nothing.png" alt="这里什么都没有哦">
            <p>这里什么都没有</p>
        </div>
    </div>
</template>
<script>
    /**
     * Created by 吴彦祖 on 2018/3/16.
     * Message list , for mine -> message center page
     * only one param to use:
     * @params
     * @lists {Array} the data which to show the list;
     */
    import {dateFormat} from 'vux'
    import sysApi from '../api/api';
    import statusCodeManage from '../api/statusCodeManage';
 
    export default {
        name: 'message-list',
        data () {
            return {
                dateFormat: dateFormat,
                active: true,
                colorActive: false
            }
        },
        props: {
            list: {
                type: Array
            },
            showNone: {
                type: Boolean,
                default: false
            }
        },
        methods: {
            // 公告跳转
            handleNewsJump (noticeItem) {
                this.$emit('on-click-notice', noticeItem);
            }
        },
    }
</script>
 
<style lang="less">
    @import '../style/mixin.less';
 
    .message-list-component {
        .nothing {
            padding-top: 50px;
            text-align: center;
            img {
                width: 120px;
                height: auto;
            }
            p {
                font-size: @font-size-small;
                line-height: 30px;
                color: @color-text-third;
            }
        }
        .message-body {
            background-color: @color-white;
            padding: 0 12px;
            .message-body-header {
                height: 40px;
                margin-top: @font-size-tiny;
                color: @color-text-third;
                line-height: 40px;
                font-size: @font-size-medium;
                .ellipsis()
            }
            .message-body-con {
                margin: 0 0 10px 0;
                color: @color-text-third;
                font-size: @font-size-small;
                .ellipsisLn(3);
            }
            .message-body-foot {
                height: 33px;
                border-top: solid 1px @color-background-default;
                line-height: 33px;
                text-align: right;
                padding-right: @font-size-tiny;
            }
            .textColor {
                color: #999;
            }
        }
        .unRead {
            color: @color-text-primary !important;
        }
    }
</style>