Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
ddh-equity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e7a7a27a
authored
May 21, 2021
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
e2e08798
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
30 deletions
src/store/commonStore.js
src/utils/util.js
src/views/common/index.vue
src/views/common/phoneLogin.vue
src/store/commonStore.js
View file @
e7a7a27
...
@@ -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
})
...
...
src/utils/util.js
View file @
e7a7a27
...
@@ -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
,
...
...
src/views/common/index.vue
View file @
e7a7a27
...
@@ -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
}))
}
}
})
}
}
}
}
}
}
...
...
src/views/common/phoneLogin.vue
View file @
e7a7a27
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment