1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
| <template>
| <div :class="wrpCls">
| <a-badge :count="newOrder" style="margin-right: 6px;">
| <a-icon type="bell" style="font-size: 18px;cursor: pointer;" />
| </a-badge>
| <avatar-dropdown :menu="showMenu" :current-user="currentUser" :class="prefixCls" />
| <!-- <select-lang :class="prefixCls" /> -->
| </div>
| </template>
|
| <script>
| import AvatarDropdown from './AvatarDropdown'
| import SelectLang from '@/components/SelectLang'
| import { adminlist } from '@/api/managesettings'
| import { withdrawlist } from '@/api/capital'
|
| export default {
| name: 'RightContent',
| components: {
| AvatarDropdown,
| SelectLang
| },
| props: {
| prefixCls: {
| type: String,
| default: 'ant-pro-global-header-index-action'
| },
| isMobile: {
| type: Boolean,
| default: () => false
| },
| topMenu: {
| type: Boolean,
| required: true
| },
| theme: {
| type: String,
| required: true
| }
| },
| data() {
| return {
| showMenu: true,
| currentUser: {},
| outMoneyOrder: 0,
| newOrder: 0
| }
| },
| computed: {
| wrpCls() {
| return {
| 'ant-pro-global-header-index-right': true,
| [`ant-pro-global-header-index-${(this.isMobile || !this.topMenu) ? 'light' : this.theme}`]: true
| }
| }
| },
| mounted() {
| this.getnowuser()
| this.getWithdrawlist()
| },
| methods: {
| getnowuser() {
| adminlist().then(res => {
| var index = res.data.list.findIndex(item => item.adminPhone == window.localStorage.getItem('phones'))
| setTimeout(() => {
| this.currentUser = {
| name: res.data.list[index].adminName
| }
| }, 1500)
| })
| },
| getWithdrawlist() {
| let params = {
| state: 0,
| pageNum: 1,
| pageSize: 1
| }
| withdrawlist(params).then(res => {
| if (res.status === 0) {
| // 出金待审核金额
| if (res.data.total !== 0 && res.data.total > this.outMoneyOrder) {
| // 有了新的记录
| this.newOrder = res.data.total - this.outMoneyOrder
| this.$message({
| showClose: true,
| message: '您有新的订单记录待处理!',
| type: 'warning'
| })
| }
| this.outMoneyOrder = res.data.total
| } else {
| this.$message.error(res.msg)
| }
| })
| }
| }
| }
| </script>
|
|