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
cc662a3e
Commit
cc662a3e
authored
Sep 15, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 处理原生浏览器和微信浏览器差异
parent
536b25df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
3 deletions
+41
-3
module.js
src/store/module.js
+3
-2
bottomNav.vue
src/views/goodsDetail/components/bottomNav.vue
+38
-1
No files found.
src/store/module.js
View file @
cc662a3e
...
...
@@ -86,14 +86,15 @@ const mutations = {
confirmButtonText
:
'
打开微信小程序
'
,
onConfirm
:
()
=>
{
// todo 跳转到小程序
cons
t
getScheme
=
async
function
()
{
le
t
getScheme
=
async
function
()
{
const
[
res
]
=
await
groupBuy
.
getScheme
({
miniUrl
:
'
pages/user/login
'
});
const
url
=
res
;
window
.
location
.
href
=
url
;
window
.
location
.
href
=
url
;
// todo 需要验证
};
getScheme
();
getScheme
=
null
;
}
});
}
...
...
src/views/goodsDetail/components/bottomNav.vue
View file @
cc662a3e
...
...
@@ -29,6 +29,9 @@
</div>
</template>
<
script
>
import
{
isApp
,
isWxMp
}
from
'
@/service/validation.service
'
;
import
Bridge
from
'
@qg/js-bridge
'
;
import
MpBridge
from
'
@/service/mp
'
;
export
default
{
name
:
'
BottomNav
'
,
props
:
{
...
...
@@ -59,10 +62,44 @@ export default {
default
:
2
}
},
data
()
{
return
{
nativeBridge
:
null
};
},
methods
:
{
checkLogin
()
{
const
vccToken
=
localStorage
.
get
(
'
vccToken
'
);
return
vccToken
?
true
:
false
;
const
needLogin
=
vccToken
?
true
:
false
;
if
(
needLogin
)
{
if
(
isApp
)
this
.
nativeBridge
=
new
Bridge
();
else
if
(
isWxMp
)
this
.
nativeBridge
=
new
MpBridge
();
this
.
$dialog
({
message
:
'
参与拼团活动需要您先进行登录哦~
'
,
title
:
''
,
showCancelButton
:
false
,
confirmButtonText
:
'
登录
'
,
onConfirm
:
()
=>
{
if
(
isWxMp
)
{
this
.
nativeBridge
.
openNewUrl
({
newUrl
:
`/pages/user/login`
});
}
else
if
(
isApp
)
{
// todo 向app要一个scheme
this
.
nativeBridge
.
openNewUrl
({
newUrl
:
``
});
}
else
{
this
.
$dialog
({
message
:
'
请在App或小程序中参与活动~
'
,
title
:
''
,
showCancelButton
:
false
,
confirmButtonText
:
'
我知道了
'
});
}
}
});
}
},
joinGroup
()
{
// 参团
...
...
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