แสดงการแจ้งเตือน
This commit is contained in:
parent
eac3a52a81
commit
6264cf42da
1 changed files with 22 additions and 13 deletions
|
|
@ -87,9 +87,8 @@ async function fetchmsgNoread() {
|
|||
});
|
||||
}
|
||||
|
||||
const isLoad = ref<boolean>(false);
|
||||
const statusLoad = ref<boolean>(false);
|
||||
const getDataNotification = async (index: number, type: string) => {
|
||||
isLoad.value = false;
|
||||
const thaiOptions: Intl.DateTimeFormatOptions = {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
|
|
@ -119,15 +118,12 @@ const getDataNotification = async (index: number, type: string) => {
|
|||
});
|
||||
});
|
||||
notiList.value.push(...list);
|
||||
totalInbox.value = res.data.result.total;
|
||||
statusLoad.value = totalInbox.value === 0 ? true : false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
isLoad.value = true;
|
||||
// hideLoader();
|
||||
});
|
||||
.finally(() => {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -536,11 +532,7 @@ watch(
|
|||
v-if="totalNoti !== 0"
|
||||
>{{ totalNoti }}</q-badge
|
||||
>
|
||||
<q-menu
|
||||
v-model="notiTrigger"
|
||||
:offset="[0, 8]"
|
||||
style="height: 400px; width: 480px"
|
||||
>
|
||||
<q-menu v-model="notiTrigger" :offset="[0, 8]" style="width: 480px">
|
||||
<div class="q-px-md q-py-sm row col-12 items-center">
|
||||
<div class="text-subtitle1 text-weight-medium">การแจ้งเตือน</div>
|
||||
<q-space />
|
||||
|
|
@ -549,7 +541,11 @@ watch(
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<q-infinite-scroll @load="onLoad" :offset="250">
|
||||
<q-infinite-scroll
|
||||
@load="onLoad"
|
||||
:offset="250"
|
||||
v-if="statusLoad === false"
|
||||
>
|
||||
<div
|
||||
v-for="(n, index) in notiList"
|
||||
:key="index"
|
||||
|
|
@ -604,6 +600,19 @@ watch(
|
|||
</div>
|
||||
</template>
|
||||
</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-btn>
|
||||
<div class="row items-center no-wrap">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue