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
<template>
<view class="index">
<view class="notice">
<view class="notice-item margin-top" v-for="(item,index) in noticeList" :key="index" @click="viewNoticeDetail(item)" hover-class="cell-hover" :hover-stay-time="50">
<view class="flex">
<span class="left-content text-cut text-left basis-lg">{{item.announcementTitle}}</span>
<span class="right-content text-right text-xs basis-sm">
{{ item.announcementDate.split(" ")[0] }}
<text class="notice-flag"> {{ item.hospitalBean?'医院发布':'平台发布'}} </text>
</span>
</view>
<view class="text-cut notice-item-content">
<span :class="item.type == '2'?'bg-notice':'bg-announcement'">
</span>
<span :class="item.type == '2'?'padding-notice':'padding-announcement'">
{{item.announcementDesc}}
</span>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
noticeList:[]
}
},
mounted() {
this.getNotice()
},
methods: {
viewNoticeDetail(item){
uni.navigateTo({url:`/personModule/notice/detail?id=${item.id}&type=announce` })
},
// 获取通知/公告列表
getNotice(){
const data = { params:{pageNum:1,pageSize:10,hospitalId: this.$store.getters.userInfo.hospitalId} }
this.$http.get(`/gastric-cancer-data/announcement/announce/list`,data).then(res => {
const d = res.data
if(d.code == 1){
this.noticeList = d.object.list
}
}).catch(err => {
console.log(err)
})
}
}
}
</script>
<style lang="scss" scoped>
.index {
height: 100%;
.notice{
padding: 0 30upx;
padding-bottom:30upx;
.left-content{
color:#000;
}
.right-content{
vertical-align: bottom;
padding-top: 8upx;
color:rgba(0,0,0,0.5);
}
.notice-item{
// border:2upx solid rgba(153, 153, 153, 0.4);
padding: 20upx;
background-color: #FFFFFF;
border-radius: 10upx;
.notice-item-content{
font-size: 26upx;
margin-top: 12upx;
color:#666666;
}
&.cell-hover{
background:#fafafa;
}
}
.bg-announcement,.bg-notice{
height: 28upx;
width: 32upx;
display: inline-block;
background-position: left;
vertical-align: text-top;
background-size: cover;
background-repeat: no-repeat;
background-image: url(../../static/announcement.png);
}
.bg-notice{
background-image: url(../../static/notice.png);
}
.padding-notice{
padding-left: 4upx;
}
.padding-announcement{
padding-left: 14upx;
}
}
.cu-tag{
padding: 0px 12upx;
height: 42upx;
line-height:43upx;
font-size: 20upx;
}
}
.notice-flag{
border-radius: 14upx;
border: 2upx solid #59A0F6;
padding: 3upx 4upx;
margin-left: 7upx;
font-size: 24upx;
}
</style>