Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
group-buy-ui
Commits
32640d29
Commit
32640d29
authored
Sep 16, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 处理原生浏览器和微信浏览器差异
parent
cc662a3e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
bottomNav.vue
src/views/goodsDetail/components/bottomNav.vue
+22
-7
No files found.
src/views/goodsDetail/components/bottomNav.vue
View file @
32640d29
...
@@ -68,9 +68,25 @@ export default {
...
@@ -68,9 +68,25 @@ export default {
};
};
},
},
methods
:
{
methods
:
{
getToken
()
{
const
that
=
this
;
window
.
xyqbNativeEvent
=
function
(
res
)
{
const
json
=
typeof
res
===
'
string
'
?
JSON
.
parse
(
res
)
:
res
;
if
(
json
.
event
===
'
getTokenSuccess
'
)
{
const
appData
=
json
.
data
||
{};
if
(
appData
&&
appData
.
token
)
{
localStorage
.
get
(
'
vccToken
'
,
appData
.
token
);
that
.
$nextTick
(()
=>
{
window
.
location
.
reload
();
});
}
}
};
this
.
nativeBridge
.
getToken
();
},
checkLogin
()
{
checkLogin
()
{
const
vccToken
=
localStorage
.
get
(
'
vccToken
'
);
const
vccToken
=
localStorage
.
get
(
'
vccToken
'
);
const
needLogin
=
vccToken
?
true
:
fals
e
;
const
needLogin
=
vccToken
?
false
:
tru
e
;
if
(
needLogin
)
{
if
(
needLogin
)
{
if
(
isApp
)
this
.
nativeBridge
=
new
Bridge
();
if
(
isApp
)
this
.
nativeBridge
=
new
Bridge
();
else
if
(
isWxMp
)
this
.
nativeBridge
=
new
MpBridge
();
else
if
(
isWxMp
)
this
.
nativeBridge
=
new
MpBridge
();
...
@@ -85,10 +101,8 @@ export default {
...
@@ -85,10 +101,8 @@ export default {
newUrl
:
`/pages/user/login`
newUrl
:
`/pages/user/login`
});
});
}
else
if
(
isApp
)
{
}
else
if
(
isApp
)
{
// todo 向app要一个scheme
// native调用getToken
this
.
nativeBridge
.
openNewUrl
({
this
.
getToken
();
newUrl
:
``
});
}
else
{
}
else
{
this
.
$dialog
({
this
.
$dialog
({
message
:
'
请在App或小程序中参与活动~
'
,
message
:
'
请在App或小程序中参与活动~
'
,
...
@@ -100,10 +114,11 @@ export default {
...
@@ -100,10 +114,11 @@ export default {
}
}
});
});
}
}
return
needLogin
;
},
},
joinGroup
()
{
joinGroup
()
{
// 参团
// 参团
if
(
!
this
.
checkLogin
())
{
if
(
this
.
checkLogin
())
{
// todo
// todo
return
;
return
;
}
}
...
@@ -111,7 +126,7 @@ export default {
...
@@ -111,7 +126,7 @@ export default {
},
},
createGroup
()
{
createGroup
()
{
// 开团
// 开团
if
(
!
this
.
checkLogin
())
{
if
(
this
.
checkLogin
())
{
// todo
// todo
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment