Commit e7a7a27a by liwk

commit

1 parent e2e08798
......@@ -27,6 +27,8 @@ export default {
window.location.href = `${window.location.href.split('?')[0]}#/${route}`
return
}
} else {
window.vm.$router.replace({ name: state.lastPath })
}
} else {
window.vm.$router.replace({ name: state.lastPath })
......
......@@ -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 = {
removeLocalStorage,
setLocalStorage,
......@@ -160,6 +188,7 @@ const utils = {
showLoading,
openWindows,
hideLoading,
equityLogin,
touchstart,
getChannel,
showToast,
......
......@@ -122,7 +122,7 @@ export default {
if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (!phone) {
this.model()
this.equityLogin()
return
}
}
......@@ -131,35 +131,7 @@ export default {
let url = `${href}/#/common/activate?sessionId=${sessionId}`
this.openWindows(url, 'common.activate')
} else {
this.model()
}
},
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 }))
}
}
})
this.equityLogin()
}
}
}
......
......@@ -126,6 +126,7 @@ export default {
if (res) {
let { code, data, message } = res
if (code == 0) {
sessionStorage.setItem('GL_EQUITY_USER_INFO', JSON.stringify(data))
this.$store.commit('setUserInfo', data)
} else {
this.showToast(message)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!