init
This commit is contained in:
159
src/layout/components/Message/index.vue
Normal file
159
src/layout/components/Message/index.vue
Normal file
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-popover placement="bottom" width="200" trigger="click">
|
||||
<!-- icon 展示 -->
|
||||
<el-badge slot="reference" :is-dot="unreadCount > 0" type="danger">
|
||||
<svg-icon icon-class="message" @click="getList"/>
|
||||
</el-badge>
|
||||
<!-- 弹出列表 -->
|
||||
<el-row class="message-fid" v-show="unreadInfo.accountCashCount > 0">
|
||||
<el-col :span="14">
|
||||
<el-link @click="goToAudit('accountCash')" type="warning">提现待审核</el-link>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
</el-col>
|
||||
<el-col :span="6"><span style="color: red">{{ unreadInfo.accountCashCount }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="message-fid" v-show="unreadInfo.userAlbumCount > 0">
|
||||
<el-col :span="14">
|
||||
<el-link @click="goToAudit('userAlbum')" type="warning">相册待审核</el-link>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
</el-col>
|
||||
<el-col :span="6"><span style="color: red">{{ unreadInfo.userAlbumCount }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="message-fid" v-show="unreadInfo.userCameraAuditCount > 0">
|
||||
<el-col :span="14">
|
||||
<el-link @click="goToAudit('userCameraAudit')" type="warning">自拍待审核</el-link>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
</el-col>
|
||||
<el-col :span="6"><span style="color: red">{{ unreadInfo.userCameraAuditCount }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="message-fid" v-show="unreadInfo.anchorApplyCount > 0">
|
||||
<el-col :span="14">
|
||||
<el-link @click="goToAudit('anchorApply')" type="warning">主播申请待审核</el-link>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
</el-col>
|
||||
<el-col :span="6"><span style="color: red">{{ unreadInfo.anchorApplyCount }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="message-fid" v-show="unreadInfo.dynamicCount > 0">
|
||||
<el-col :span="14">
|
||||
<el-link @click="goToAudit('dynamic')" type="warning">动态待审核</el-link>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
</el-col>
|
||||
<el-col :span="6"><span style="color: red">{{ unreadInfo.dynamicCount }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="message-fid" v-show="unreadInfo.reportCount > 0">
|
||||
<el-col :span="14">
|
||||
<el-link @click="goToAudit('report')" type="warning">举报待处理</el-link>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
</el-col>
|
||||
<el-col :span="6"><span style="color: red">{{ unreadInfo.reportCount }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="message-fid" v-show="unreadInfo.userGreetCount > 0">
|
||||
<el-col :span="14">
|
||||
<el-link @click="goToAudit('userGreet')" type="warning">群发待审核</el-link>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
</el-col>
|
||||
<el-col :span="6"><span style="color: red">{{ unreadInfo.userGreetCount }}</span></el-col>
|
||||
</el-row>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getUnreadNotifyMessageCount, getUnreadNotifyMessageList} from "@/api/cai/unreadNotifyMessage";
|
||||
|
||||
export default {
|
||||
name: 'NotifyMessage',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 列表
|
||||
unreadInfo: {
|
||||
accountCashCount: 0,
|
||||
userAlbumCount: 0,
|
||||
userCameraAuditCount: 0,
|
||||
anchorApplyCount: 0,
|
||||
dynamicCount: 0,
|
||||
reportCount: 0,
|
||||
userGreetCount: 0,
|
||||
},
|
||||
// 未读数量,
|
||||
unreadCount: 1,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 首次加载小红点
|
||||
this.getUnreadCount()
|
||||
// 轮询刷新小红点
|
||||
setInterval(() => {
|
||||
this.getUnreadCount()
|
||||
}, 1000 * 60 * 5)
|
||||
},
|
||||
methods: {
|
||||
getList: function () {
|
||||
this.loading = true;
|
||||
getUnreadNotifyMessageList().then(response => {
|
||||
this.unreadInfo = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getUnreadCount: function () {
|
||||
getUnreadNotifyMessageCount().then(response => {
|
||||
this.unreadCount = response.data;
|
||||
})
|
||||
},
|
||||
goToAudit: function (type) {
|
||||
switch (type) {
|
||||
case "accountCash":
|
||||
this.$router.push({path: "/audit/accountCash", query: {auditStatus: true}});
|
||||
break;
|
||||
case "userAlbum":
|
||||
this.$router.push({path: "/kk/userAlbum", query: {auditStatus: true}});
|
||||
break;
|
||||
case "userCameraAudit":
|
||||
this.$router.push({path: "/audit/userCameraAudit", query: {auditStatus: true}});
|
||||
break;
|
||||
case "anchorApply":
|
||||
this.$router.push({path: "/kk/anchorApply", query: {auditStatus: true}});
|
||||
break;
|
||||
case "dynamic":
|
||||
this.$router.push({path: "/audit/dynamic", query: {auditStatus: true}});
|
||||
break;
|
||||
case "report":
|
||||
this.$router.push({path: "/audit/report", query: {auditStatus: true}});
|
||||
break;
|
||||
case "userGreet":
|
||||
this.$router.push({path: "/audit/userGreet", query: {auditStatus: true}});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.el-badge__content.is-fixed {
|
||||
top: 10px; /* 保证徽章的位置 */
|
||||
}
|
||||
|
||||
.message-fid {
|
||||
margin: 10px 0 10px 0;
|
||||
}
|
||||
</style>
|
||||
@@ -9,6 +9,10 @@
|
||||
<template v-if="device!=='mobile'">
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
|
||||
<el-tooltip content="待审核" effect="dark" placement="bottom">
|
||||
<notify-message class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
|
||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||
@@ -48,6 +52,7 @@ import SizeSelect from '@/components/SizeSelect'
|
||||
import Search from '@/components/HeaderSearch'
|
||||
import RuoYiGit from '@/components/RuoYi/Git'
|
||||
import RuoYiDoc from '@/components/RuoYi/Doc'
|
||||
import NotifyMessage from '@/layout/components/Message'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -58,7 +63,8 @@ export default {
|
||||
SizeSelect,
|
||||
Search,
|
||||
RuoYiGit,
|
||||
RuoYiDoc
|
||||
RuoYiDoc,
|
||||
NotifyMessage
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
|
||||
Reference in New Issue
Block a user