parent
5256936d8a
commit
aa170572c8
6 changed files with 223 additions and 582 deletions
@ -1,180 +1,178 @@ |
|||||||
<template> |
<template> |
||||||
<view class="notice-list"> |
<view class="notice-list"> |
||||||
|
|
||||||
<scroll-view scroll-y="true" style="height:calc(100vh - 140rpx);width: 100%;background: #F5F5F5;margin-top:32rpx" |
<scroll-view scroll-y="true" |
||||||
:refresher-triggered="triggered" :refresher-enabled="true" @refresherrefresh="refresherrefresh" |
style="height:calc(100vh - 140rpx);width: 100%;background: #F5F5F5;margin-top:32rpx" |
||||||
refresher-background="#f1f1f1" @scrolltolower="onListBottom"> |
:refresher-triggered="triggered" :refresher-enabled="true" @refresherrefresh="refresherrefresh" |
||||||
<ul class="card"> |
refresher-background="#f1f1f1" @scrolltolower="onListBottom"> |
||||||
<li v-for="(item, index) in dataList" :key="index" @click="jump(item)"> |
<ul class="card"> |
||||||
<view class="title"> |
<li v-for="(item, index) in dataList" :key="index" @click="jump(item)"> |
||||||
<view class="text"> |
<view class="title"> |
||||||
<view>{{ item.title }}</view> |
<view class="text"> |
||||||
<view class="mark" v-if="!item.readStatus"></view> |
<view>{{ item.title }}</view> |
||||||
</view> |
<!-- <view class="mark" v-if="!item.readStatus"></view> --> |
||||||
<view style="flex-shrink: 0;color: #999999;">{{ item.createdAt }}</view> |
</view> |
||||||
|
<view style="flex-shrink: 0;color: #999999;">{{ item.categoryName }}</view> |
||||||
|
</view> |
||||||
|
<view> |
||||||
|
<u-parse :html="item.content"></u-parse> |
||||||
|
</view> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
<view style=" line-height: 100rpx;"> |
||||||
|
<uni-load-more :status="scrollType"></uni-load-more> |
||||||
</view> |
</view> |
||||||
<view> |
</scroll-view> |
||||||
<!-- {{ item.content }} --> |
|
||||||
<u-parse :html="item.content"></u-parse> |
|
||||||
</view> |
|
||||||
</li> |
|
||||||
</ul> |
|
||||||
<view style=" line-height: 100rpx;"> |
|
||||||
<uni-load-more :status="scrollType"></uni-load-more> |
|
||||||
</view> |
|
||||||
</scroll-view> |
|
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
<script> |
<script> |
||||||
// import requestName from '@/common/requestName' |
// import requestName from '@/common/requestName' |
||||||
export default { |
export default { |
||||||
name: 'NoticeList', |
name: 'NoticeList', |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
dataList: [ |
dataList: [ |
||||||
{ |
], |
||||||
title:'11111',//标题 |
current: 0, |
||||||
createdAt:'转发通知', |
style: { |
||||||
content:'222<p>44444444444</p>', |
borderRadius: '100px', |
||||||
readStatus:true |
background: '#fff', |
||||||
} |
padding: '0 32rpx' |
||||||
], |
}, |
||||||
current: 0, |
search: { |
||||||
style: { |
pageNo: 1, |
||||||
borderRadius: '100px', |
pageSize: 20, |
||||||
background: '#fff', |
readStatus: '' |
||||||
padding: '0 32rpx' |
}, |
||||||
}, |
scrollType: '', |
||||||
search: { |
triggered: false, |
||||||
pageNo: 1, |
refreshNeed: false |
||||||
pageSize: 20, |
} |
||||||
readStatus: '' |
|
||||||
}, |
|
||||||
scrollType: '', |
|
||||||
triggered: false, |
|
||||||
refreshNeed: false |
|
||||||
} |
|
||||||
}, |
}, |
||||||
onLoad(data) { |
onLoad(data) { |
||||||
this.getList() |
this.getList() |
||||||
}, |
}, |
||||||
onShow() { |
onShow() { |
||||||
console.log(this.refreshNeed); |
console.log(this.refreshNeed); |
||||||
if (this.refreshNeed) { |
if (this.refreshNeed) { |
||||||
this.reSearch() |
this.reSearch() |
||||||
} |
} |
||||||
}, |
}, |
||||||
|
|
||||||
methods: { |
methods: { |
||||||
|
|
||||||
getList() { |
getList() { |
||||||
// this.$wx_http.get(requestName['pageNotice'], this.search).then(res => { |
this.$u.api.getNoticeList(this.search).then(res => { |
||||||
// let data = res.data.records |
if (res.code == 200) { |
||||||
// this.scrollType = '' |
let data = res.data.records |
||||||
// this.triggered = false |
this.scrollType = '' |
||||||
// if (data.length >= this.search.pageSize) { |
this.triggered = false |
||||||
// this.scrollType = 'more' |
if (data.length >= this.search.pageSize) { |
||||||
// } |
this.scrollType = 'more' |
||||||
// this.dataList = this.dataList.concat(data) |
} |
||||||
// }) |
this.dataList = this.dataList.concat(data) |
||||||
}, |
} |
||||||
|
}) |
||||||
reSearch() { |
}, |
||||||
this.search.pageNo = 1 |
|
||||||
this.dataList = [] |
|
||||||
this.getList() |
|
||||||
}, |
|
||||||
|
|
||||||
onListBottom() { |
reSearch() { |
||||||
if (this.scrollType == 'more') { |
this.search.pageNo = 1 |
||||||
this.search.pageNo += 1 |
this.dataList = [] |
||||||
this.getList() |
this.getList() |
||||||
|
}, |
||||||
|
|
||||||
|
onListBottom() { |
||||||
|
if (this.scrollType == 'more') { |
||||||
|
this.search.pageNo += 1 |
||||||
|
this.getList() |
||||||
|
} |
||||||
|
}, |
||||||
|
onreachBottom() { |
||||||
|
this.getDevicePage() |
||||||
|
}, |
||||||
|
refresherrefresh() { |
||||||
|
this.triggered = true |
||||||
|
this.reSearch() |
||||||
} |
} |
||||||
}, |
|
||||||
onreachBottom() { |
|
||||||
this.getDevicePage() |
|
||||||
}, |
|
||||||
refresherrefresh() { |
|
||||||
this.triggered = true |
|
||||||
this.reSearch() |
|
||||||
} |
|
||||||
}, |
}, |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||||
.notice-list { |
.notice-list { |
||||||
height: calc(100vh - 0px); |
height: calc(100vh - 0px); |
||||||
background: #F5F5F5; |
background: #F5F5F5; |
||||||
overflow: hidden; |
overflow: hidden; |
||||||
|
|
||||||
.mark-read-btn { |
.mark-read-btn { |
||||||
background: #FFFFFF; |
background: #FFFFFF; |
||||||
border-radius: 8rpx; |
border-radius: 8rpx; |
||||||
border: 1px solid rgba(255, 255, 255, 0.43); |
border: 1px solid rgba(255, 255, 255, 0.43); |
||||||
padding: 0; |
padding: 0; |
||||||
margin: 24rpx 30rpx; |
margin: 24rpx 30rpx; |
||||||
text-align: center; |
text-align: center; |
||||||
height: 88rpx; |
height: 88rpx; |
||||||
line-height: 88rpx; |
line-height: 88rpx; |
||||||
font-size: 30rpx; |
font-size: 30rpx; |
||||||
color: #FF8800; |
color: #FF8800; |
||||||
display: flex; |
display: flex; |
||||||
justify-content: center; |
justify-content: center; |
||||||
align-items: center; |
align-items: center; |
||||||
|
|
||||||
image { |
image { |
||||||
width: 34rpx; |
width: 34rpx; |
||||||
height: 32rpx; |
height: 32rpx; |
||||||
display: block; |
display: block; |
||||||
margin-right: 20rpx; |
margin-right: 20rpx; |
||||||
fill:#004BAA |
fill: #004BAA |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
.card { |
.card { |
||||||
margin: 0 16px; |
margin: 0 16px; |
||||||
list-style: none; |
list-style: none; |
||||||
padding: 0; |
padding: 0; |
||||||
|
|
||||||
|
li { |
||||||
|
background: #FFFFFF; |
||||||
|
border-radius: 4px; |
||||||
|
border: 1px solid rgba(255, 255, 255, 0.43); |
||||||
|
padding: 12px 14px; |
||||||
|
margin-bottom: 24rpx; |
||||||
|
font-size: 28rpx; |
||||||
|
|
||||||
|
.title { |
||||||
|
border-bottom: 1px solid #F0F0F0; |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
padding-bottom: 10rpx; |
||||||
|
margin-bottom: 15rpx; |
||||||
|
|
||||||
|
|
||||||
|
.text { |
||||||
|
font-size: 30rpx; |
||||||
|
flex-grow: 1; |
||||||
|
display: flex; |
||||||
|
margin-right: 20rpx; |
||||||
|
font-weight: 400; |
||||||
|
color: #333333; |
||||||
|
} |
||||||
|
|
||||||
|
.mark { |
||||||
|
width: 16rpx; |
||||||
|
height: 16rpx; |
||||||
|
background: #D9362D; |
||||||
|
border-radius: 50%; |
||||||
|
margin-left: 12rpx; |
||||||
|
margin-top: 5rpx; |
||||||
|
flex-shrink: 0; |
||||||
|
} |
||||||
|
|
||||||
li { |
} |
||||||
background: #FFFFFF; |
|
||||||
border-radius: 4px; |
|
||||||
border: 1px solid rgba(255, 255, 255, 0.43); |
|
||||||
padding: 12px 14px; |
|
||||||
margin-bottom: 24rpx; |
|
||||||
font-size: 28rpx; |
|
||||||
|
|
||||||
.title { |
|
||||||
border-bottom: 1px solid #F0F0F0; |
|
||||||
display: flex; |
|
||||||
justify-content: space-between; |
|
||||||
padding-bottom: 10rpx; |
|
||||||
margin-bottom: 15rpx; |
|
||||||
|
|
||||||
|
|
||||||
.text { |
|
||||||
font-size: 30rpx; |
|
||||||
flex-grow: 1; |
|
||||||
display: flex; |
|
||||||
margin-right: 20rpx; |
|
||||||
font-weight: 400; |
|
||||||
color: #333333; |
|
||||||
} |
|
||||||
|
|
||||||
.mark { |
|
||||||
width: 16rpx; |
|
||||||
height: 16rpx; |
|
||||||
background: #D9362D; |
|
||||||
border-radius: 50%; |
|
||||||
margin-left: 12rpx; |
|
||||||
margin-top: 5rpx; |
|
||||||
flex-shrink: 0; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
Loading…
Reference in new issue