Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
liyeyun
Project
Project
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
cfld-frontend
liyeyun
Commits
bceaff99
Commit
bceaff99
authored
Dec 14, 2023
by
王玉鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 首页切换区域,选中项与url参数不同步修正
parent
87b68d29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
CommonHeader.vue
src/components/common/CommonHeader.vue
+8
-4
No files found.
src/components/common/CommonHeader.vue
View file @
bceaff99
...
@@ -144,6 +144,7 @@ import { useRoute } from 'vue-router';
...
@@ -144,6 +144,7 @@ import { useRoute } from 'vue-router';
// import cookie from 'js-cookie';
// import cookie from 'js-cookie';
import
{
useCity
}
from
'@/composable/useCity.ts'
;
import
{
useCity
}
from
'@/composable/useCity.ts'
;
import
type
{
DropdownInstance
}
from
'element-plus'
;
import
type
{
DropdownInstance
}
from
'element-plus'
;
import
type
{
RouteLocationRaw
}
from
'vue-router'
;
const
props
=
withDefaults
(
const
props
=
withDefaults
(
defineProps
<
{
defineProps
<
{
...
@@ -248,12 +249,15 @@ const changeCityStatus = (status: number) => {
...
@@ -248,12 +249,15 @@ const changeCityStatus = (status: number) => {
const
handleCityClick
=
(
cityName
:
string
)
=>
{
const
handleCityClick
=
(
cityName
:
string
)
=>
{
currentCity
.
value
=
cityName
;
currentCity
.
value
=
cityName
;
// cookie.set('city', cityName);
const
cityInFilter
=
provinceList
.
filter
((
item
)
=>
{
const
cityInFilter
=
provinceList
.
filter
((
item
)
=>
{
return
item
.
name
.
replace
(
/
\s
+/g
,
''
).
indexOf
(
cityName
)
>
-
1
;
return
item
.
name
.
replace
(
/
\s
+/g
,
''
).
indexOf
(
cityName
)
>
-
1
;
});
});
const
jump
=
(
params
:
RouteLocationRaw
)
=>
{
openPage
(
params
);
router
.
replace
(
params
);
};
if
(
cityInFilter
.
length
)
{
if
(
cityInFilter
.
length
)
{
openPage
({
jump
({
name
:
route
.
name
!
,
name
:
route
.
name
!
,
query
:
{
query
:
{
city
:
cityInFilter
[
0
].
name
,
city
:
cityInFilter
[
0
].
name
,
...
@@ -261,7 +265,7 @@ const handleCityClick = (cityName: string) => {
...
@@ -261,7 +265,7 @@ const handleCityClick = (cityName: string) => {
},
},
});
});
}
else
{
}
else
{
openPage
({
jump
({
name
:
route
.
name
!
,
name
:
route
.
name
!
,
query
:
{},
query
:
{},
});
});
...
@@ -275,7 +279,7 @@ const handleLogin = (type: 'loginByPhone' | 'register') => {
...
@@ -275,7 +279,7 @@ const handleLogin = (type: 'loginByPhone' | 'register') => {
};
};
const
toUserCenter
=
()
=>
{
const
toUserCenter
=
()
=>
{
dropdown
.
value
.
handleClose
();
dropdown
.
value
!
.
handleClose
();
if
(
!
(
route
.
name
as
string
).
includes
(
RouteName
.
userCenter
))
{
if
(
!
(
route
.
name
as
string
).
includes
(
RouteName
.
userCenter
))
{
router
.
push
(
RouteName
.
userCenter
);
router
.
push
(
RouteName
.
userCenter
);
}
}
...
...
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