Files
dvcp_v2_wxcp_app/src/apps/AppNotification/components/read.vue

103 lines
2.4 KiB
Vue
Raw Normal View History

2021-11-22 10:26:08 +08:00
<template>
<div class="read">
<AiTopFixed>
<u-tabs :list="tabs" :is-scroll="false" height="96" bar-width="192" :current="current" @change="change"></u-tabs>
</AiTopFixed>
<div class="body">
<div class="item" v-for="(item,index) in (current==0 ? list.read : list.unRead)" :key="index">
2021-12-03 17:50:13 +08:00
<u-avatar :src="item.avatar" mode="square" size="76" style="margin-right: 8px;"></u-avatar>
2021-12-03 17:15:34 +08:00
<AiOpenData type="userName" :openid="item.id"></AiOpenData>
2021-11-22 10:26:08 +08:00
</div>
</div>
<AiBack/>
</div>
</template>
<script>
import AiBack from "../../../components/AiBack";
import AiTopFixed from "../../../components/AiTopFixed";
2021-12-08 19:24:59 +08:00
import AiOpenData from "../../../components/AiOpenData";
import {mapActions} from "vuex";
2021-11-22 10:26:08 +08:00
export default {
name: "read",
2021-12-08 19:24:59 +08:00
components: {AiBack, AiTopFixed, AiOpenData},
2021-11-22 10:59:46 +08:00
props:{
params:[String,Number]
},
2021-11-22 10:26:08 +08:00
data() {
return {
current: 0,
list: [],
}
},
2021-11-22 10:59:46 +08:00
created() {
2021-12-03 18:39:31 +08:00
document.title = "接收对象";
2021-12-08 19:24:59 +08:00
this.$loading()
this.injectJWeixin().then(() => {
this.getList();
})
2021-11-22 10:26:08 +08:00
},
methods: {
2021-12-08 19:24:59 +08:00
...mapActions(['previewFile', 'injectJWeixin']),
2021-11-22 10:26:08 +08:00
getList() {
this.$http.post("/app/appannouncementreader/list-unread",null,{
params:{
2021-11-22 10:59:46 +08:00
id:this.params
2021-11-22 10:26:08 +08:00
}
}).then(res => {
if (res && res.data) {
this.list = res.data;
2021-12-08 19:24:59 +08:00
this.$hideLoading()
2021-11-22 10:26:08 +08:00
}
})
},
change(val) {
this.current = val;
2021-12-06 11:19:53 +08:00
this.list = [];
2021-11-22 10:26:08 +08:00
this.getList();
}
},
computed: {
tabs() {
return [
2021-12-06 15:20:01 +08:00
{name: (this.list?.read?.length || 0) + "人已读"},
{name: (this.list?.unRead?.length || 0) + "人未读"},
2021-11-22 10:26:08 +08:00
];
}
},
}
</script>
<style lang="scss" scoped>
.read {
min-height: 100%;
background-color: #F5F5F5;
::v-deep .content{
padding: 0 !important;
}
.body {
padding: 16px 0;
.item {
height: 120px;
display: flex;
2021-12-06 11:25:35 +08:00
align-items: center;
2021-11-22 10:26:08 +08:00
box-sizing: border-box;
padding: 0 50px;
background-color: #ffffff;
border-bottom: 1px solid #eeeeee;
& > .name{
font-size: 36px;
font-weight: 600;
color: #333333;
line-height: 50px;
margin-left: 32px;
}
}
}
}
</style>