Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
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
吴迪
gs1
Commits
f35559d4
Commit
f35559d4
authored
Jan 20, 2022
by
林家欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改中英文切换后当前语言显示问题
parent
976eed23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
24 deletions
+70
-24
topBanner.vue
src/components/layout/topBanner.vue
+70
-24
No files found.
src/components/layout/topBanner.vue
View file @
f35559d4
...
...
@@ -7,6 +7,10 @@
<span
class=
"el-dropdown-link"
>
{{
languageTxt
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</span>
<!--
<select
name=
""
id=
""
>
<option
value=
"中文"
>
中文
</option>
<option
value=
"英文"
>
英文
</option>
</select>
-->
<el-dropdown-menu
slot=
"dropdown"
class=
"language-dropdown-menu"
>
<el-dropdown-item
command=
"中文"
>
中文
</el-dropdown-item>
<el-dropdown-item
command=
"英文"
>
英文
</el-dropdown-item>
...
...
@@ -15,56 +19,97 @@
</div>
<div
class=
"top-banner-item tb-hover"
>
咨询电话:400-7000-690
</div>
<div
class=
"top-banner-item"
>
<img
src=
"../../assets/image/head/wx.png"
alt=
""
/>
<a
class=
"tb-hover"
target=
"_blank"
:href=
"`$
{urls.ancc}gs1cnweixin.aspx`">官方微信
</a>
<img
src=
"../../assets/image/head/wx.png"
alt=
""
/>
<a
class=
"tb-hover"
target=
"_blank"
:href=
"`$
{urls.ancc}gs1cnweixin.aspx`"
>官方微信
</a
>
</div>
<div
class=
"top-banner-item"
>
<img
src=
"../../assets/image/head/xlwb.png"
alt=
""
/>
<a
class=
"tb-hover"
target=
"_blank"
href=
"https://weibo.com/gs1cn"
>
官方微博
</a>
<img
src=
"../../assets/image/head/xlwb.png"
alt=
""
/>
<a
class=
"tb-hover"
target=
"_blank"
href=
"https://weibo.com/gs1cn"
>
官方微博
</a
>
</div>
<div
class=
"top-banner-item tb-hover"
@
click=
"handleSearch"
>
<img
src=
"../../assets/image/head/search.png"
alt=
""
/>
<img
src=
"../../assets/image/head/search.png"
alt=
""
/>
</div>
<div
@
click=
"toAdmin"
style=
"color: #00799e;display:flex;align-items: center;cursor: pointer;margin-left: 14px"
v-if=
"user.username"
>
<img
style=
"width:22px;"
src=
"../../assets/image/mymanage/pic_touxiang.png"
alt=
""
>
<!--
<span
style=
""
>
个人中心:
</span>
-->
<span
class=
"gs-hover"
style=
"margin-left: 4px;font-weight: bold"
>
{{
user
.
username
}}
</span>
<div
@
click=
"toAdmin"
style=
"
color: #00799e;
display: flex;
align-items: center;
cursor: pointer;
margin-left: 14px;
"
v-if=
"user.username"
>
<img
style=
"width: 22px"
src=
"../../assets/image/mymanage/pic_touxiang.png"
alt=
""
/>
<!--
<span
style=
""
>
个人中心:
</span>
-->
<span
class=
"gs-hover"
style=
"margin-left: 4px; font-weight: bold"
>
{{
user
.
username
}}
</span>
</div>
</div>
</div>
</
template
>
<
script
>
import
{
mapState
}
from
"vuex"
;
import
{
mapState
}
from
"vuex"
;
export
default
{
name
:
"topBanner"
,
computed
:
{
...
mapState
([
"urls"
]),
},
watch
:
{
$route
:
{
handler
(
val
)
{
const
currentRouterComp
=
val
.
matched
[
val
.
matched
.
length
-
1
].
components
.
default
.
__file
;
if
(
currentRouterComp
.
indexOf
(
'English'
)
!==
-
1
)
{
this
.
languageTxt
=
'英文'
;
}
else
{
this
.
languageTxt
=
'中文'
;
}
},
immediate
:
true
,
},
},
created
()
{
this
.
user
=
localStorage
.
getItem
(
'loginInfo'
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'loginInfo'
))
:
{}
console
.
log
(
this
.
user
)
this
.
user
=
localStorage
.
getItem
(
"loginInfo"
)
?
JSON
.
parse
(
localStorage
.
getItem
(
"loginInfo"
))
:
{};
console
.
log
(
this
.
user
);
},
data
()
{
return
{
user
:
{},
languageTxt
:
'中文'
}
languageTxt
:
"中文"
,
}
;
},
methods
:
{
toAdmin
()
{
if
((
this
.
user
.
userType
===
1
&&
this
.
user
.
isXT
!==
1
)
||
(
this
.
user
.
userType
===
2
&&
this
.
user
.
isXT
!==
1
)
||
(
this
.
user
.
userType
===
3
&&
this
.
user
.
levels
===
null
))
{
this
.
$router
.
push
({
path
:
'/MyManage/UnVerify/index'
})
if
(
(
this
.
user
.
userType
===
1
&&
this
.
user
.
isXT
!==
1
)
||
(
this
.
user
.
userType
===
2
&&
this
.
user
.
isXT
!==
1
)
||
(
this
.
user
.
userType
===
3
&&
this
.
user
.
levels
===
null
)
)
{
this
.
$router
.
push
({
path
:
"/MyManage/UnVerify/index"
});
}
else
if
(
this
.
user
.
isXT
===
1
)
{
this
.
$router
.
push
({
path
:
'/MyManage/SystemMember/index'
})
this
.
$router
.
push
({
path
:
"/MyManage/SystemMember/index"
});
}
else
if
(
this
.
user
.
levels
===
0
)
{
this
.
$router
.
push
({
path
:
'/MyManage/admin/check'
})
this
.
$router
.
push
({
path
:
"/MyManage/admin/check"
});
}
else
if
(
this
.
user
.
levels
===
1
)
{
this
.
$router
.
push
({
path
:
'/MyManage/admin/check'
})
this
.
$router
.
push
({
path
:
"/MyManage/admin/check"
});
}
else
if
(
String
(
this
.
user
.
levels
).
length
===
4
)
{
this
.
$router
.
push
({
path
:
'/MyManage/admin/check'
})
this
.
$router
.
push
({
path
:
"/MyManage/admin/check"
});
}
},
handleSearch
()
{
...
...
@@ -73,8 +118,9 @@ export default {
});
},
handleClick
(
val
)
{
this
.
languageTxt
=
val
if
(
val
==
'中文'
)
{
console
.
log
(
val
,
"val"
);
this
.
languageTxt
=
val
;
if
(
val
==
"中文"
)
{
this
.
$router
.
push
({
path
:
"/Home"
,
});
...
...
@@ -83,7 +129,7 @@ export default {
path
:
"/EnglishHome"
,
});
}
}
}
,
},
};
</
script
>
...
...
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