achievementsOne.vue
6.84 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<template>
<div class="cardBox">
<!-- <van-tabs v-model="tabsName">
<van-tab title="红色教育"></van-tab>
<van-tab title="劳动教育"></van-tab>
<van-tab title="课外实践"></van-tab>
<van-tab title="研学旅行"></van-tab>
</van-tabs> -->
<van-tabs v-model="sort" @click="tabsClick">
<van-tab title="发布时间">发布时间</van-tab>
<van-tab title="点赞量">点赞量</van-tab>
<van-tab title="阅读量">阅读量</van-tab>
</van-tabs>
<div class="contextBox" v-if="newsList.length != 0" @load="getData">
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getData">
<div class="art_card_pic" v-for="(v, i) in newsList" :key="i" @click="toDetails(v)">
<div class="art_context">
<div class="art_title">{{ v.titleDesc }}</div>
<div class="art_bot">
<!-- <div class="redSticky" v-if="v.readNumber">置顶</div> -->
<!-- <div class="greyTime">发布于 {{ v.createTime ? Moment(v.createTime).format('YYYY-MM-DD HH:mm:ss') : ''}}</div> -->
<div class="greyTime">点赞量 {{ v.likeNumber }}</div>
<div class="greyFont">浏览量 {{ v.readNumber }}</div>
</div>
</div>
<div class="art_pic">
<img :src="v.imgUrl" />
</div>
</div>
</van-list>
<!-- <div
class="art_card_pic"
v-for="(v, i) in newsList"
:key="i"
@click="toDetails(v)"
>
<div class="art_context">
<div class="art_title">{{ v.titleDesc }}</div>
<div class="art_bot">
<div class="greyTime">点赞量 {{ v.likeNumber }}</div>
<div class="greyFont">浏览量 {{ v.readNumber }}</div>
</div>
</div>
<div class="art_pic">
<img :src="v.imgUrl" />
</div>
</div> -->
</div>
<van-empty description="暂无数据" v-else />
<div class="imgPic" @click="toChoose">
<img src="@/assets/changeSchool.png" />
</div>
<tabbar4 active="fruit"></tabbar4>
</div>
</template>
<script>
import Tabbar4 from '@/component/Tabbar4'
export default {
components: { Tabbar4 },
data() {
return {
tabsName: 1,
newsList: [],
pageNum: 1,
pageSize: 10,
finished: false,
loading: false,
sort: 0,
}
},
methods: {
//详情新闻
toDetails(v) {
this.$router.push({
name: 'pageDetails',
query: { schoolId: v.schoolId, dataId: v.id },
})
},
//选择
toChoose() {
this.$router.push({ name: 'chooseSchoolOne' })
},
tabsClick() {
this.newsList = []
this.pageNum = 1
this.pageSize = 10
this.getData()
},
getData() {
this.loading = true
let schoolId = this.$route.query.schoolId ? this.$route.query.schoolId : ''
this.yxAxios
.get(
`${this.kqUrl}/schoolConsult/consultList?pageNum=${this.pageNum}&pageSize=${this.pageSize}&schoolId=` +
schoolId +
`&sort=` +
this.sort
)
.then((res) => {
if (res.data.code == 200) {
this.newsList = this.newsList.concat(res.data.data.list)
this.loading = false
if (this.pageSize * this.pageNum >= res.data.data.total) {
this.finished = true
} else {
this.pageNum++
}
} else {
this.$toast.fail(res.data.message)
}
})
// this.yxAxios
// .post(`${this.dataUrl}/sys/yx/consultList`, {
// page: 1,
// pageSize: 999,
// schoolId: this.$route.query.schoolId*1
// })
// .then((res) => {
// if (res.data.success) {
// this.newsList = res.data.data.list;
// } else {
// this.$toast.fail(res.data.message);
// }
// });
},
},
mounted() {
this.getData()
this.$zwlogPvGlobal({ loadTime: new Date() })
this.$nextTick(() => {
this.$zwlogPvGlobal({ responseTime: new Date() })
})
},
}
</script>
<style lang="scss" scoped>
.cardBox {
padding: 2vw 0;
box-sizing: border-box;
.contextBox {
margin-top: 20px;
margin-bottom: 140px;
.art_card {
padding: 28px;
box-sizing: border-box;
.art_title {
width: 100%;
font-size: 34px;
font-weight: bold;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1; //限制行数
overflow: hidden; //超出部分隐藏
text-overflow: ellipsis; //用一个省略号代替超出的内容
}
.art_bot {
padding-top: 22px;
box-sizing: border-box;
display: flex;
align-items: center;
.redSticky {
color: #ff4444;
font-size: 24px;
padding: 2px;
box-sizing: border-box;
border: 1px solid #ff4444;
}
.greyTime {
color: #999;
font-size: 24px;
margin: 0 20px;
}
.greyFont {
color: #999;
font-size: 24px;
}
}
}
.art_card_pic {
padding: 28px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
.art_context {
height: 180px;
display: flex;
align-content: space-between;
flex-wrap: wrap;
.art_title {
width: 100%;
font-size: 34px;
font-weight: bold;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; //限制行数
overflow: hidden; //超出部分隐藏
text-overflow: ellipsis; //用一个省略号代替超出的内容
}
.art_bot {
padding-top: 22px;
box-sizing: border-box;
display: flex;
align-items: center;
.redSticky {
color: #ff4444;
font-size: 24px;
padding: 2px;
box-sizing: border-box;
border: 1px solid #ff4444;
}
.greyTime {
color: #999;
font-size: 24px;
margin: 0;
}
.greyFont {
color: #999;
font-size: 24px;
margin-left: 20px;
}
}
}
.art_pic {
width: 180px;
height: 180px;
flex-shrink: 0;
background-color: #ff4444;
img {
width: 100%;
height: 100%;
}
}
}
}
.imgPic {
position: fixed;
right: 2vw;
bottom: 40vw;
width: 26vw;
height: 26vw;
img {
width: 100%;
height: 100%;
}
}
}
</style>