Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
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
高淑倩
7-Eleven
Commits
4b4064af
Commit
4b4064af
authored
Jul 01, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify: webviewOnload
parent
cfa6ec5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
h5page.js
src/subPackage/page/pages/h5/h5page.js
+16
-16
No files found.
src/subPackage/page/pages/h5/h5page.js
View file @
4b4064af
...
@@ -26,22 +26,22 @@ wxService.page({
...
@@ -26,22 +26,22 @@ wxService.page({
}
}
},
},
webviewOnload
(
e
)
{
webviewOnload
(
e
)
{
if
(
e
.
type
===
'load'
)
{
//
if (e.type === 'load') {
const
src
=
e
.
detail
.
src
//
const src = e.detail.src
console
.
log
(
src
)
//
console.log(src)
let
pass
=
false
//
let pass = false
const
whitePages
=
this
.
data
.
h5WhitePages
//
const whitePages = this.data.h5WhitePages
whitePages
.
map
(
item
=>
{
//
whitePages.map(item => {
const
regex
=
new
RegExp
(
`
${
item
}
`
,
'gi'
)
//
const regex = new RegExp(`${item}`, 'gi')
if
(
!
pass
)
{
//
if (!pass) {
pass
=
regex
.
test
(
src
)
//
pass = regex.test(src)
}
//
}
})
//
})
// 不在白名单页中统一返回到首页
//
// 不在白名单页中统一返回到首页
if
(
!
pass
)
{
//
if (!pass) {
wxService
.
router
(
'/pages/userCenter/userCenter'
).
back
()
//
wxService.router('/pages/userCenter/userCenter').back()
}
//
}
}
//
}
},
},
/**
/**
...
...
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