Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
10b4a038
Commit
10b4a038
authored
Jan 09, 2023
by
kyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决白屏问题
parent
66b8a79c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
28 deletions
+54
-28
pages.json
+2
-1
pages/downloadApp/downloadApp.vue
+31
-27
util/router.js
+21
-0
No files found.
pages.json
View file @
10b4a038
...
@@ -439,8 +439,9 @@
...
@@ -439,8 +439,9 @@
"navigationBarTitleText"
:
"批量数据计算"
"navigationBarTitleText"
:
"批量数据计算"
}
}
}
}
,{
,{
"path"
:
"pages/downloadApp
Common/downloadAppCommon
"
,
"path"
:
"pages/downloadApp
/downloadApp
"
,
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
""
,
...
...
pages/downloadApp
Common/downloadAppCommon
.vue
→
pages/downloadApp
/downloadApp
.vue
View file @
10b4a038
...
@@ -24,11 +24,36 @@
...
@@ -24,11 +24,36 @@
<view
class=
"confirmBtn"
>
知道了
</view>
<view
class=
"confirmBtn"
>
知道了
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
// 兼容
export
default
{
let
browser
=
{
data
()
{
return
{
markFlag
:
false
,
iosFlag
:
false
,
browser
:{}
}
},
methods
:
{
// 下载app
handleBtnDown
()
{
if
(
browser
.
versions
.
weixin
){
this
.
markFlag
=
true
;
return
;
}
if
(
browser
.
versions
.
android
)
{
window
.
location
.
href
=
"https://mdev.anjibao.cn/app.apk"
;
}
else
if
(
browser
.
versions
.
ios
)
{
console
.
log
(
'ios'
)
window
.
location
.
href
=
"http://itunes.apple.com/us/app/id399608199"
;
}
}
},
onLoad
()
{
this
.
browser
=
{
versions
:
function
()
{
versions
:
function
()
{
let
u
=
navigator
.
userAgent
,
let
u
=
navigator
.
userAgent
,
app
=
navigator
.
appVersion
;
app
=
navigator
.
appVersion
;
...
@@ -60,15 +85,7 @@
...
@@ -60,15 +85,7 @@
};
};
}(),
}(),
language
:
(
navigator
.
browserLanguage
||
navigator
.
language
).
toLowerCase
()
language
:
(
navigator
.
browserLanguage
||
navigator
.
language
).
toLowerCase
()
};
}
export
default
{
data
()
{
return
{
markFlag
:
false
,
iosFlag
:
false
};
},
onLoad
()
{
if
(
browser
.
versions
.
ios
){
if
(
browser
.
versions
.
ios
){
this
.
iosFlag
=
true
this
.
iosFlag
=
true
}
else
{
}
else
{
...
@@ -85,27 +102,13 @@
...
@@ -85,27 +102,13 @@
console
.
log
(
'android'
)
console
.
log
(
'android'
)
// window.location.href = "cffpapp://" //manifest.json配置的schemes
// window.location.href = "cffpapp://" //manifest.json配置的schemes
}
}
},
methods
:{
// 下载app
handleBtnDown
()
{
if
(
browser
.
versions
.
weixin
){
this
.
markFlag
=
true
;
return
;
}
if
(
browser
.
versions
.
android
)
{
window
.
location
.
href
=
"https://mdev.anjibao.cn/app.apk"
;
}
else
if
(
browser
.
versions
.
ios
)
{
console
.
log
(
'ios'
)
window
.
location
.
href
=
"http://itunes.apple.com/us/app/id399608199"
;
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
.downContainer
{
.downContainer
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
align-items
:
center
;
align-items
:
center
;
...
@@ -189,4 +192,5 @@
...
@@ -189,4 +192,5 @@
color
:
#666
;
color
:
#666
;
}
}
}
}
</
style
>
</
style
>
util/router.js
View file @
10b4a038
...
@@ -11,6 +11,8 @@ export default function initApp(){
...
@@ -11,6 +11,8 @@ export default function initApp(){
uni
.
addInterceptor
(
'navigateTo'
,
{
uni
.
addInterceptor
(
'navigateTo'
,
{
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke
(
e
)
{
invoke
(
e
)
{
let
app
=
getCurrentPages
()
console
.
log
(
'页面站==='
,
app
)
if
(
!
hasPermission
(
e
.
url
)){
if
(
!
hasPermission
(
e
.
url
)){
uni
.
reLaunch
({
uni
.
reLaunch
({
url
:
'/components/login/login'
url
:
'/components/login/login'
...
@@ -26,6 +28,25 @@ export default function initApp(){
...
@@ -26,6 +28,25 @@ export default function initApp(){
uni
.
addInterceptor
(
'switchTab'
,
{
uni
.
addInterceptor
(
'switchTab'
,
{
// tabbar页面跳转前进行拦截
// tabbar页面跳转前进行拦截
invoke
(
e
)
{
invoke
(
e
)
{
let
app
=
getCurrentPages
()
console
.
log
(
'页面站==='
,
app
)
if
(
!
hasPermission
(
e
.
url
)){
uni
.
reLaunch
({
url
:
'/components/login/login'
})
return
false
}
return
true
},
success
(
e
)
{
}
})
uni
.
addInterceptor
(
'reLaunch'
,
{
// tabbar页面跳转前进行拦截
invoke
(
e
)
{
let
app
=
getCurrentPages
()
console
.
log
(
'页面站==='
,
app
)
if
(
!
hasPermission
(
e
.
url
)){
if
(
!
hasPermission
(
e
.
url
)){
uni
.
reLaunch
({
uni
.
reLaunch
({
url
:
'/components/login/login'
url
:
'/components/login/login'
...
...
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