update
This commit is contained in:
@@ -45,7 +45,6 @@ const selectActionsheet = async (e) => {
|
|||||||
type: e.type,
|
type: e.type,
|
||||||
});
|
});
|
||||||
showToast(msg);
|
showToast(msg);
|
||||||
emits('success');
|
|
||||||
} else {
|
} else {
|
||||||
if (type === 0) {
|
if (type === 0) {
|
||||||
const {msg} = await Api.system.setChildrenRead({
|
const {msg} = await Api.system.setChildrenRead({
|
||||||
@@ -53,18 +52,19 @@ const selectActionsheet = async (e) => {
|
|||||||
type: e.type,
|
type: e.type,
|
||||||
});
|
});
|
||||||
showToast(msg);
|
showToast(msg);
|
||||||
emits('success');
|
|
||||||
} else {
|
} else {
|
||||||
const index = SystemStore.message.findIndex(v => v.id === data.id);
|
const index = SystemStore.message.findIndex(v => v.id === data.id);
|
||||||
SystemStore.message[index].is_read = !SystemStore.message[index].is_read;
|
SystemStore.message[index].is_read = !SystemStore.message[index].is_read;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
emits('success');
|
||||||
}
|
}
|
||||||
|
|
||||||
const openOpenTypeFun = () => {
|
const openOpenTypeFun = () => {
|
||||||
const index = SystemStore.message.findIndex(v => v.id === data.id);
|
const index = SystemStore.message.findIndex(v => v.id === data.id);
|
||||||
SystemStore.message[index].is_read = true;
|
SystemStore.message[index].is_read = true;
|
||||||
OpenTypeFun(data);
|
OpenTypeFun(data);
|
||||||
|
emits('success');
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import MessageCard from "../../components/MessageCard.vue";
|
|||||||
import useTableQuery from "../../hooks/useTableQuery.js";
|
import useTableQuery from "../../hooks/useTableQuery.js";
|
||||||
import Api from "../../api/index.js";
|
import Api from "../../api/index.js";
|
||||||
import {useSystemStore} from "../../pinia/SystemStore/index.js";
|
import {useSystemStore} from "../../pinia/SystemStore/index.js";
|
||||||
|
import {onShow} from "@dcloudio/uni-app";
|
||||||
|
|
||||||
const SystemStore = useSystemStore();
|
const SystemStore = useSystemStore();
|
||||||
const tabs = computed(() => [
|
const tabs = computed(() => [
|
||||||
@@ -37,6 +38,7 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
|||||||
parameter: po,
|
parameter: po,
|
||||||
callback: (data) => {
|
callback: (data) => {
|
||||||
Object.assign(vo, data);
|
Object.assign(vo, data);
|
||||||
|
SystemStore.getMessageCount();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -44,6 +46,10 @@ const changeTab = ({index}) => {
|
|||||||
po.type = index;
|
po.type = index;
|
||||||
initFetchData();
|
initFetchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
SystemStore.getMessageCount();
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const {data, home} = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const list = computed(() => [data.comment_arr]?.flatMap(v => v.children ? [v, ...v.children] : [v]));
|
const list = computed(() => data.comment_arr?.flatMap(v => v.children ? [v, ...v.children] : [v]));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -23,11 +23,13 @@ export const useSystemStore = defineStore('SystemStore', () => {
|
|||||||
messageCount.value.one = count;
|
messageCount.value.one = count;
|
||||||
messageCount.value.two = message.value.filter(v => !v.is_read).length;
|
messageCount.value.two = message.value.filter(v => !v.is_read).length;
|
||||||
|
|
||||||
|
document.querySelectorAll('.uni-tabbar__item__dot').forEach(v => v.remove());
|
||||||
// 生成角标
|
// 生成角标
|
||||||
if (messageCount.value.one + messageCount.value.two > 0) {
|
if (messageCount.value.one + messageCount.value.two > 0) {
|
||||||
const tabbar = document.querySelectorAll('.uni-tabbar__item')[2].querySelector('.uni-tabbar__bd');
|
const tabbar = document.querySelectorAll('.uni-tabbar__item')[2].querySelector('.uni-tabbar__bd');
|
||||||
tabbar.style.position = 'relative';
|
tabbar.style.position = 'relative';
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
|
div.className = 'uni-tabbar__item__dot';
|
||||||
div.style.position = 'absolute';
|
div.style.position = 'absolute';
|
||||||
div.style.backgroundColor = 'red';
|
div.style.backgroundColor = 'red';
|
||||||
div.style.color = 'white';
|
div.style.color = 'white';
|
||||||
|
|||||||
Reference in New Issue
Block a user