|
|
@@ -54,6 +54,7 @@
|
|
|
<a class="item" href="/user#/index">买家中心</a>
|
|
|
<a class="item" @click="toVendor">卖家中心</a>
|
|
|
<a class="item" href="/sso#/index">帐户中心</a>
|
|
|
+ <a class="item" href="/user#/messagePersonal">消息 ({{count}})</a>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<a class="item" @click="onLoginClick()">登录</a>
|
|
|
@@ -77,7 +78,9 @@
|
|
|
// keyword: '',
|
|
|
// isSearching: false
|
|
|
// ShowApplyAdv: true,
|
|
|
- showEnterpriseToggle: false
|
|
|
+ showEnterpriseToggle: false,
|
|
|
+ messageUrl: process.env.messageUrl,
|
|
|
+ count: 0
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -98,6 +101,30 @@
|
|
|
return this.$store.state.option.url
|
|
|
}
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ if(this.user.logged && this.user.data) {
|
|
|
+ let userUU = this.user.data.userUU
|
|
|
+ let enUU = this.user.data.enterprise ? this.user.data.enterprise.uu : null
|
|
|
+ if(userUU && enUU) {
|
|
|
+ let param = {
|
|
|
+ 'receiverUu': userUU,
|
|
|
+ 'receiverEnuu': enUU,
|
|
|
+ 'consumerApp': 'MALL',
|
|
|
+ 'isRead': 0
|
|
|
+ }
|
|
|
+ this.$http.get(`/messages/count`, {params: param})
|
|
|
+ .then((res) => {
|
|
|
+ if(res.data) {
|
|
|
+ this.count = res.data.count ? (res.data.count < 100 ? res.data.count : '99+') : 0
|
|
|
+ } else {
|
|
|
+ this.count = 0
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
logout () {
|
|
|
this.$http.get('/logout/crossBefore').then(response => {
|