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
110
111
112
113
114
115
116
117
118
119
120
121
122
<template>
<view class="container">
<view class="page">
<view class="item" v-for="(item, index) in noticeList" :key="item.id" @click="toDetail(item, index)">
<view class="top">
<view class="title">
<view class="point" v-if="item.noticeStatus === '0'"></view>
<!-- <image src="../../static/images/img01.png" class="icon"></image> -->
<view class="name">{{item.noticeTitle}}</view>
</view>
<image src="../../static/images/icon_more.png" class="arrow"></image>
</view>
<view class="con">{{item.noticeContent}}</view>
</view>
</view>
<no-data :show="noticeList.length === 0" text="暂无消息"></no-data>
</view>
</template>
<script>
import {
getUserNoticeListApi,
updateStatusApi
} from '@/config/api.js'
import noData from '@/components/no-data/no-data'
export default {
components: {noData},
data() {
return {
noticeList: []
}
},
methods: {
toDetail(row, index) {
if(row.busType === 'repair') { // 维修
uni.navigateTo({
url: `/pages/maintenanceAaudit/index?id=${row.busId}`
});
} else if(row.busType === 'complaint') { // 投诉
uni.navigateTo({
url: '/pages/complaintsDetail/index?id=' + row.busId
});
} else { // 缴费
uni.navigateTo({
url: `/pages/payCostDetails/index?id=${row.busId}`,
});
}
if(this.noticeList[index].noticeStatus === '0') {
this.noticeList[index].noticeStatus = '1'
}
updateStatusApi({id: row.id, noticeUserId: row.noticeUserId}) // 更改消息状态
},
async getList() {
let {result} = await getUserNoticeListApi()
this.noticeList = result.records
}
},
onLoad(option) {
this.getList(option.id)
}
}
</script>
<style>
page {
background-color: #F8F6F9;
}
</style>
<style lang="scss" scoped>
// .page {
// padding: 30rpx;
// }
.page {
padding: 30rpx;
.item {
background-color: #ffffff;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 30rpx;
.top {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20rpx;
margin-bottom: 30rpx;
border-bottom: 1px solid #F0F0F2;
.title {
display: flex;
align-items: center;
.point {
width: 14rpx;
height: 14rpx;
background-color: #F6C864;
border-radius: 14rpx;
}
.name {
font-size: 32rpx;
color: #373737;
margin-left: 20rpx;
}
}
.arrow {
width: 16rpx;
height: 24rpx;
}
}
.con {
font-size: 28rpx;
color: #9D9CA6;
}
}
}
</style>