Commit e7a7a27a by liwk

commit

1 parent e2e08798
...@@ -27,6 +27,8 @@ export default { ...@@ -27,6 +27,8 @@ export default {
window.location.href = `${window.location.href.split('?')[0]}#/${route}` window.location.href = `${window.location.href.split('?')[0]}#/${route}`
return return
} }
} else {
window.vm.$router.replace({ name: state.lastPath })
} }
} else { } else {
window.vm.$router.replace({ name: state.lastPath }) window.vm.$router.replace({ name: state.lastPath })
......
...@@ -151,6 +151,34 @@ const makePhoneCall = phoneNumber => { ...@@ -151,6 +151,34 @@ const makePhoneCall = phoneNumber => {
} }
} }
} }
const equityLogin = () => {
const ua = navigator.userAgent.toLowerCase()
let url = window.location.href
if (this.isMiniprogram) {
url = `${url}?isTab=true&tabIndex=2`
wx.miniProgram.navigateTo({
url: `/pages/auth/auth?url=${encodeURIComponent(url)}`
})
} else {
dialog({
title: '提示',
message: '领取权益卡,请先登录',
confirmButtonText: '前往登录',
cancelButtonText: '残忍拒绝',
}).then(() => {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.replace({ name: 'common.phoneLogin' })
} else {
if (this.checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 0 }))
} else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 0 }))
}
}
})
}
}
const utils = { const utils = {
removeLocalStorage, removeLocalStorage,
setLocalStorage, setLocalStorage,
...@@ -160,6 +188,7 @@ const utils = { ...@@ -160,6 +188,7 @@ const utils = {
showLoading, showLoading,
openWindows, openWindows,
hideLoading, hideLoading,
equityLogin,
touchstart, touchstart,
getChannel, getChannel,
showToast, showToast,
......
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
if (!this.isMiniprogram) { if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (!phone) { if (!phone) {
this.model() this.equityLogin()
return return
} }
} }
...@@ -131,35 +131,7 @@ export default { ...@@ -131,35 +131,7 @@ export default {
let url = `${href}/#/common/activate?sessionId=${sessionId}` let url = `${href}/#/common/activate?sessionId=${sessionId}`
this.openWindows(url, 'common.activate') this.openWindows(url, 'common.activate')
} else { } else {
this.model() this.equityLogin()
}
},
model () {
const ua = navigator.userAgent.toLowerCase()
let url = window.location.href
if (this.isMiniprogram) {
url = `${url}?isTab=true&tabIndex=2`
wx.miniProgram.navigateTo({
url: `/pages/auth/auth?url=${encodeURIComponent(url)}`
})
} else {
this.dialog({
title: '提示',
message: '领取权益卡,请先登录',
confirmButtonText: '前往登录',
cancelButtonText: '残忍拒绝',
}).then(() => {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.replace({ name: 'common.phoneLogin' })
} else {
if (this.checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 0 }))
} else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 0 }))
}
}
})
} }
} }
} }
......
...@@ -126,6 +126,7 @@ export default { ...@@ -126,6 +126,7 @@ export default {
if (res) { if (res) {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
sessionStorage.setItem('GL_EQUITY_USER_INFO', JSON.stringify(data))
this.$store.commit('setUserInfo', data) this.$store.commit('setUserInfo', data)
} else { } else {
this.showToast(message) this.showToast(message)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!