This commit is contained in:
zhaofang
2022-11-16 12:04:53 +08:00
parent 2dc8745c6e
commit 3ee1d94037

View File

@@ -3,8 +3,8 @@
<u-toast ref="toast"></u-toast>
<view class="news-page-btn">
<view class="btn-index" @click="selectFn">多选</view>
<view class="btn-index" @click="isAllClear()">清空</view>
<view class="btn-index" @click="allRead()">一键已读</view>
<view class="btn-index" :class="{'wu-list':items.length == 0}" @click="isAllClear()">清空</view>
<view class="btn-index" :class="{'wu-list':items.length == 0}" @click="allRead()">一键已读</view>
</view>
<view class="news-page-list">
<view class="list-index" v-for="item in items" :key="item.id" @click="returnRouter(item)">
@@ -43,6 +43,7 @@
props:{
items:{
type:Array,
default:()=>[]
}
},
data() {
@@ -131,6 +132,9 @@
});
},
isAllClear() {
if(this.items.length == 0) {
return
}
this.isAll = 0;
this.modalShow = true;
this.content='确认删所有信息吗?'
@@ -144,6 +148,9 @@
})
},
allRead(){
if(this.items.length == 0) {
return
}
let ids = this.items.map(item=>{
if(!item.isRead) {
return item.id;
@@ -160,6 +167,9 @@
</script>
<style scoped lang="scss">
.wu-list{
background-color: #eee;
}
/deep/ .u-modal{
width: 288px !important;
border-radius: 28upx;