290144e9
易尊强
第一次
|
1
2
3
|
<template>
<view class="page">
<view class="coupon-tab">
|
e6b161ae
易尊强
2/23
|
4
|
<view class="tab" :class="{'action':TabShow===0}" @click="onCouponTab(0,'360234116366468357')">
|
290144e9
易尊强
第一次
|
5
6
|
<text>公示</text>
</view>
|
e6b161ae
易尊强
2/23
|
7
|
<view class="tab" :class="{'action':TabShow===1}" @click="onCouponTab(1,'530362479830631685')">
|
290144e9
易尊强
第一次
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<text>通知</text>
</view>
</view>
<!-- 搜索 -->
<view class="search-head">
<view class="search">
<image src="../../static/fdj1.png"></image>
<text></text>
<input type="text" v-model="keyword" placeholder="搜索关键词" />
</view>
<view class="btn" @click="search">
<text>搜索</text>
</view>
</view>
<!-- 文章数据 通知区域Tabshow为0显示-->
|
9b1c150c
“wangming”
1
|
24
|
<view class="list_post" v-if="TabShow===0">
|
290144e9
易尊强
第一次
|
25
26
27
28
29
30
31
32
33
34
|
<!-- 党的建设发布 -->
<view class="postCon" v-show="isAdmin"
@click="toPostNotice()">
公式公告发布
</view>
<!-- <mescroll-body ref="mescrollRef" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption"
:top="0"> -->
<view>
<view class="article-data">
<view class="article-list">
|
bd028579
易尊强
2/28
|
35
|
<view class="list" v-for="(item,index) in noticeList" @click="onArticle(item.id)" :key="index">
|
9b1c150c
“wangming”
1
|
36
|
<view class="item" style="width: 100%;">
|
290144e9
易尊强
第一次
|
37
38
39
40
41
42
43
44
45
|
<view class="title">
<text class="two-omit">{{item.title}}</text>
</view>
<view class="find-collect">
<view class="find">
<text>{{item.createTime}}</text>
</view>
</view>
</view>
|
e6b161ae
易尊强
2/23
|
46
47
|
<view class="thumb" v-if="item.isImg">
<image :src="baseUrl + item.imgUrl[0].url"></image>
|
290144e9
易尊强
第一次
|
48
|
</view>
|
6c679290
易尊强
3/6a上午
|
49
|
<!-- <view class="thumb" v-else>
|
290144e9
易尊强
第一次
|
50
|
<image src="../../static/img/img3.jpg"></image>
|
6c679290
易尊强
3/6a上午
|
51
|
</view> -->
|
290144e9
易尊强
第一次
|
52
53
54
55
56
57
58
59
|
</view>
</view>
</view>
</view>
<!-- </mescroll-body> -->
</view>
<!-- 通知区域Tabshow为1显示 -->
|
9b1c150c
“wangming”
1
|
60
|
<view class="list_post" v-if="TabShow===1">
|
290144e9
易尊强
第一次
|
61
62
63
64
65
66
67
68
|
<!-- 党的建设发布 -->
<view class="postCon" v-show="isAdmin"
@click="toPostNotice()">
公式公告发布
</view>
<view>
<view class="article-data">
<view class="article-list">
|
bd028579
易尊强
2/28
|
69
|
<view class="list" v-for="(item,index) in noticeList" @click="onArticle(item.id)" :key="index">
|
290144e9
易尊强
第一次
|
70
71
72
73
74
75
76
77
78
79
|
<view class="item">
<view class="title">
<text class="two-omit">{{item.title}}</text>
</view>
<view class="find-collect">
<view class="find">
<text>{{item.createTime}}</text>
</view>
</view>
</view>
|
e6b161ae
易尊强
2/23
|
80
81
|
<view class="thumb" v-if="item.isImg">
<image :src="baseUrl + item.imgUrl[0].url"></image>
|
290144e9
易尊强
第一次
|
82
|
</view>
|
1af1c1b1
易尊强
2/29 17:39
|
83
|
<!-- <view class="thumb" v-else>
|
290144e9
易尊强
第一次
|
84
|
<image src="../../static/img/img3.jpg"></image>
|
1af1c1b1
易尊强
2/29 17:39
|
85
|
</view> -->
|
290144e9
易尊强
第一次
|
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
|
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import utils from '../../service/utils';
export default {
data() {
return {
TabShow: 0,
categorrId:'360234116366468357',
// 公式列表
publicityList:[],
// 通知列表
noticeList:[],
// 判断你是否有图片
isImg:false,
// downOption:{
// }
keyword:'',
|
e6b161ae
易尊强
2/23
|
111
|
isAdmin:false,
|
9b1c150c
“wangming”
1
|
112
|
baseUrl: "https://www.dygxq-es.cn",
|
290144e9
易尊强
第一次
|
113
114
115
116
|
};
},
onLoad() {
this.getUser()
|
e6b161ae
易尊强
2/23
|
117
|
this.getNoticeList(this.categorrId)
|
290144e9
易尊强
第一次
|
118
119
|
},
methods: {
|
6c679290
易尊强
3/6a上午
|
120
|
// 获取用户信息判断是否有公示公告和新闻信息发布的ID,权限判断authority = 194684404600145157
|
290144e9
易尊强
第一次
|
121
122
123
124
|
getUser(){
if (uni.getStorageSync('user')) {
let userCode = uni.getStorageSync('user')
// console.log("用户的code", this.userCode)
|
6c679290
易尊强
3/6a上午
|
125
126
127
128
129
130
131
|
// this.userId = userCode.userInfo.userId
// this.userName = userCode.userInfo.userAccount
// this.userIcon = userCode.userInfo.headIcon
// this.organizeName = userCode.userInfo.organizeName
let authorityID = userCode.permissionList
this.isAdmin = authorityID.some(it => it.modelId === '194684404600145157')
console.log('是否有公示公告和新闻信息权限',this.isAdmin)
|
290144e9
易尊强
第一次
|
132
|
console.log(userCode)
|
6c679290
易尊强
3/6a上午
|
133
|
|
290144e9
易尊强
第一次
|
134
135
136
137
138
139
140
141
|
} else {
uni.showToast({
title: '请登录',
icon: 'none'
})
}
},
// 获取公式列表
|
e6b161ae
易尊强
2/23
|
142
|
getNoticeList(id){
|
290144e9
易尊强
第一次
|
143
144
|
let that = this
that.API.getNoticeList({
|
e6b161ae
易尊强
2/23
|
145
|
categoryId:id,
|
290144e9
易尊强
第一次
|
146
147
148
149
150
151
152
|
pageSize:500
}).then(res=>{
if(res.code == 200){
that.noticeList = res.data.list.map(it=>{
return {
...it,
createTime:utils.formatTime(it.createTime),
|
e6b161ae
易尊强
2/23
|
153
|
isImg: it.imgUrl.length > 0
|
290144e9
易尊强
第一次
|
154
155
156
157
158
159
160
161
162
163
164
165
166
|
}
})
// if(that.noticeList.)
}
console.log(that.noticeList)
})
},
// 跳转到公式公告发布
toPostNotice(){
uni.navigateTo({
url: '/pages/postNotice/postNotice'
})
},
|
e6b161ae
易尊强
2/23
|
167
|
onCouponTab(type,id) {
|
290144e9
易尊强
第一次
|
168
|
this.TabShow = type;
|
e6b161ae
易尊强
2/23
|
169
170
|
this.categorrId = id
this.getNoticeList(id)
|
290144e9
易尊强
第一次
|
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
},
onArticle(item) {
uni.navigateTo({
url: `/pages/newsDetail/newsDetail?data=${JSON.stringify(item)}`
})
},
search(){
let that = this
that.API.getNoticeList({
categoryId:this.categorrId,
keyword:this.keyword
}).then(res=>{
if(res.code == 200){
that.noticeList = res.data.list.map(it=>{
return {
...it,
createTime:utils.formatTime(it.createTime),
|
e6b161ae
易尊强
2/23
|
188
|
isImg: it.imgUrl.length > 0
|
290144e9
易尊强
第一次
|
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
}
})
// if(that.noticeList.)
}
console.log(that.noticeList)
})
}
}
}
</script>
<style scoped lang="scss">
@import 'notice.scss';
</style>
|