Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
polysoft-nafmii
/
polysoft-h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ca916c58
authored
May 10, 2021
by
amateur
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改导航栏刘海屏高度适配
1 parent
6beff104
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
1 deletions
src/components/NafmHeader.vue
src/main.js
src/store/index.js
src/store/modules/common.js
src/components/NafmHeader.vue
View file @
ca916c5
...
...
@@ -34,6 +34,7 @@
</section>
</
template
>
<
script
>
import
{
mapGetters
}
from
'vuex'
export
default
{
name
:
'NafmHeader'
,
props
:
{
...
...
@@ -69,6 +70,7 @@ export default {
}
},
computed
:
{
...
mapGetters
(
'common'
,
[
'GStatusBarHeight'
]),
navObj
()
{
const
meta
=
this
.
$route
.
meta
let
leftArrowStatus
=
true
...
...
@@ -86,6 +88,7 @@ export default {
barStyle
:
{
...
barStyleBg
,
color
:
this
.
color
||
meta
.
color
||
'#fff'
,
paddingTop
:
`
${
this
.
GStatusBarHeight
}
px`
},
barLeftText
:
this
.
leftText
||
meta
.
leftText
||
''
,
barTitle
:
this
.
title
||
meta
.
title
||
''
,
...
...
src/main.js
View file @
ca916c5
...
...
@@ -18,6 +18,9 @@ if (APP_ENV != 'production') {
Vue
.
use
(
vConsole
)
}
// 获取APP 相关信息
store
.
dispatch
(
'common/AGetAppInfo'
)
Vue
.
use
({
install
(
vue
)
{
Object
.
assign
(
vue
.
prototype
,
{
...
...
src/store/index.js
View file @
ca916c5
...
...
@@ -4,6 +4,7 @@ import VuexPersistence from 'vuex-persist'
import
createLogger
from
'vuex/dist/logger'
import
home
from
'./modules/home'
import
user
from
'./modules/user'
import
common
from
'./modules/common'
// vuex 数据存储 进行本地存储操作
const
vuexLocal
=
new
VuexPersistence
({
...
...
@@ -16,7 +17,8 @@ const store = new Vuex.Store({
strict
:
process
.
env
.
NODE_ENV
!==
'production'
,
modules
:
{
home
,
user
user
,
common
},
plugins
:
[
vuexLocal
.
plugin
,
createLogger
()]
})
...
...
src/store/modules/common.js
0 → 100644
View file @
ca916c5
import
{
NativeApi
}
from
'@/api/NativeApis'
const
AppInfo
=
{
versionCode
:
100
,
versionName
:
'2.1'
,
statusBarHeight
:
0
,
sourceFlag
:
false
}
export
default
{
namespaced
:
true
,
state
:
{
AppInfo
:
{
...
AppInfo
}
},
mutations
:
{
MSetAppInfo
(
state
,
data
)
{
Object
.
assign
(
state
.
AppInfo
,
data
)
}
},
actions
:
{
AGetAppInfo
({
state
,
commit
})
{
if
(
state
.
AppInfo
.
sourceFlag
)
{
return
}
NativeApi
.
nativeAppInfo
({}).
then
(
res
=>
{
if
(
res
.
data
)
{
Object
.
assign
(
res
.
data
,
{
sourceFlag
:
true
})
}
commit
(
'MSetAppInfo'
,
res
.
data
)
}).
catch
(
e
=>
{
commit
(
'MSetAppInfo'
,
AppInfo
)
})
}
},
getters
:
{
GStatusBarHeight
(
state
)
{
return
state
.
AppInfo
.
statusBarHeight
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment