qingyiay
2023-04-12 1ef0e393913961c11ea05f868a537015572d7b7c
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
<template>
    <view>
        <combined-title title="消息详情"></combined-title>
        <view class="compDetails" v-for="(item, index) in detail" :key="index">
            <uni-table border stripe emptyText="暂无更多数据">
                <uni-tr>
                    <uni-th align="left">消息标题</uni-th>
                    <uni-td align="left">{{ item.title || '' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">消息内容</uni-th>
                    <uni-td align="left">{{ item.content || '' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">创建时间</uni-th>
                    <uni-td align="left">{{ item.createTime || '' }}</uni-td>
                </uni-tr>
            </uni-table>
        </view>
    </view>
</template>
 
<script>
export default {
    data() {
        return {
            index: '',
            detail: []
        };
    },
    onLoad(v) {
        this.index = v.index;
    },
    onShow() {
        this.messageReq();
    },
    methods: {
        messageReq() {
            uni.showLoading({
                title: '加载中'
            });
            this.$reqGet('getMessageByUser', { current: 1, size: 10 }).then(res => {
                if (res.code == 0) {
                    uni.hideLoading();
                    this.detail = res.data.records.filter((v, i) => i == this.index);
                } else {
                    this.$u.toast('加载失败');
                }
            });
        }
    }
};
</script>
 
<style></style>