Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Administrator
jd-vx-app
Commits
ce3b6016
Commit
ce3b6016
authored
Oct 14, 2022
by
lijiongliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
按钮跳转增加登录判断
parent
21c7bed8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
home-new.vue
pages/home-new.vue
+14
-0
shop.vue
pages/shop.vue
+7
-0
No files found.
pages/home-new.vue
View file @
ce3b6016
...
@@ -99,6 +99,13 @@
...
@@ -99,6 +99,13 @@
},
},
methods
:
{
methods
:
{
goShopH5
(
index
){
goShopH5
(
index
){
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
)
{
uni
.
navigateTo
({
url
:
'/pages/login/index/index'
})
return
;
}
let
url
;
let
url
;
if
(
index
==
1
){
if
(
index
==
1
){
url
=
'https://pro.m.jd.com/mall/active/3L2hs3R3aibYmosCRzA2Rp5z8pTR/index.html?babelChannel=ttt1'
url
=
'https://pro.m.jd.com/mall/active/3L2hs3R3aibYmosCRzA2Rp5z8pTR/index.html?babelChannel=ttt1'
...
@@ -295,6 +302,13 @@
...
@@ -295,6 +302,13 @@
// uni.navigateTo({
// uni.navigateTo({
// url: '/pages/webview/webview?url=' + link
// url: '/pages/webview/webview?url=' + link
// })
// })
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
)
{
uni
.
navigateTo
({
url
:
'/pages/login/index/index'
})
return
;
}
util
.
navigateToH5
({
page
:
link
})
util
.
navigateToH5
({
page
:
link
})
return
return
}
}
...
...
pages/shop.vue
View file @
ce3b6016
...
@@ -280,6 +280,13 @@ export default {
...
@@ -280,6 +280,13 @@ export default {
// uni.navigateTo({
// uni.navigateTo({
// url: '/pages/webview/webview?url=' + link
// url: '/pages/webview/webview?url=' + link
// })
// })
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
)
{
uni
.
navigateTo
({
url
:
'/pages/login/index/index'
})
return
;
}
util
.
navigateToH5
({
page
:
link
})
util
.
navigateToH5
({
page
:
link
})
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