更新消息已读未读

This commit is contained in:
2023-10-25 15:59:36 +08:00
parent f23fd6b01c
commit 3a2a4c2814
7 changed files with 76 additions and 15 deletions

View File

@@ -30,12 +30,13 @@
</div>
<div class="content">
<div class="list">
<div class="item" v-for="item in storeUser.notices.list" :key="item.id">
<div class="item" :class="{ active: item.typefirst == 1 && item.typesecond }"
v-for="item in storeUser.notices.list" :key="item.id" @click="toDetail(item)">
<!-- <div class="title">
<el-text size="large">{{ item.title }}</el-text>
</div> -->
<div class="conetnt">
<el-text :type="item == 0 ? 'info' : ''">
<el-text :type="item.isdeal == 1 ? 'info' : ''">
{{ `[${title1[item.typefirst]}-${title2[item.typesecond]}] ${item.conrtent}` }}
</el-text>
</div>
@@ -75,6 +76,12 @@ import { dayjs } from "element-plus";
import { useConfigure } from "@/store/configure.js";
import { useUser } from "@/store/user.js";
import { useRoutes } from "@/store/routes.js";
import { useRouter } from "vue-router"
import { unread } from '@/api/home.js'
const router = useRouter()
const storeUser = useUser();
const storeRoutes = useRoutes();
@@ -102,6 +109,23 @@ function operationFunction(type) {
emits("operation", type);
}
// 跳转详细详情
function toDetail(item) {
if (item.typefirst == 1 && item.typesecond == 1) {
router.push({
name: 'shop_detail',
query: {
id: item.userid,
type: 'msg1'
}
})
if (!item.isdeal) {
unread({ noticecode: item.noticecode })
storeUser.getNotices()
}
}
}
// 退出登录
function logOut() {
// 清除缓存 / token 等
@@ -224,11 +248,17 @@ function logOut() {
max-height: 400px;
overflow-y: auto;
.item {
.list {
padding: 14px 0;
}
&:not(:last-child) {
border-bottom: 1px solid #ececec;
.item {
padding: 14px;
border-radius: 8px;
&:hover {
cursor: pointer;
background-color: #efefef;
}
}
}