Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
pingan-life-index-pro
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3b13238d
authored
2020-05-17 19:10:41 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
删除备份文件
1 parent
65761f08
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
0 additions
and
1391 deletions
src/components/home-bk/dropdown/dropdown.js
src/components/home-bk/dropdown/dropdown.scss
src/components/home-bk/dropdown/dropdown.vue
src/components/home-bk/footer/footer.js
src/components/home-bk/footer/footer.scss
src/components/home-bk/footer/footer.vue
src/components/home-bk/header/header.js
src/components/home-bk/header/header.scss
src/components/home-bk/header/header.vue
src/components/home-bk/m-dropdown/m-dropdown.js
src/components/home-bk/m-dropdown/m-dropdown.scss
src/components/home-bk/m-dropdown/m-dropdown.vue
src/components/home-bk/dropdown/dropdown.js
deleted
100644 → 0
View file @
65761f0
/**
* 组件描述:PC顶栏导航下拉菜单
*/
import
api
from
'@/api/api'
import
{
httpPost
}
from
'@/api/fetch-api.js'
export
default
{
name
:
"DropDownList"
,
data
()
{
return
{
activeIndex
:
0
,
sTitle
:
this
.
dataObj
&&
this
.
dataObj
.
name
||
''
,
reloadBlackList
:
[]
};
},
props
:
{
/**
* 导航类型
* nav:普通菜单导航
* login:登陆菜单
* lang:三语切换菜单
*/
type
:
{
type
:
String
,
default
()
{
return
"nav"
;
}
},
/**
* 传入菜单完整数据
*/
dataObj
:
{
type
:
Object
,
default
()
{
return
{};
}
},
/**
* 传入菜单列表
*/
dataList
:
{
type
:
Array
,
default
()
{
return
[];
}
},
labelProperty
:
{
type
:
String
,
default
()
{
return
"name"
;
}
}
},
directives
:
{
dpl
:
{
bind
(
el
)
{
el
.
style
.
display
=
"none"
;
}
}
},
methods
:
{
onNavHandler
()
{
console
.
log
(
"this.dataObj:"
,
this
.
dataObj
);
let
path
=
this
.
dataObj
&&
this
.
dataObj
.
path
||
""
;
if
(
path
)
{
this
.
$router
.
push
({
path
:
path
})
}
},
onOverHandler
(
event
)
{
let
ul
=
event
.
currentTarget
.
childNodes
[
1
].
childNodes
[
1
];
ul
.
style
.
display
=
"block"
;
},
onOutHandler
(
event
)
{
// console.log(event);
let
ul
=
event
.
currentTarget
.
childNodes
[
1
].
childNodes
[
1
];
ul
.
style
.
display
=
"none"
;
},
onClickHandler
(
event
,
index
)
{
// 隐藏其他
if
(
this
.
$refs
.
ul
)
{
this
.
$refs
.
ul
.
style
.
display
=
"none"
;
}
// 选择item
this
.
activeIndex
=
index
;
let
curData
=
this
.
dataList
[
index
];
if
(
this
.
type
==
"lang"
)
{
// 如果是语言设置,则设置语言
let
lang
=
curData
.
value
;
if
(
lang
!=
localStorage
.
getItem
(
'lang'
))
{
localStorage
.
setItem
(
"lang"
,
lang
);
if
(
this
.
reloadBlackList
.
indexOf
(
this
.
$route
.
path
)
>=
0
)
{
window
.
location
.
reload
();
}
else
{
this
.
$i18n
.
locale
=
lang
;
this
.
sTitle
=
curData
.
name
;
this
.
$root
.
eventBus
.
$emit
(
"langChange"
);
}
}
}
else
{
let
item
=
curData
;
let
path
=
item
&&
item
.
path
||
""
;
this
.
$root
.
eventBus
.
$emit
(
item
.
path
);
if
(
path
)
{
// console.log("path:", path);
// modify
if
(
path
==
"/custom/service?q=m5"
)
{
path
=
"/clarms"
}
this
.
$router
.
push
({
path
:
path
})
}
else
{
let
value
=
item
&&
item
.
value
||
null
;
if
(
value
)
{
switch
(
value
)
{
case
"login"
:
this
.
onLoginHandler
();
break
;
case
"logout"
:
this
.
logoutHandler
();
break
;
case
"gotoVHIS"
:
// gotoVHIS(this.$i18n.locale);
this
.
$router
.
push
({
path
:
"/vhis"
});
break
;
}
}
}
}
},
onLoginHandler
()
{
this
.
$root
.
eventBus
.
$emit
(
"login"
);
if
(
this
.
$route
.
name
==
"login"
)
{
return
;
}
else
if
(
this
.
$route
.
name
==
"register"
||
this
.
$route
.
name
==
"passwordFind"
)
{
this
.
$router
.
push
({
path
:
"/login"
});
}
else
{
let
callback
=
this
.
$route
.
fullPath
;
this
.
$router
.
push
({
path
:
"/login?callback="
+
callback
});
}
},
logoutHandler
()
{
this
.
clearCache
();
httpPost
({
url
:
api
.
logout
}).
then
(()
=>
{
this
.
$store
.
commit
(
"SET_USER_INFO"
,
null
);
this
.
showLogoutTip
();
});
},
clearCache
()
{
for
(
let
index
=
0
;
index
<
sessionStorage
.
length
;
index
++
)
{
let
key
=
sessionStorage
.
key
(
index
);
console
.
log
(
key
);
sessionStorage
.
removeItem
(
key
);
}
},
showLogoutTip
()
{
// 登出后的提示
// alert("登出成功");
},
updateTitle
(
name
)
{
this
.
sTitle
=
name
||
this
.
sTitle
;
}
},
computed
:
{
dplLable
()
{
return
this
.
dataList
[
this
.
activeIndex
][
this
.
labelProperty
];
}
},
created
()
{},
};
src/components/home-bk/dropdown/dropdown.scss
deleted
100644 → 0
View file @
65761f0
@import
'@/styles/_support.scss'
;
.drop-list
{
display
:
inline-block
;
min-width
:
120px
;
position
:
relative
;
margin
:
0
13
.2px
;
font-size
:
$fontSizeTitle
;
.list
{
position
:
absolute
;
width
:
132px
;
left
:
0
;
right
:
0
;
margin
:
0
auto
;
font-size
:
$fontSize
;
left
:
50%
;
transform
:
translateX
(
-50%
);
//居中处理
.space
{
height
:
18px
;
}
}
span
{
display
:
block
;
text-align
:
center
;
}
span
:hover
{}
ul
{
display
:
none
;
overflow
:
hidden
;
box-shadow
:
0
0
18px
0
rgba
(
255
,
87
,
0
,
0
.15
);
border-radius
:
6px
;
li
{
// border-bottom: solid 1px #f1f1f1;
background
:
#ffffff
;
text-align
:
center
;
padding
:
18px
0
;
position
:
relative
;
&
:after
{
content
:
""
;
width
:
84px
;
height
:
1px
;
background
:
#f1f1f1
;
position
:
absolute
;
bottom
:
0
;
left
:
50%
;
transform
:
translateX
(
-50%
);
//居中处理
}
}
li
:last-child
{
border-bottom
:
none
;
&
:after
{
background
:
transparent
;
}
}
li
:hover
{
color
:
$cOrange
;
}
}
}
.drop-list
:lang
(
en
)
{
min-width
:
0
;
margin
:
0
32px
;
}
.user
{
width
:
111px
;
height
:
36px
;
border-radius
:
36px
;
background-color
:
$cOrange
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
#ffffff
;
margin
:
0
auto
;
span
{
max-width
:
51px
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
.icon-img
{
margin
:
0
6px
;
}
}
// 登陆
.login
{}
@media
(
max-width
:
1100px
)
{
.drop-list
{
margin
:
0
28px
;
min-width
:
0
;
}
.drop-list
:lang
(
en
)
{
margin
:
0
22px
;
}
}
@media
(
max-width
:
1000px
)
{
// .drop-list {
// margin: 0 20px;
// }
}
src/components/home-bk/dropdown/dropdown.vue
deleted
100644 → 0
View file @
65761f0
<
template
>
<div
class=
"drop-list"
:class=
"
{'login':type=='login'}" @mouseover="onOverHandler($event)" @mouseout="onOutHandler($event)">
<!-- 登陆下拉样式 -->
<template
v-if=
"type=='login'"
>
<div
class=
"user"
@
click=
"onLoginHandler()"
>
<img
class=
"icon-img"
src=
"@/assets/images/home/icon-user.png"
>
<span>
{{
dataObj
.
name
}}
</span>
</div>
</
template
>
<!-- 其他下拉样式 -->
<
template
v-else
>
<span
@
click=
"onNavHandler()"
>
{{
type
==
"lang"
?
sTitle
:
dataObj
.
name
}}
</span>
</
template
>
<div
class=
"list"
>
<div
class=
"space"
></div>
<ul
ref=
"ul"
v-dpl
>
<li
v-for=
"(item, index) in dataList"
:key=
"index"
@
mousedown=
"onClickHandler($event,index)"
>
{{item[labelProperty]}}
</li>
</ul>
</div>
</div>
</template>
<
script
src=
"./dropdown.js"
></
script
>
<
style
lang=
"scss"
scoped
>
@import
"./dropdown.scss"
;
</
style
>
src/components/home-bk/footer/footer.js
deleted
100644 → 0
View file @
65761f0
/**
* 组件描述:页脚
* 静态页面
*/
export
default
{
data
()
{
return
{
key
:
'value'
,
qrcodeVisible
:
false
,
}
},
components
:
{},
methods
:
{
onOverHandler
(
event
)
{
this
.
qrcodeVisible
=
true
;
},
onOutHandler
(
event
)
{
this
.
qrcodeVisible
=
false
;
},
toPage
(
name
)
{
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
0
;
this
.
$router
.
push
({
name
:
name
})
},
toPath
(
path
)
{
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
0
;
this
.
$router
.
push
({
path
:
path
})
},
initData
()
{}
},
mounted
()
{},
created
()
{}
}
src/components/home-bk/footer/footer.scss
deleted
100644 → 0
View file @
65761f0
@import
'@/styles/_support.scss'
;
.v-footer
{
color
:
#ffffff
;
background-color
:
#2e2b2a
;
font-size
:
$fontSize
;
.footer-containter
{
margin
:
0
auto
;
max-width
:
1200px
;
.cont
{
.logo-wrap
{
padding
:
26px
0
;
.logo-img
{
cursor
:
pointer
;
}
}
.line
{
width
:
100%
;
height
:
1px
;
opacity
:
0
.2
;
background-color
:
#ffffff
;
}
// 信息
.info
{
padding
:
24px
0
24px
;
display
:
flex
;
// 热线
.hotline
{
min-width
:
294px
;
.contact
{
.n-item
{
margin-bottom
:
7
.2px
;
}
.phone
{
color
:
$cOrange
;
font-size
:
$fontSizeTitle
;
font-weight
:
bold
;
}
&
:first-child
{
margin-bottom
:
24px
;
}
}
}
// 导航
.nav
{
display
:
flex
;
.nav-v
{}
.n-item
{
cursor
:
pointer
;
min-width
:
177px
;
}
}
.nav2
{
display
:
none
;
}
// 公众号
.public
{
position
:
relative
;
text-align
:
left
;
margin-left
:
63
.84px
;
.qrcode-wrap
{
text-align
:
center
;
margin-top
:
3
.6px
;
.qrcode
{
width
:
100px
;
}
.c1
{
margin-top
:
3
.6px
;
}
}
.icon
{
margin-top
:
9px
;
margin-right
:
12px
;
display
:
inline-block
;
}
}
// 公共组件
.n-item
{
margin-bottom
:
24px
;
padding-right
:
36px
;
color
:
#dcdddd
;
&
:first-child
{
margin-bottom
:
32px
;
}
&
:last-child
{
margin-bottom
:
0
;
}
}
}
// 版权
.copyright
{
color
:
rgba
(
179
,
177
,
168
,
0
.5
);
padding
:
18px
0
;
line-height
:
1
.58
;
font-size
:
$fontSizeSmall
;
}
}
}
}
@media
(
max-width
:
1200px
)
{
.v-footer
{
@include
content-percent
();
.footer-containter
{
.cont
{
.info
{
display
:
block
;
.hotline
{}
.nav
{
margin-top
:
24px
;
display
:
flex
;
.nav-v
{
width
:
100%
;
}
.n-item
{
min-width
:
0
;
margin-right
:
0
;
padding-right
:
10px
;
}
}
.nav2
{
display
:
none
;
}
.public
{
margin
:
0
;
margin-top
:
36px
;
text-align
:
left
;
min-height
:
144px
;
}
}
.copyright
{
box-sizing
:
border-box
;
padding-right
:
24px
;
}
}
}
}
}
@media
(
max-width
:
768px
)
{
.v-footer
{
font-size
:
$fontSizeSmall-M
;
.footer-containter
{
.cont
{
.info
{
display
:
flex
;
justify-content
:
space-between
;
.hotline
{
min-width
:
0
;
.phone
{
font-size
:
$fontSizeSmall-M
!
important
;
font-weight
:
bold
!
important
;
}
}
.nav
{
display
:
none
;
margin-top
:
0
;
.nav-v
{}
.n-item
{}
}
.nav2
{
display
:
block
;
}
.public
{
margin
:
0
;
min-width
:
108px
;
.qrcode-wrap
{
img
{
width
:
84px
;
}
.c1
{
display
:
none
;
}
}
}
// 公共组件
.n-item
{
margin-bottom
:
24px
;
&
:first-child
{
margin-bottom
:
24px
;
}
}
}
.copyright
{}
}
}
}
}
src/components/home-bk/footer/footer.vue
deleted
100644 → 0
View file @
65761f0
<
template
>
<footer
class=
"v-footer "
>
<div
class=
"footer-containter "
>
<div
class=
"cont"
>
<div
class=
"logo-wrap"
>
<img
class=
"logo-img"
src=
"@/assets/images/home/footer-logo.png"
>
</div>
<div
class=
"line"
></div>
<!-- 信息 -->
<div
class=
"info"
>
<div
class=
"hotline"
>
<div
class=
"contact"
>
<div
class=
"n-item"
>
{{
$t
(
'footer.hkPhone'
)
}}
</div>
<div
class=
"phone"
>
(852)2983 8866
</div>
</div>
<div
class=
"contact"
>
<div
class=
"n-item"
>
{{
$t
(
'footer.cnPhone'
)
}}
</div>
<div
class=
"phone"
>
(86)40078 95511
</div>
</div>
</div>
<div
class=
"nav"
>
<div
class=
"nav-v"
>
<div
@
click=
"toPage('profile')"
class=
"n-item"
>
{{
$t
(
'footer.aboutUs'
)
}}
</div>
<div
@
click=
"toPage('profile')"
class=
"n-item"
>
{{
$t
(
'footer.companyIntroduction'
)
}}
</div>
<div
@
click=
"toPage('newsList')"
class=
"n-item"
>
{{
$t
(
'footer.news'
)
}}
</div>
<div
@
click=
"toPage('joinUs')"
class=
"n-item"
>
{{
$t
(
'footer.joinUs'
)
}}
</div>
</div>
<div
class=
"nav-v"
>
<div
@
click=
"toPage('help')"
class=
"n-item"
>
{{
$t
(
'footer.helpCenter'
)
}}
</div>
<div
@
click=
"toPage('privacy')"
class=
"n-item"
>
{{
$t
(
'footer.privacy'
)
}}
</div>
<div
@
click=
"toPage('terms')"
class=
"n-item"
>
{{
$t
(
'footer.terms'
)
}}
</div>
<div
@
click=
"toPage('personalDataCollection')"
class=
"n-item"
>
{{
$t
(
'footer.protocol'
)
}}
</div>
</div>
<div
class=
"nav-v"
>
<div
@
click=
"toPath('/custom/service?q=m1')"
class=
"n-item"
>
{{
$t
(
'footer.contactUs'
)
}}
</div>
<div
@
click=
"toPage('contactMethod')"
class=
"n-item"
>
{{
$t
(
'footer.contactInformation'
)
}}
</div>
<div
@
click=
"toPage('serviceNet')"
class=
"n-item"
>
{{
$t
(
'footer.service'
)
}}
</div>
<div
@
click=
"toPage('map')"
class=
"n-item"
>
{{
$t
(
'footer.map'
)
}}
</div>
</div>
</div>
<div
class=
"nav nav2"
>
<div
class=
"nav-v"
>
<div
@
click=
"toPage('privacy')"
class=
"n-item"
>
{{
$t
(
'footer.privacy'
)
}}
</div>
<div
@
click=
"toPage('terms')"
class=
"n-item"
>
{{
$t
(
'footer.terms'
)
}}
</div>
<div
@
click=
"toPage('personalDataCollection')"
class=
"n-item"
>
{{
$t
(
'footer.protocol'
)
}}
</div>
</div>
</div>
<div
class=
"public"
>
<div
class=
"tit"
>
{{
$t
(
'footer.qrcode'
)
}}
</div>
<div
@
click=
"qrcodeVisible = !qrcodeVisible"
v-if=
"qrcodeVisible"
class=
"qrcode-wrap"
>
<img
@
mouseout=
"onOutHandler($event)"
src=
"@/assets/images/home/qrcode.png"
alt=
""
>
<div
class=
"c1"
>
{{
$t
(
'footer.qrcodeBot'
)
}}
</div>
</div>
<template
v-else
>
<img
@
click=
"qrcodeVisible = !qrcodeVisible"
@
mouseover=
"onOverHandler($event)"
@
mouseout=
"onOutHandler($event)"
class=
"icon pointer"
src=
"@/assets/images/home/footer-icon-1.png"
alt=
""
>
<img
class=
"icon pointer"
src=
"@/assets/images/home/footer-icon-2.png"
alt=
""
>
<img
class=
"icon pointer"
src=
"@/assets/images/home/footer-icon-3.png"
alt=
""
>
</
template
>
</div>
</div>
<div
class=
"line"
></div>
<!-- 版权 -->
<div
class=
"copyright"
>
{{$t('footer.copyright')}}
</div>
</div>
</div>
</footer>
</template>
<
script
src=
"./footer.js"
></
script
>
<
style
lang=
"scss"
scoped
>
@import
"./footer.scss"
;
</
style
>
src/components/home-bk/header/header.js
deleted
100644 → 0
View file @
65761f0
/**
* 组件描述:官网顶栏导航
* 通过@midea 媒体查询决定显示PC/移动端样式
*/
import
{
mapState
}
from
'vuex'
import
{
getObjByListKeyValue
}
from
'@utils/utils.js'
import
VDropdown
from
'@components/home/dropdown/dropdown.vue'
import
MDropdown
from
'@components/home/m-dropdown/m-dropdown.vue'
export
default
{
name
:
'VHeader'
,
components
:
{
VDropdown
,
MDropdown
},
computed
:
{
i18n
()
{
return
this
.
$i18n
.
messages
&&
this
.
$i18n
.
locale
?
this
.
$i18n
.
messages
[
this
.
$i18n
.
locale
]
:
{};
}
},
data
()
{
return
{
dropdownMVisible
:
false
,
loginMVisible
:
false
,
maxClientWidth
:
1200
,
// 用于传入到导航组件dropdown 常规导航菜单数据
navList
:
[],
// 用于传入到导航组件dropdown 登菜单数据
loginData
:
{},
// 用于传入到导航组件dropdown 语言菜单数据
langData
:
{
name
:
"繁"
,
path
:
""
,
list
:
[{
name
:
"繁"
,
path
:
""
,
value
:
"tc"
},
{
name
:
"简"
,
path
:
""
,
value
:
"zh"
},
{
name
:
"EN"
,
path
:
""
,
value
:
"en"
},
]
}
}
},
computed
:
{
...
mapState
({
isSmallScreen
:
state
=>
state
.
isSmallScreen
,
userInfo
:
state
=>
state
.
userInfo
})
},
methods
:
{
toIndex
()
{
this
.
$router
.
push
({
path
:
"/"
})
},
onShowDropdown
(
evtStr
)
{
this
.
dropdownMVisible
=
false
;
this
.
loginMVisible
=
false
;
if
(
evtStr
==
'nav'
)
{
this
.
dropdownMVisible
=
true
;
}
else
if
(
evtStr
==
'login'
)
{
this
.
loginMVisible
=
true
;
}
else
{}
},
checkIsSmallScreen
()
{
const
self
=
this
;
if
(
document
.
body
.
clientWidth
>
self
.
maxClientWidth
)
{
self
.
$store
.
commit
(
'IS_SMALL_SCREEN'
,
false
)
}
else
{
self
.
$store
.
commit
(
'IS_SMALL_SCREEN'
,
true
)
}
},
initData
()
{
let
i18n
=
this
.
$i18n
.
messages
[
this
.
$i18n
.
locale
]
||
{};
this
.
buildLoginMenu
();
this
.
navList
=
i18n
.
nav
.
navList
;
let
curLang
=
getObjByListKeyValue
(
this
.
$i18n
.
locale
,
"value"
,
this
.
langData
.
list
)
this
.
langData
.
name
=
curLang
.
name
;
},
/**
* 根据登陆状态构建登陆菜单
*/
buildLoginMenu
()
{
let
i18n
=
this
.
$i18n
.
messages
[
this
.
$i18n
.
locale
]
||
{};
let
menuData
=
JSON
.
parse
(
JSON
.
stringify
(
i18n
.
nav
.
loginData
));
let
list
=
[];
if
(
this
.
userInfo
&&
this
.
userInfo
.
name
)
{
menuData
.
name
=
this
.
userInfo
.
name
;
if
(
this
.
$i18n
.
locale
==
"en"
&&
this
.
userInfo
.
nameEn
)
{
menuData
.
name
=
this
.
userInfo
.
nameEn
;
}
menuData
.
list
.
forEach
(
element
=>
{
if
(
element
.
type
==
"auth"
)
{
list
.
push
(
element
);
}
});
}
else
{
menuData
.
list
.
forEach
(
element
=>
{
if
(
element
.
type
==
"noAuth"
)
{
list
.
push
(
element
);
}
});
}
menuData
.
list
=
list
;
this
.
$set
(
this
,
'loginData'
,
menuData
);
}
},
beforeDestroy
()
{
window
.
removeEventListener
(
'resize'
,
this
.
checkIsSmallScreen
(),
false
)
},
mounted
()
{
window
.
addEventListener
(
'resize'
,
()
=>
this
.
checkIsSmallScreen
(),
false
);
this
.
$root
.
eventBus
.
$on
(
"langChange"
,
()
=>
{
this
.
initData
();
});
},
watch
:
{
userInfo
(
val
)
{
this
.
buildLoginMenu
();
}
},
created
()
{
this
.
initData
();
},
}
src/components/home-bk/header/header.scss
deleted
100644 → 0
View file @
65761f0
@import
'@/styles/_support.scss'
;
$navHei
:
92px
;
$navHeiM
:
72px
;
.v-header
{
height
:
$navHei
;
background-color
:
#fff
;
color
:
$cFontGray
;
position
:
relative
;
z-index
:
1000
;
font-size
:
$fontSize
;
.header-container
{
max-width
:
1200px
;
height
:
100%
;
margin
:
auto
;
display
:
flex
;
align-items
:
center
;
position
:
relative
;
}
.main-nav
{
height
:
100%
;
flex
:
1
0
auto
;
}
.logo-img
{
margin-right
:
43
.2px
;
max-width
:
213px
;
cursor
:
pointer
;
}
.nav-list
{
height
:
100%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
position
:
relative
;
}
.nav-item
{
display
:
flex
;
align-items
:
center
;
height
:
100%
;
margin
:
0
;
-ms-flex-pack
:
center
;
justify-content
:
center
;
position
:
relative
;
cursor
:
pointer
;
}
.main-nav-list
{
display
:
flex
;
cursor
:
pointer
;
}
.nav-item.link-item
{
padding
:
0
50px
;
height
:
60px
;
}
.nav-item.search
{
flex
:
1
1
auto
;
}
.nav-item.auth
{
color
:
#ffffff
;
.lang
{
color
:
$cOrange
;
min-width
:
96px
;
}
}
}
.pc
{
display
:
block
;
}
// 移动端导航
.mobile
{
display
:
none
;
&
-nav-list
{
position
:
absolute
;
right
:
0
;
top
:
24px
;
display
:
flex
;
align-items
:
center
;
img
{
width
:
20px
;
margin-left
:
20px
;
}
}
}
@media
(
max-width
:
1200px
)
{
.v-header
{
@include
content-percent
(
1%
);
}
}
@media
(
max-width
:
1100px
)
{
.v-header
{
.logo-img
{
margin-right
:
24px
;
}
}
.pc
{
.auth
{
margin-right
:
20px
;
}
.nav-item.auth
{
.lang
{
min-width
:
auto
;
}
}
}
}
@media
(
max-width
:
980px
)
{
.v-header
{
@include
content-percent
();
.main-nav
{}
.logo-img
{
max-width
:
213px
;
margin
:
0
;
}
.pc
{
display
:
none
;
}
.mobile
{
display
:
block
;
&
-nav-list
{
top
:
32px
;
}
}
}
}
@media
(
max-width
:
768px
)
{
.v-header
{
// 原1200px临界样式
.pc
{
display
:
none
;
}
height
:
$navHeight-M
;
.logo-img
{
width
:
186px
;
margin
:
0
;
}
.mobile
{
display
:
block
;
&
-nav-list
{
top
:
24px
;
}
}
}
}
src/components/home-bk/header/header.vue
deleted
100644 → 0
View file @
65761f0
<
template
>
<header
class=
"v-header"
>
<div
class=
"header-container"
>
<img
@
click=
"toIndex"
src=
"@/assets/images/home/header-logo.png"
alt=
"中国平安人寿保险"
class=
"logo-img"
>
<div
class=
"main-nav"
>
<!-- mobile -->
<div
class=
"nav-list-m mobile"
>
<div
class=
"mobile-nav-list"
>
<img
@
click=
"onShowDropdown('login')"
v-if=
"!loginMVisible"
src=
"@/assets/images/home/mobile-user.png"
alt=
""
>
<img
@
click=
"onShowDropdown('')"
v-else
src=
"@/assets/images/home/mobile-user.png"
alt=
""
>
<img
@
click=
"onShowDropdown('nav')"
v-if=
"!dropdownMVisible"
src=
"@/assets/images/home/mobile-nav.png"
alt=
""
>
<img
@
click=
"onShowDropdown('')"
v-else
src=
"@/assets/images/home/mobile-nav-close.png"
alt=
""
>
</div>
<m-dropdown
class=
"lang"
:type=
"'nav'"
:visible=
"dropdownMVisible"
:show-dropdown-m=
"onShowDropdown"
:lang-list=
"langData.list"
ref=
"pcMenu"
></m-dropdown>
<m-dropdown
class=
"lang"
:type=
"'login'"
:visible=
"loginMVisible"
:show-dropdown-m=
"onShowDropdown"
></m-dropdown>
</div>
<!-- pc -->
<div
class=
"nav-list pc"
>
<div
class=
"main-nav-list"
>
<v-dropdown
v-for=
"item in navList"
:key=
"item.id"
:data-obj=
"item"
:data-list=
"item.list"
>
</v-dropdown>
</div>
<div
class=
"nav-item search"
></div>
<div
class=
"nav-item auth"
>
<v-dropdown
class=
"lang"
:type=
"'login'"
:data-obj=
"loginData"
:data-list=
"loginData.list"
ref=
"mobileMenu"
></v-dropdown>
<v-dropdown
class=
"lang"
:type=
"'lang'"
:data-obj=
"langData"
:data-list=
"langData.list"
></v-dropdown>
</div>
</div>
</div>
</div>
</header>
</
template
>
<
script
src=
"./header.js"
></
script
>
<
style
lang=
"scss"
scoped
>
@import
"./header.scss"
;
</
style
>
src/components/home-bk/m-dropdown/m-dropdown.js
deleted
100644 → 0
View file @
65761f0
import
{
mapState
}
from
'vuex'
import
api
from
'@/api/api'
import
{
httpPost
}
from
'@/api/fetch-api.js'
export
default
{
name
:
"DropDownList"
,
data
()
{
return
{
navList
:
[],
activeNames
:
[],
activeName
:
[],
activeIndex
:
-
1
,
borderBoo
:
false
};
},
props
:
{
visible
:
{
type
:
Boolean
,
default
()
{
return
false
;
}
},
/**
* 导航类型
* nav:普通菜单导航
* login:登陆菜单
* lang:三语切换菜单
*/
type
:
{
type
:
String
,
default
()
{
return
"nav"
;
}
},
/**
* 传入菜单列表
*/
langList
:
{
type
:
Array
,
default
()
{
return
[];
}
},
// 显示/隐藏移动端导航
showDropdownM
:
{
type
:
Function
,
default
:
null
},
},
computed
:
{
...
mapState
({
isSmallScreen
:
state
=>
state
.
isSmallScreen
,
userInfo
:
state
=>
state
.
userInfo
}),
locale
()
{
return
this
.
$i18n
.
locale
||
'tc'
;
},
i18n
()
{
return
this
.
$i18n
.
messages
&&
this
.
$i18n
.
locale
?
this
.
$i18n
.
messages
[
this
.
$i18n
.
locale
]
:
{};
},
},
methods
:
{
// 跳转菜单
onClickHandler
(
item
)
{
let
path
=
item
&&
item
.
path
||
""
;
this
.
showDropdownM
(
''
);
if
(
path
)
{
this
.
$router
.
push
({
path
:
path
})
}
else
{
let
value
=
item
&&
item
.
value
||
null
;
if
(
value
)
{
switch
(
value
)
{
case
"login"
:
this
.
onLoginHandler
();
break
;
case
"logout"
:
this
.
logoutHandler
();
break
;
case
"gotoVHIS"
:
// gotoVHIS(this.$i18n.locale);
this
.
$router
.
push
({
path
:
"/vhis"
});
break
;
}
}
}
},
onLoginHandler
()
{
if
(
this
.
$route
.
name
==
"login"
)
{
return
;
}
else
if
(
this
.
$route
.
name
==
"register"
||
this
.
$route
.
name
==
"passwordFind"
)
{
this
.
$router
.
push
({
path
:
"/login"
});
}
else
{
let
callback
=
this
.
$route
.
fullPath
;
this
.
$router
.
push
({
path
:
"/login?callback="
+
callback
});
}
},
logoutHandler
()
{
this
.
clearCache
();
httpPost
({
url
:
api
.
logout
}).
then
(()
=>
{
this
.
$store
.
commit
(
"SET_USER_INFO"
,
null
);
this
.
showLogoutTip
();
});
},
clearCache
()
{
for
(
let
index
=
0
;
index
<
sessionStorage
.
length
;
index
++
)
{
let
key
=
sessionStorage
.
key
(
index
);
sessionStorage
.
removeItem
(
key
);
}
},
// 点击item
onChangeHandler
(
evt
)
{
this
.
activeIndex
=
evt
;
},
/**
* 设置语言
*/
setLangHandler
(
curData
)
{
this
.
showDropdownM
(
''
);
// 如果是语言设置,则设置语言
let
lang
=
curData
.
value
;
this
.
$i18n
.
locale
=
lang
;
localStorage
.
setItem
(
"lang"
,
lang
);
this
.
sTitle
=
curData
.
name
;
window
.
location
.
reload
();
},
initData
()
{
let
navList
=
[];
if
(
this
.
type
==
"nav"
)
{
navList
=
this
.
i18n
.
nav
.
navList
;
navList
.
forEach
(
element
=>
{
this
.
activeNames
.
push
(
[]
)
});
}
else
if
(
this
.
type
==
"login"
)
{
// 构建登陆页面
let
i18n
=
this
.
$i18n
.
messages
[
this
.
$i18n
.
locale
]
||
{};
let
menuData
=
JSON
.
parse
(
JSON
.
stringify
(
i18n
.
nav
.
loginData
));
let
list
=
[];
if
(
this
.
userInfo
&&
this
.
userInfo
.
name
)
{
menuData
.
name
=
this
.
userInfo
.
name
;
menuData
.
list
.
forEach
(
element
=>
{
if
(
element
.
type
==
"auth"
)
{
list
.
push
(
element
);
}
});
}
else
{
menuData
.
list
.
forEach
(
element
=>
{
if
(
element
.
type
==
"noAuth"
)
{
list
.
push
(
element
);
}
});
}
// menuData.list = list;
navList
=
list
;
// console.log("navList:", navList);
}
this
.
navList
=
navList
;
}
},
created
()
{
this
.
initData
();
},
watch
:
{
visible
(
newVal
,
oldVal
)
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
panel
.
scrollTop
=
0
;
});
},
userInfo
(
val
)
{
this
.
initData
();
}
},
};
src/components/home-bk/m-dropdown/m-dropdown.scss
deleted
100644 → 0
View file @
65761f0
@import
'@/styles/_support.scss'
;
.panel
{
z-index
:
9999
;
display
:
block
;
left
:
0
;
top
:
$navHeight-M
;
position
:
fixed
;
width
:
100%
;
height
:
100%
;
// background-color: rgba($color: #000000, $alpha: 0.3);
background-color
:
#ffffff
;
overflow
:
scroll
;
padding-bottom
:
200px
;
// 遮罩
.mask
{
width
:
100%
;
height
:
100%
;
position
:
fixed
;
z-index
:
5000
;
left
:
0
;
top
:
0
;
}
.list
{
position
:
relative
;
z-index
:
5001
;
padding
:
0
20px
;
// background-color: #ffffff;
}
// 国际化
.lang
{
position
:
relative
;
z-index
:
5002
;
display
:
flex
;
background-color
:
#ffffff
;
padding
:
20px
36px
;
&
-item
{
border-right
:
solid
1px
#ebedf0
;
padding
:
0
12px
;
@extend
.fcc
;
&
:first-child
{
padding
:
0
10px
0
0
;
}
&
-act
{
color
:
$cOrange
;
}
}
}
}
.coll-item-act
{
color
:
$cOrange
;
}
.list-item
{
@extend
.bb
;
display
:
flex
;
align-items
:
center
;
padding
:
16px
16px
;
position
:
relative
;
border-bottom
:
1px
solid
#ebedf0
;
font-size
:
14px
;
color
:
$cFontGray
;
background-color
:
#fff
;
.txt
{
flex
:
1
;
}
}
.icon-wrap
{
@extend
.fcc
;
height
:
100%
;
}
.plus-icon
{
width
:
21px
;
height
:
21px
;
background
:
url("~@/assets/images/home/icon-head-plus.png")
no-repeat
center
;
@extend
.bis
;
transform
:
scale
(
.6
);
}
.arrow-icon
{
width
:
21px
;
height
:
21px
;
background
:
url("~@/assets/images/home/icon-head-right-arrow.png")
no-repeat
center
;
@extend
.bis
;
transform
:
scale
(
.6
);
}
.plus-icon-act
{
background
:
url("~@/assets/images/home/icon-head-plus-act.png")
no-repeat
center
;
}
.hide
{
display
:
none
;
}
.
panel
:
:-
webkit-scrollbar
{
display
:
none
;
}
src/components/home-bk/m-dropdown/m-dropdown.vue
deleted
100644 → 0
View file @
65761f0
<
template
>
<div>
<div
ref=
"panel"
class=
"panel"
:class=
"
{'hide':!visible}">
<div
class=
"mask"
@
click=
"showDropdownM('')"
></div>
<!-- 列表 -->
<div
class=
"list"
>
<div
v-for=
"(item,index) in navList"
:key=
"item.id"
:index=
"index"
>
<van-collapse
@
change=
"onChangeHandler"
v-model=
"activeNames[index]"
v-if=
"item && item.list && item.list.length > 0"
>
<van-collapse-item
:border=
"borderBoo"
:title=
"item.name"
:name=
"index"
>
<div
slot=
"title"
>
<span
:class=
"
{'coll-item-act':index == activeIndex}">
{{
item
.
name
}}
</span>
</div>
<div
slot=
"right-icon"
>
<div
class=
"icon-wrap"
>
<div
class=
"plus-icon"
:class=
"
{'plus-icon-act':index == activeIndex}">
</div>
</div>
</div>
<div
@
click=
"onClickHandler(item2)"
class=
"list-item"
v-for=
"item2 in item.list"
:key=
"item2.id"
>
<div
class=
"arrow-icon"
></div>
<div
class=
"txt"
>
{{
item2
.
name
}}
</div>
</div>
</van-collapse-item>
</van-collapse>
<div
v-else
@
click=
"onClickHandler(item)"
class=
"list-item"
>
{{
item
.
name
}}
</div>
</div>
</div>
<!-- 语言 -->
<div
v-if=
"langList && langList.length > 0"
class=
"lang"
>
<div
@
click=
"setLangHandler(item)"
class=
"lang-item pointer"
:class=
"
{'lang-item-act':locale==item.value}" v-for="item in langList" :key="item.id">
{{
item
.
name
}}
</div>
</div>
</div>
</div>
</
template
>
<
script
src=
"./m-dropdown.js"
></
script
>
<
style
lang=
"scss"
scoped
>
@import
"./m-dropdown.scss"
;
</
style
>
Please
register
or
sign in
to post a comment