|
|
@@ -140,6 +140,9 @@
|
|
|
},
|
|
|
isFocus () {
|
|
|
return this.$store.state.shop.storeInfo.focusList.data
|
|
|
+ },
|
|
|
+ user () {
|
|
|
+ return this.$store.state.option.user
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -172,20 +175,24 @@
|
|
|
this.$router.push('/mobile/brand/componentDetail/' + uuid)
|
|
|
},
|
|
|
collectStore: function () {
|
|
|
- if (this.isFocus === 'false') {
|
|
|
- this.$store.dispatch('shop/StoreFocus', {storeName: this.store.storeName, storeid: this.store.id})
|
|
|
- .then(response => {
|
|
|
- this.$store.dispatch('shop/StoreFocusList', {id: this.store.id})
|
|
|
- this.collectResult = '收藏成功'
|
|
|
- this.timeoutCount++
|
|
|
- })
|
|
|
- } else if (this.isFocus === 'true') {
|
|
|
- this.$http.post('/trade/storeFocus/delete/storeId', [this.store.id])
|
|
|
- .then(response => {
|
|
|
- this.$store.dispatch('shop/StoreFocusList', {id: this.store.id})
|
|
|
- this.collectResult = '取消成功'
|
|
|
- this.timeoutCount++
|
|
|
- })
|
|
|
+ if (this.user.logged) {
|
|
|
+ if (this.isFocus === 'false') {
|
|
|
+ this.$store.dispatch('shop/StoreFocus', {storeName: this.store.storeName, storeid: this.store.id})
|
|
|
+ .then(response => {
|
|
|
+ this.$store.dispatch('shop/StoreFocusList', {id: this.store.id})
|
|
|
+ this.collectResult = '收藏成功'
|
|
|
+ this.timeoutCount++
|
|
|
+ })
|
|
|
+ } else if (this.isFocus === 'true') {
|
|
|
+ this.$http.post('/trade/storeFocus/delete/storeId', [this.store.id])
|
|
|
+ .then(response => {
|
|
|
+ this.$store.dispatch('shop/StoreFocusList', {id: this.store.id})
|
|
|
+ this.collectResult = '取消成功'
|
|
|
+ this.timeoutCount++
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$router.push('/auth/login')
|
|
|
}
|
|
|
}
|
|
|
}
|