|
|
@@ -145,35 +145,30 @@
|
|
|
this.$store.dispatch('user/deleteHistory', {id: id})
|
|
|
this.$store.dispatch('user/loadHistory')
|
|
|
},
|
|
|
+ goLogin: function () {
|
|
|
+ this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ this.$router.push('/auth/login')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
goHistory: function () {
|
|
|
if (!this.user.logged) {
|
|
|
- this.$http.get('/login/page').then(response => {
|
|
|
- if (response.data) {
|
|
|
- this.$router.push('/auth/login')
|
|
|
- }
|
|
|
- })
|
|
|
+ this.goLogin()
|
|
|
} else {
|
|
|
window.location.href = '/user#/browsingHistory'
|
|
|
}
|
|
|
},
|
|
|
goCart: function () {
|
|
|
if (!this.user.logged) {
|
|
|
- this.$http.get('/login/page').then(response => {
|
|
|
- if (response.data) {
|
|
|
- this.$router.push('/auth/login')
|
|
|
- }
|
|
|
- })
|
|
|
+ this.goLogin()
|
|
|
} else {
|
|
|
window.location.href = '/user#/cart'
|
|
|
}
|
|
|
},
|
|
|
goWebChat: function () {
|
|
|
if (!this.user.logged) {
|
|
|
- this.$http.get('/login/page').then(response => {
|
|
|
- if (response.data) {
|
|
|
- this.$router.push('/auth/login')
|
|
|
- }
|
|
|
- })
|
|
|
+ this.goLogin()
|
|
|
} else {
|
|
|
// 获得窗口的垂直位置
|
|
|
let iTop = (window.screen.availHeight - 30 - 600) / 2
|