|
|
@@ -2,7 +2,7 @@
|
|
|
<div>
|
|
|
<div class="right-bar">
|
|
|
<ul class="right-bar-center">
|
|
|
- <li class="right-bar-item">
|
|
|
+ <li class="right-bar-item" @mouseenter="loadCarCount()">
|
|
|
<a href="/user#/cart" class="title" target="_blank">
|
|
|
<i class="iconfont icon-shopping-cart icon-xlg"></i>
|
|
|
</a>
|
|
|
@@ -37,7 +37,7 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
<ul class="right-bar-bottom">
|
|
|
- <li class="right-bar-item">
|
|
|
+ <li class="right-bar-item" @mouseenter="loadHistorys()">
|
|
|
<a href="http://www.usoftmall.com/user#/browsingHistory" class="title" target="_blank">
|
|
|
<i class="iconfont icon-zuji icon-xlg"></i>
|
|
|
</a>
|
|
|
@@ -90,7 +90,9 @@
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- this.$store.dispatch('getMessageBoardInformation', {page: 1, count: 3})
|
|
|
+ if (this.user.logged) {
|
|
|
+ this.$store.dispatch('getMessageBoardInformation', {page: 1, count: 3})
|
|
|
+ }
|
|
|
},
|
|
|
components: {
|
|
|
MessageBoard
|
|
|
@@ -114,12 +116,6 @@
|
|
|
return {}
|
|
|
}
|
|
|
},
|
|
|
- mounted () {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.loadHistorys()
|
|
|
- this.loadCarCount()
|
|
|
- })
|
|
|
- },
|
|
|
methods: {
|
|
|
listenPage: function (p) {
|
|
|
this.page = p
|
|
|
@@ -134,10 +130,18 @@
|
|
|
})
|
|
|
},
|
|
|
loadHistorys () {
|
|
|
- this.$store.dispatch('user/loadHistory')
|
|
|
+ if (this.user.logged) {
|
|
|
+ if (!this.history.length) {
|
|
|
+ this.$store.dispatch('user/loadHistory')
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
loadCarCount () {
|
|
|
- this.$store.dispatch('user/CarCount')
|
|
|
+ if (this.user.logged) {
|
|
|
+ if (!this.cartCount.count) {
|
|
|
+ this.$store.dispatch('user/CarCount')
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
toTop () {
|
|
|
scrollTo('body', 300)
|
|
|
@@ -150,7 +154,7 @@
|
|
|
},
|
|
|
deleteHistory (item, id) {
|
|
|
this.$store.dispatch('user/deleteHistory', {id: id})
|
|
|
- this.loadHistorys()
|
|
|
+ this.$store.dispatch('user/loadHistory')
|
|
|
},
|
|
|
goWebChat: function () {
|
|
|
if (!this.$store.state.option.user.logged) {
|