แสดงการแจ้งเตือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-22 10:31:29 +07:00
parent 4079eb1b84
commit a5e476e49a

View file

@ -51,6 +51,7 @@ async function fetchTotolNotificate() {
}); });
} }
const statusLoad = ref<boolean>(false);
const fetchlistNotification = async (index: number, type: string) => { const fetchlistNotification = async (index: number, type: string) => {
await http await http
.get(config.API.msgNotificate + `?page=${index}&pageSize=${15}`) .get(config.API.msgNotificate + `?page=${index}&pageSize=${15}`)
@ -75,8 +76,7 @@ const fetchlistNotification = async (index: number, type: string) => {
}); });
}); });
notiList.value.push(...list); notiList.value.push(...list);
statusLoad.value = totalInbox.value === 0 ? true : false;
totalInbox.value = res.data.result.total;
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
@ -238,7 +238,11 @@ const thaiOptions: Intl.DateTimeFormatOptions = {
งหมด {{ totalInbox }} อความ งหมด {{ totalInbox }} อความ
</div> </div>
</div> </div>
<q-infinite-scroll @load="onLoad" :offset="250"> <q-infinite-scroll
@load="onLoad"
:offset="250"
v-if="statusLoad === false"
>
<div <div
v-for="(item, index) in notiList" v-for="(item, index) in notiList"
:key="index" :key="index"
@ -309,6 +313,19 @@ const thaiOptions: Intl.DateTimeFormatOptions = {
</div> </div>
</template> </template>
</q-infinite-scroll> </q-infinite-scroll>
<div class="q-pa-md" v-else>
<q-banner rounded class="bg-amber-1 text-center">
<div class="text-yellow-10">
<q-icon
name="mdi-alert-box"
class="q-mx-xs"
size="sm"
color="yellow-10"
/>
ไมมอม
</div>
</q-banner>
</div>
</q-menu> </q-menu>
</q-btn> </q-btn>