diff --git a/src/api/index.js b/src/api/index.js index a7c22ea..d138085 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -43,6 +43,7 @@ export default { ORDER_DATE_PROFIT: "/order/date-profit", // notification - NOTIFICATION_LIST: "/notification/history" - + NOTIFICATION_LIST: "/notification/history", + NOTIFICATION_UNREAD: "/notification/un-read", + NOTIFICATION_READ: "/notification/read", }; diff --git a/src/components/mine/Mine.vue b/src/components/mine/Mine.vue index 4101fa1..7c0fe55 100644 --- a/src/components/mine/Mine.vue +++ b/src/components/mine/Mine.vue @@ -19,6 +19,7 @@ const { userInfo, isLogin } = storeToRefs(userStore); const loadingMoney = ref(false); const loadingScore = ref(false); const showVipTable = ref(false); +const countNotify = ref(0); const withdrawLink = computed(() => { return userInfo?.value?.isSetBank ? "/withdraw" : "/Setbank"; @@ -53,6 +54,18 @@ const loadScore = () => { }, 500); }); }; + +const getUnreadNotifications = () => { + handleRequest(axios.get(API.NOTIFICATION_UNREAD)) + .then((res) => { + if(res.success) { + countNotify.value = res.data; + } + }) +}; + +getUnreadNotifications(); +